Code Monkey home page Code Monkey logo

gvsbuild's Introduction

gvsbuild

CI

This python script helps you build a full GTK library stack for Windows using Visual Studio. Currently, GTK 3 and GTK 4 are supported.

Install GTK Only

If you want to only run GTK on Windows and not build it yourself, you can download a zip file from the latest release and unzip it to C:\gtk.

It comes with GTK4, Cairo, PyGObject, Pycairo, GtkSourceView5, adwaita-icon-theme, and all of their dependencies.

Note however that these binaries are provided “AS IS”, WITHOUT WARRANTY OF ANY KIND. They just contain the output of our latest CI run. They are not tested, and we cannot commit to timely updates even for security issues. We strongly recommend to build your own binaries, especially if you plan to distribute them with your application or use them in production.

Environmental Variables

Finally, add GTK to your environmental variables with:

$env:Path = "C:\gtk\bin;" + $env:Path
$env:LIB = "C:\gtk\lib;" + $env:LIB
$env:INCLUDE = "C:\gtk\include;C:\gtk\include\cairo;C:\gtk\include\glib-2.0;C:\gtk\include\gobject-introspection-1.0;C:\gtk\lib\glib-2.0\include;" + $env:INCLUDE

PyGObject and PyCairo

If you are going to use PyGObject and Pycairo, you also need to use the gvsbuild generated wheels with your Python virtualenv in order to work around this PyGObject bug:

pip install --force-reinstall (Resolve-Path C:\gtk\wheels\PyGObject*.whl)
pip install --force-reinstall (Resolve-Path C:\gtk\wheels\pycairo*.whl)

Build GTK

The script supports multiple versions of Visual Studio - at the moment we are focusing on VS 2022, but we include projects for other versions, and we gladly accept patches.

The script focuses on GTK and the surrounding ecosystem (e.g. GStreamer). However, we are open to adding more libraries as long as the contributor takes on the responsibility for keeping it up to date. The supported projects are modules in the projects directory.

The script requires a working installation of Visual Studio for Windows Desktop, Python 3 and msys2. The script will download any additional tools required to build the libraries and will use them from a local directory, without any installation. As of today these tools include cmake, meson, ninja, nuget and perl.

The script fetches source tarballs for the projects from their original locations, however in some cases it might be necessary to host a patched tarball on GitHub. To ensure integrity of the downloaded files, the script checks the SHA256 hash of each download. Downloads are done using TLS, using SSL certificates provided by the system, but in case of error the download is tried again ignoring certificate errors.

Development Environment

Choco

We recommend using Chocolately as a package manager in Windows.

To install it, open PowerShell as an administrator, then execute:

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

To run local scripts in follow-on steps, also execute Set-ExecutionPolicy RemoteSigned. This allows for local PowerShell scripts to run without signing, but still requires signing for remote scripts.

Git

To setup a development environment in Windows install Git by executing as an administrator:

choco install git

MSYS2

Both of the development environments in the next steps need MSYS2 installed.

Install MSYS2:

Keep PowerShell open as administrator and execute:

choco install msys2

Building GTK

First we will install the gvsbuild dependencies:

  1. Visual C++ build tools workload for Visual Studio 2022 Build Tools
  2. Python

Install Visual Studio 2022

With your admin PowerShell terminal:

choco install visualstudio2022-workload-vctools

Note: Visual Studio versions 2013 (not for all projects), 2015, 2017, 2019, and 2022 are currently supported.

Install the Latest Python

In Windows, The official installer contains all the Python components and is the best option for developers using Python for any kind of project.

For more information on how to use the official installer, please see the full installer instructions. The default installation options should be fine for use with gvsbuild.

  1. Install the latest Python version using the official installer.

  2. Open a PowerShell terminal as a normal user and check the python version:

    py -3.12 --version

Install gvsbuild

The recommended way to install gvsbuild is with pipx. Open a new regular user PowerShell terminal and execute:

py -3.12 -m pip install --user pipx
py -3.12 -m pipx ensurepath
pipx install gvsbuild

Alternatively, you can also use git to clone the repository and install it. Open a new regular user PowerShell terminal and execute:

mkdir C:\gtk-build\github
cd C:\gtk-build\github
git clone https://github.com/wingtk/gvsbuild.git
cd C:\gtk-build\github\gvsbuild
python -m venv .venv
.\.venv\Scripts\activate.ps1
pip install .

Build GTK

In the same PowerShell terminal, execute:

gvsbuild build gtk3

Alternatively, if you want to build GTK 4, execute:

gvsbuild build gtk4

Grab a coffee, the build will take a few minutes to complete.

Add GTK to Your Environmental Variables

  1. From the Start menu, go to the Control Panel entry for “Edit environment variables for your account”.
  2. Double-click the Path row in the top list of variables. Click “New” to add a new item to the list.
  3. Paste in C:\gtk-build\gtk\x64\release\bin
  4. Click "OK" twice.

Using GTK with Visual Studio

  1. Open Visual Studio and "Create a new project" using the "Empty Project" template

  2. On the left, right click on "Source Files" and choose "Add", then "New Item..." and replace the name with main.c

  3. Paste in the following contents, then save the file:

    #include <gtk/gtk.h>
    
    static void activate_cb(GtkApplication *app) {
      GtkWidget *window = gtk_application_window_new(app);
      gtk_widget_set_visible(window, true);
    }
    
    int main(int argc, char **argv) {
      GtkApplication *app =
          gtk_application_new("org.app", G_APPLICATION_DEFAULT_FLAGS);
      g_signal_connect(app, "activate", G_CALLBACK(activate_cb), NULL);
      return g_application_run(G_APPLICATION(app), argc, argv);
    }
    
  4. Go to your project's settings by right-clicking and choosing "Properties"

    screenshot showing the properties item is at the bottom of the context menu

  5. On the left, open "C/C++", then choose "Command Line".

    1. Open "Powershell" and run the command pkg-config --cflags gtk4 --msvc-syntax
    2. Paste the result into the "Additional Options" field at the bottom of the Visual Studio Properties window.

    screenshot showing the "Additional Options" field to modify

  6. Still in the Visual Studio window, click on "Linker" and choose "Command Line". Do the same thing as the last step, except use the output of pkg-config --libs gtk4 --msvc-syntax

  7. Click "OK"

  8. In the top menu bar, click "Debug" and "Start Without Debugging"

Using GTK with Rust

See the fantastic gtk-rs book. You can skip the "Install GTK 4" step, as the above steps ^ covered that.

Use PyGObject

First, add GTK to your environment variables:

$env:LIB = "C:\gtk-build\gtk\x64\release\lib;" + $env:LIB
$env:INCLUDE = "C:\gtk-build\gtk\x64\release\include;C:\gtk-build\gtk\x64\release\include\cairo;C:\gtk-build\gtk\x64\release\include\glib-2.0;C:\gtk-build\gtk\x64\release\include\gobject-introspection-1.0;C:\gtk-build\gtk\x64\release\lib\glib-2.0\include;" + $env:INCLUDE

Next, add the --enable-gi and --py-wheel options like:

gvsbuild build --enable-gi --py-wheel gtk4 pygobject

Once that finishes, then you need to use the gvsbuild generated wheels with your Python virtualenv in order to work around this PyGObject bug:

pip install --force-reinstall (Resolve-Path C:\gtk-build\build\x64\release\pygobject\dist\PyGObject*.whl)
pip install --force-reinstall (Resolve-Path C:\gtk-build\build\x64\release\pycairo\dist\pycairo*.whl)

Use Icons with GTK

If you are going to use SVG icons with a GTK app, you need to also need to build librsvg. Normally you want to build GTK with gvsbuild build gtk4 adwaita-icon-theme which will include librsvg and hicolor-icon-theme.

Other Options

For more information about the possible commands run:

gvsbuild --help

To get detailed help on the build command run:

gvsbuild build --help

It is possible to set some parameters from a file, e.g. vs2015-release.pro, putting the @ character before the file name. The file contains the option, one per line, separated by a carriage return:

--vs-ver
14
--win-sdk
8.1
--configuration
release

Even if the format is not the easier to write or read in this way we eliminate the problem of escaping spaces is file names and directories. Then you can use it:

gvsbuild build @vs2015-release.pro gtk3-full

Troubleshooting

  • If a build fails, try rebuilding it with --clean, if that fails, try rebuilding it with --from-scratch
  • If the download of a tarball fails a partial file will not pass the hash check, delete the file and try again.

OpenSSL

In addition to the setup instructions above, to build OpenSSL you also need the Visual C++ 2013 Redistributable Package installed. To install it, open PowerShell as administrator and execute:

choco install vcredist2013

Similar to other packages, you can build OpenSSL by executing:

gvsbuild build openssl

Dependency Graph

To see and analyze the dependency between the various projects, in text or in a Graphviz format, use the script deps.py:

gvsbuild deps --graph --gv-file test.gv

Without option a simple dependency of all the projects is printed, as usual with --help a summary of the options/commands is printed.

Gvsbuild Users

The following projects are using Gvsbuild for Windows GTK cross-platform support:

  • Deluge - BitTorrent client
  • Gaphor - A simple SysML/UML modeling tool
  • PothosSDR - Software-Defined Radio development environment
  • SkyTemple Randomizer - Randomizer for Pokémon Mystery Dungeon Explorers of Sky

Are you using Gvsbuild? Please submit a Pull Request to add your app to the list.

License

This build script is licensed under the GPL2.0 license, see the COPYING file for the full text.

The binaries produced by the build script are licensed under the license terms of the project that is built (ie glib is LGPL so you can use glib.dll built with this script under the terms of LGPL).

Patches included in the repository are licensed under the license terms of the project they apply to.

Credits

This tool originated from a gtk-win32 PowerShell script created by the HexChat developers for building it for Windows. Although this project is now archived, you can explore the original project if you are interested in the history at https://github.com/hexchat/gtk-win32.

Compiling the GTK stack on MSVC would not be possible without the incredible work by Fan Chun-wei. If you are interested in more details of how this works, please see Compiling the GTK+ (and Clutter) stack using Visual C++ 2008 and later.

gvsbuild's People

Contributors

accel2k avatar alessandrobono avatar biagiofesta avatar bingtsc avatar bviktor avatar danyeaw avatar dependabot[bot] avatar doadin avatar fabiosky avatar gurudanny67 avatar ignazp avatar joshdoe avatar lazka avatar liudonghua123 avatar mhertz avatar mitchhentges avatar nacho avatar nzjrs avatar pbor avatar qazbob avatar selaux avatar sganis avatar sineaggi avatar spk121 avatar thecapypara avatar thezoc avatar tingping avatar togetherwithasteria avatar tomek avatar wsw0108 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gvsbuild's Issues

Error build the gtk solution for vs14

Error build the 'gtk' solution for Visual Studio 2015

..\..\..\gtk\updateiconcache.c : fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory [C:\gtk-build\build\x64\release\gtk\build\win32\vs14\gtk-update-icon-cache.vcxproj]

Use upstream win32 build files

For all of the G* stack we should use Fan's (upstream) solutions. The main changes the hexchat folks made are

  • a global stack.props controlling things like optomisation level
  • the output directory

IMO the output directory should be left as is and the packaging step of build.ps should be updated to reflect Fan's conventions.

This is related to #2 as they will both likely be solved at the same time.

cairo build failed

build environment:

Windows 10+Visual Studio 2015

Expect:

After follow https://github.com/wingtk/gtk-win32 I should build gtk3 succ!

Actual:
Failed at cairo build step.

What I Do:
I try to dig the problem and found a one thing I don't understand .

As line:[email protected] self.exec_vs(r'make -f Makefile.win32 pixman CFG=%(configuration)s ' + optimizations, add_path=add_path)

is this right? or should be nmake based?

Default patches dir

I try to implement the hash check on the tarballs and I'm learning git so I have a lot of dirs under c:\gtk-build\github.
If you don't pass the --patches-root-dir parameter the script use (build-dir)\github\gtk-win32 while the option helps says 'The directory where you checked out ...' and this generate an error when I removed the gtk-win32 dir to have only mine.
If I have the correct one if I launch the build in an other checkout of the stack the system gets the parameters always from the gtk-win32 dir and this can lead to error or mistakes if someone wants to get different versions of the script.
The solution is really simple (just add '--patches-root-dir .' on the command line) but is not more correct use, as a default, the same directory of the build.py script ?

Thank in advance
Daniele Forghieri

gettext-runtime issues

When attempting to compile from scratch, following the instructions on README.md, the build.py script asks for the files to patch.

Building project gettext-runtime
(Stripping trailing CRs from patch; use --binary to disable.)
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ruN --strip-trailing-cr gettext-runtime-0.18.orig/gettext-runtime/intl/intl.def gettext-runtime-0.18/gettext-runtime/intl/intl.def
|--- gettext-runtime-0.18.orig/gettext-runtime/intl/intl.def    2012-09-28 21:56:54 +0200
|+++ gettext-runtime-0.18/gettext-runtime/intl/intl.def 2012-09-28 21:56:44 +0200
--------------------------
File to patch: intl/intl.def
patching file intl/intl.def
(Stripping trailing CRs from patch; use --binary to disable.)
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Naur gettext-orig/gettext-runtime/intl/CMakeLists.txt gettext-mod/gettext-runtime/intl/CMakeLists.txt
|--- gettext-orig/gettext-runtime/intl/CMakeLists.txt   2012-01-21 21:10:25.000000000 -0700
|+++ gettext-mod/gettext-runtime/intl/CMakeLists.txt    2015-12-02 16:23:51.903960200 -0700
--------------------------
File to patch: intl/CMakeLists.txt
patching file intl/CMakeLists.txt

When providing the files and their path manually (As in the above text), the build script continues to run, but fails soon after:

[ 93%] Building RC object intl/CMakeFiles/intl.dir/libintl.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17336
Copyright (C) Microsoft Corporation.  All rights reserved.

C:\gtk-build\build\x64\gettext-runtime\intl\libintl.rc(6) : error RC2104 : undefined keyword or key name: PACKAGE_VERSION_MAJOR
NMAKE : fatal error U1077: 'C:\PROGRA~2\WI3CF2~1\8.1\bin\x64\rc.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
Traceback (most recent call last):
  File ".\build.py", line 1129, in build
    self.__build_one(p)
  File ".\build.py", line 1169, in __build_one
    proj.build()
  File ".\build.py", line 404, in build
    self.exec_vs(r'nmake /nologo', add_path=self.builder.opts.cmake_path)
  File ".\build.py", line 118, in exec_vs
    self.builder.exec_vs(cmd, working_dir=self._get_working_dir(), add_path=add_path)
  File ".\build.py", line 1240, in exec_vs
    self.__execute(self.__sub_vars(cmd), working_dir=working_dir, add_path=add_path, env=self.vs_env)
  File ".\build.py", line 1272, in __execute
    subprocess.check_call(args, cwd=working_dir, env=env, shell=True)
  File "c:\Python27\lib\subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command 'nmake /nologo' returned non-zero exit status 2
Error: gettext-runtime build failed

C:\gtk-build\github\gtk-win32>

This was happening with VS2015, so I downloaded VS2013 Update 5 Community Edition to try, but the same problem happens.

The command line I'm using is: c:\Python27\python.exe .\build.py build -p x64 gtk3

Missing cairo .pc files

Now that we have meson support, it makes usage of the pc files to find the deps. We should add the cairo pc files. At least we need the cairo.pc, cairo-gobject.pc and cairo-win32.pc

lmdb 0.9.18

We should update lmdb. This means rebasing the current fork and making our own tarball with it.

Add adwaita-icon-theme

In order to build it we need to first have libcroco, librsvg, hicolor-icon-theme and icon-naming-utils. @fanc999 have you had any luck on building this and creating the proper projects etc?

meson: we should ensure python and perl are in the path

Currently if you try to build libepoxy and you do not have python in the path the build will fail. I had to do somethign like: set PATH=%PATH%;\python32

I think we should always add python to the path as part of the build steps, and most probably also perl.

Failed to build GTK3 with MSVC X64

...
Generating GTK+ DBUS Sources...
'\python' is not recognized as an internal or external command,
operable program or batch file.
...

We need to define PythonPathX64 variable in "gtk3/build/win32/ * /gtk3-version-paths.props".
It used to generate "gtk\gtkdbusgenerated.*" files during build.

gtk3-python-path-x64.txt

Python Syntax error

I tried to run the command python .\build.py build gtk3 in the directory C:\gtk-build\github\gtk-win32.
However, it sends out an error saying
` File ".\build.py", line 1455
print("Error:", msg, file-sys.stderr

SyntaxError: invalid syntax`

I'm a beginner in using MSYS, gtk.. could you help me on what I might have done wrong?

Error: lmdb build failed for vs14

Error: lmdb build failed for vs14

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v120 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, please install v120 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\gtk-build\build\x64\release\lmdb\libraries\liblmdb\lmdb.vcxproj]

I think you need to add the 'build/win32' of root directory to share the (vs12, vs14) solutions inclusive.
I can prepare a pull request.

Add support for meson

Some projects like libepoxy and graphene depend or will depend on meson. We should add support for this build system. For this we need to automatically download ninja and meson, see #107 and then use meson to build those modules.

We should add and check sha256 hashes

As with the urls we should also include the hashes of the tarballs and check them before building so we ensure the tarball was properly downloaded and that we are using the right one and not something hacked.

calling C:\msys64\usr\bin\tar.exe with full path fails to extract *.tar.bz2 files

I'm not sure why, but if I change the build.ps1 script to run tar command simply as tar instead of using the full path to the C:\msys64\usr\bin\tar.exe (as it's defined in the $tar variable) then it works.

Otherwise, I always get this error when the script attempts to extract .tar.bz2 files:

C:\msys64\usr\bin\tar.exe ixf /c/gtk-build/src/freetype-2.6.tar.bz2 -C /c/gtk-build/build/Win32

/usr/bin/tar: This does not look like a tar archive
/usr/bin/tar: Skipping to next header

bzip2: Data integrity error when decompressing.
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to *attempt* to recover
data from undamaged sections of corrupted files.

/usr/bin/tar: Child returned status 2
/usr/bin/tar: Error is not recoverable: exiting now
diff --git a/build.ps1 b/build.ps1
index 8dacd4a..bac4d6f 100644
--- a/build.ps1
+++ b/build.ps1
@@ -1312,7 +1312,7 @@ $items.GetEnumerator() | %{
        $env:PATH += ";$Msys2Directory\usr\bin"

        if ($item.Name -ne 'gettext-runtime') {
-           Exec $tar ixf $(ConvertTo-Msys2Path $item.ArchiveFile) -C $(ConvertTo-Msys2Path $workingDirectory)
+           Exec tar ixf $(ConvertTo-Msys2Path $item.ArchiveFile) -C $(ConvertTo-Msys2Path $workingDirectory)

            $outputDirectoryName = [System.IO.Path]::GetFilenameWithoutExtension($item.ArchiveFile.BaseName)

@@ -1329,7 +1329,7 @@ $items.GetEnumerator() | %{
        else {
            # gettext-runtime is a tarbomb
            [void] (New-Item -Type Directory $item.BuildDirectory)
-           Exec $tar ixf $(ConvertTo-Msys2Path $item.ArchiveFile) -C $(ConvertTo-Msys2Path $item.BuildDirectory)
+           Exec tar ixf $(ConvertTo-Msys2Path $item.ArchiveFile) -C $(ConvertTo-Msys2Path $item.BuildDirectory)
        }

        "Extracted $($item.ArchiveFile.Name)"

No default icons shipped

I've built my program with GTK3 stack, it seems to be running OK.
The issue here is that the default GTK stock icons seem to be missing, and that "hicolor-icon-theme" package is empty, shipping only gtk3-demo.png icon.
I get GTK warnings as in this example:
"Error loading theme icon 'edit-cut' for stock: Icon 'edit-cut' not present in theme Adwaita"

Are stock icons deprecated? Can we ship some standard set of icons within this package?
I tried to install "gnome-icon-theme" (to have something at least) but it is not supported here...

Any advice?

Best regards,
Miroslav

Update to glib 2.44

so I started the update to glib 2.44 in the wip/hrebase and I get the next errors:
glib : "C:\gtk-build\build\Win32\glib\build\win32\vs12\glib.sln" (default target) (1) ->
glib : "C:\gtk-build\build\Win32\glib\build\win32\vs12\gio.vcxproj" (default target) (9) ->
glib : (ClCompile target) ->
glib : c1 : fatal error C1083: Cannot open source file: '......\gio\gcontextspecificgroup.c': No such file or
directory [C:\gtk-build\build\Win32\glib\build\win32\vs12\gio.vcxproj]
glib : c1 : fatal error C1083: Cannot open source file: '......\gio\ghttpproxy.c': No such file or directory
[C:\gtk-build\build\Win32\glib\build\win32\vs12\gio.vcxproj]
glib : c1 : fatal error C1083: Cannot open source file: '......\gio\glistmodel.c': No such file or directory
[C:\gtk-build\build\Win32\glib\build\win32\vs12\gio.vcxproj]
glib : c1 : fatal error C1083: Cannot open source file: '......\gio\gliststore.c': No such file or directory
[C:\gtk-build\build\Win32\glib\build\win32\vs12\gio.vcxproj]
glib : c1 : fatal error C1083: Cannot open source file: '......\gio\gsimpleiostream.c': No such file or direc
tory [C:\gtk-build\build\Win32\glib\build\win32\vs12\gio.vcxproj]

Error building wing with meson 0.39

The wing project cannot be build with the new meson version that complains about trying to form an absolute path to a source dir, a new check in this version (using the same command with meson 0.38.1 work and create the library correctly).

In the long run the solution is to fix the meson.build file but if needed we can use, only for this project, the old version (should be a matter of 10 lines of code, so we can test multiple versions of the same tool).

Build script cannot find "intl.lib" / "libintl.h"

Trying to build with
C:\gtk-build\github\gtk-win32>python .\build.py build --perl-dir "C:\strawberry\perl\bin\perl.exe" --msys-dir "C:\msys2" --nuget-path "C:\ProgramData\chocolatey\bin\NuGet.exe" --patches-root-dir "C:\gtk-build\github\gtk-win32" --clean --vs-ver 14 -p x64 gtk3

results in

Building project glib
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targe
ts(1189,5): warning MSB8012: TargetPath(C:\gtk-build\build\x64\release\glib\bui
ld\win32\vs14\Release\x64\bin\glib.dll) does not match the Linker's OutputFile
property value (C:\gtk-build\build\x64\release\glib\build\win32\vs14\Release\x6
4\bin\glib-2.0.dll). This may cause your project to build incorrectly. To corre
ct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) proper
ty values match the value specified in %(Link.OutputFile). [C:\gtk-build\build\
x64\release\glib\build\win32\vs14\glib.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targe
ts(1191,5): warning MSB8012: TargetName(glib) does not match the Linker's Outpu
tFile property value (glib-2.0). This may cause your project to build incorrect
ly. To correct this, please make sure that $(OutDir), $(TargetName) and $(Targe
tExt) property values match the value specified in %(Link.OutputFile). [C:\gtk-
build\build\x64\release\glib\build\win32\vs14\glib.vcxproj]
  glib.vcxproj -> C:\gtk-build\build\x64\release\glib\build\win32\vs14\Release\
  x64\bin\glib.dll
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targe
ts(1189,5): warning MSB8012: TargetPath(C:\gtk-build\build\x64\release\glib\bui
ld\win32\vs14\Release\x64\bin\gmodule.dll) does not match the Linker's OutputFi
le property value (C:\gtk-build\build\x64\release\glib\build\win32\vs14\Release
\x64\bin\gmodule-2.0.dll). This may cause your project to build incorrectly. To
 correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt)
property values match the value specified in %(Link.OutputFile). [C:\gtk-build\
build\x64\release\glib\build\win32\vs14\gmodule.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targe
ts(1191,5): warning MSB8012: TargetName(gmodule) does not match the Linker's Ou
tputFile property value (gmodule-2.0). This may cause your project to build inc
orrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $
(TargetExt) property values match the value specified in %(Link.OutputFile). [C
:\gtk-build\build\x64\release\glib\build\win32\vs14\gmodule.vcxproj]
LINK : fatal error LNK1181: Eingabedatei "intl.lib" kann nicht ge÷ffnet werden.
 [C:\gtk-build\build\x64\release\glib\build\win32\vs14\gmodule.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targe
ts(1189,5): warning MSB8012: TargetPath(C:\gtk-build\build\x64\release\glib\bui
ld\win32\vs14\Release\x64\bin\gthread.dll) does not match the Linker's OutputFi
le property value (C:\gtk-build\build\x64\release\glib\build\win32\vs14\Release
\x64\bin\gthread-2.0.dll). This may cause your project to build incorrectly. To
 correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt)
property values match the value specified in %(Link.OutputFile). [C:\gtk-build\
build\x64\release\glib\build\win32\vs14\gthread.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targe
ts(1191,5): warning MSB8012: TargetName(gthread) does not match the Linker's Ou
tputFile property value (gthread-2.0). This may cause your project to build inc
orrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $
(TargetExt) property values match the value specified in %(Link.OutputFile). [C
:\gtk-build\build\x64\release\glib\build\win32\vs14\gthread.vcxproj]
LINK : fatal error LNK1181: Eingabedatei "intl.lib" kann nicht ge÷ffnet werden.
 [C:\gtk-build\build\x64\release\glib\build\win32\vs14\gthread.vcxproj]
LINK : fatal error LNK1181: Eingabedatei "intl.lib" kann nicht ge÷ffnet werden.
 [C:\gtk-build\build\x64\release\glib\build\win32\vs14\glib-genmarshal.vcxproj]
  gspawn-win32-helper.c
c:\gtk-build\build\x64\release\glib\glib\glibintl.h(16): fatal error C1083: Dat
ei (Include) kann nicht geöffnet werden: "libintl.h": No such file or directory
 [C:\gtk-build\build\x64\release\glib\build\win32\vs14\gspawn-win32-helper.vcxp
roj]
  gspawn-win32-helper-console.c
c:\gtk-build\build\x64\release\glib\glib\glibintl.h(16): fatal error C1083: Dat
ei (Include) kann nicht geöffnet werden: "libintl.h": No such file or directory
 [C:\gtk-build\build\x64\release\glib\build\win32\vs14\gspawn-win32-helper-cons
ole.vcxproj]
Traceback (most recent call last):
  File ".\build.py", line 1235, in build
    self.__build_one(p)
  File ".\build.py", line 1275, in __build_one
    proj.build()
  File ".\build.py", line 460, in build
    self.exec_msbuild(r'build\win32\vs%(vs_ver)s\glib.sln /p:PythonPath=%(python
_dir)s', configuration=configuration)
  File ".\build.py", line 126, in exec_msbuild
    self.exec_vs('msbuild ' + cmd + ' /p:Configuration=' + configuration + ' %(m
sbuild_opts)s', add_path=add_path)
  File ".\build.py", line 121, in exec_vs
    self.builder.exec_vs(cmd, working_dir=self._get_working_dir(), add_path=add_
path)
  File ".\build.py", line 1348, in exec_vs
    self.__execute(self.__sub_vars(cmd), working_dir=working_dir, add_path=add_p
ath, env=self.vs_env)
  File ".\build.py", line 1380, in __execute
    subprocess.check_call(args, cwd=working_dir, env=env, shell=True)
  File "C:\Python27\lib\subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command 'msbuild build\win32\vs14\glib.sln /p:PythonPath=c:\
Python27 /p:Configuration=Release_BundledPCRE /nologo /p:Platform=x64   /v:minim
al' returned non-zero exit status 1
Error: glib build failed

I installed every possible libintl package in MSYS2, no success.

Any pointers where

Add gtk4

Now that graphene is in we should be able to add gtk 4.

Visual Studio 2015 support

Hello,

I've added ~20 pull requests to the project. As I could understand from #29, this was required to aid in merging.
Most of the work was done by @intity on his pull request, I just fixed some problems that I found and submitted a pull request for each project separately.

From what I could gather, everything should work, except GTK3, where I'm getting the error C1001.
I'm using Visual Studio 2015 Update 2.

Gist for the output of the command line.

I hope this helps to speed up the merging process and add support to VS2015 😄
I'm anxious to use GTK on Windows 😀

Error with tool if building with --no-deps

if you run the build with --no-deps flag the tools paths (meson, ninja or nuget) are not loaded and you get an exception, something like:
Attribute error: 'Builder' object has no attribute 'meson' (or 'ninja' or 'nuget').

support unicode?

Really thank you for clear build instructions so I'm able to build it successfully.

however I got the problem when using it. I guess it's due to my project is set to build "use unicode character set", so it's mixing char/wchar ...

Here is the crash stack,

win32 configuration:
2015-09-17_1207

x64 configuration:
2015-09-17_1209

do you have a solution? thank you.

Update meson to 0.39.0

This release contains some fixes that we require, like the installation of the pdb files.

gtk3-demo crashed on 'Tool Palette' example.

Both versions (x86, x64) are vulnerable. Compiled with Visual Studio Professional 2013.

Call stack:

glib-2.0.dll!g_str_hash(const void * v) Line 1876 C
glib-2.0.dll!g_hash_table_lookup_node(_GHashTable * hash_table, const void * key, unsigned int * hash_return) Line 375 C
glib-2.0.dll!g_hash_table_replace(_GHashTable * hash_table, void * key, void * value) Line 1278 C
gtk-3-3.0.dll!gtk_icon_theme_list_contexts(_GtkIconTheme * icon_theme) Line 2676 C
gtk3-demo.exe!load_icon_items(_GtkToolPalette * palette) Line 647 C
gtk3-demo.exe!do_toolpalette(_GtkWidget * do_widget) Line 525 C
gtk3-demo.exe!run_example_for_row(_GtkWidget * window, _GtkTreeModel * model, _GtkTreeIter * iter) Line 128 C
gtk3-demo.exe!row_activated_cb(_GtkWidget * tree_view, _GtkTreePath * path, _GtkTreeViewColumn * column) Line 945 C
gtk-3-3.0.dll!_gtk_marshal_VOID__BOXED_OBJECT(_GClosure * closure, _GValue * return_value, unsigned int n_param_values, const _GValue * param_values, void * invocation_hint, void * marshal_data) Line 3170 C
gobject-2.0.dll!g_closure_invoke(_GClosure * closure, _GValue * return_value, unsigned int n_param_values, const _GValue * param_values, void * invocation_hint) Line 808 C
gobject-2.0.dll!signal_emit_unlocked_R(_SignalNode * node, unsigned int detail, void * instance, _GValue * emission_return, const _GValue * instance_and_params) Line 3635 C
gobject-2.0.dll!g_signal_emit_valist(void * instance, unsigned int signal_id, unsigned int detail, char * var_args) Line 3385 C
gobject-2.0.dll!g_signal_emit(void * instance, unsigned int signal_id, unsigned int detail, ...) Line 3441 C
gtk-3-3.0.dll!gtk_tree_view_row_activated(_GtkTreeView * tree_view, _GtkTreePath * path, _GtkTreeViewColumn * column) Line 12623 C
gtk-3-3.0.dll!gtk_tree_view_multipress_gesture_pressed(_GtkGestureMultiPress * gesture, int n_press, double x, double y, _GtkTreeView * tree_view) Line 3370 C
gobject-2.0.dll!ffi_call_win32(unsigned long * ffi_prep_args, unsigned long * ecif, unsigned long cif_abi, unsigned long cif_bytes, unsigned long cif_flags, unsigned long * rvalue, unsigned long * fn) Line 965 Unknown
gobject-2.0.dll!ffi_call(ffi_cif * cif, void (void) * fn, void * rvalue, void * * avalue) Line 404 C
gobject-2.0.dll!g_cclosure_marshal_generic_va(_GClosure * closure, _GValue * return_value, void * instance, char * args_list, void * marshal_data, int n_params, unsigned int * param_types) Line 1607 C
gobject-2.0.dll!_g_closure_invoke_va(_GClosure * closure, _GValue * return_value, void * instance, char * args, int n_params, unsigned int * param_types) Line 871 C
gobject-2.0.dll!g_signal_emit_valist(void * instance, unsigned int signal_id, unsigned int detail, char * var_args) Line 3300 C
gobject-2.0.dll!g_signal_emit(void * instance, unsigned int signal_id, unsigned int detail, ...) Line 3441 C
gtk-3-3.0.dll!gtk_gesture_multi_press_begin(_GtkGesture * gesture, _GdkEventSequence * sequence) Line 243 C
gobject-2.0.dll!g_cclosure_marshal_VOID__BOXEDv(_GClosure * closure, _GValue * return_value, void * instance, char * args, void * marshal_data, int n_params, unsigned int * param_types) Line 1953 C
gobject-2.0.dll!_g_closure_invoke_va(_GClosure * closure, _GValue * return_value, void * instance, char * args, int n_params, unsigned int * param_types) Line 871 C
gobject-2.0.dll!g_signal_emit_valist(void * instance, unsigned int signal_id, unsigned int detail, char * var_args) Line 3300 C
gobject-2.0.dll!g_signal_emit(void * instance, unsigned int signal_id, unsigned int detail, ...) Line 3441 C
gtk-3-3.0.dll!_gtk_gesture_check_recognized(_GtkGesture * gesture, _GdkEventSequence * sequence) Line 389 C
gtk-3-3.0.dll!gtk_gesture_handle_event(_GtkEventController * controller, const _GdkEvent * event) Line 747 C
gtk-3-3.0.dll!gtk_gesture_single_handle_event(_GtkEventController * controller, const _GdkEvent * event) Line 221 C
gtk-3-3.0.dll!gtk_event_controller_handle_event(_GtkEventController * controller, const _GdkEvent * event) Line 231 C
gtk-3-3.0.dll!_gtk_widget_run_controllers(_GtkWidget * widget, const _GdkEvent * event, GtkPropagationPhase phase) Line 7328 C
gtk-3-3.0.dll!gtk_widget_real_motion_event(_GtkWidget * widget, _GdkEventMotion * event) Line 7104 C
gtk-3-3.0.dll!_gtk_marshal_BOOLEAN__BOXEDv(_GClosure * closure, _GValue * return_value, void * instance, char * args, void * marshal_data, int n_params, unsigned int * param_types) Line 133 C
gobject-2.0.dll!_g_closure_invoke_va(_GClosure * closure, _GValue * return_value, void * instance, char * args, int n_params, unsigned int * param_types) Line 871 C
gobject-2.0.dll!g_signal_emit_valist(void * instance, unsigned int signal_id, unsigned int detail, char * var_args) Line 3300 C
gobject-2.0.dll!g_signal_emit(void * instance, unsigned int signal_id, unsigned int detail, ...) Line 3441 C
gtk-3-3.0.dll!gtk_widget_event_internal(_GtkWidget * widget, _GdkEvent * event) Line 7704 C
gtk-3-3.0.dll!gtk_widget_event(_GtkWidget * widget, _GdkEvent * event) Line 7263 C
gtk-3-3.0.dll!propagate_event_up(_GtkWidget * widget, _GdkEvent * event, _GtkWidget * topmost) Line 2545 C
gtk-3-3.0.dll!propagate_event(_GtkWidget * widget, _GdkEvent * event, int captured, _GtkWidget * topmost) Line 2648 C
gtk-3-3.0.dll!gtk_propagate_event(_GtkWidget * widget, _GdkEvent * event) Line 2682 C
gtk-3-3.0.dll!gtk_main_do_event(_GdkEvent * event) Line 1878 C
gdk-3-3.0.dll!gdk_event_dispatch(_GSource * source, int (void *) * callback, void * user_data) Line 3664 C
glib-2.0.dll!g_main_dispatch(_GMainContext * context) Line 3154 C
glib-2.0.dll!g_main_context_iterate(_GMainContext * context, int block, int dispatch, _GThread *) Line 3840 C
glib-2.0.dll!g_main_context_iteration(_GMainContext * context, int may_block) Line 3901 C
gio-2.0.dll!g_application_run(_GApplication * application, int argc, char * * argv) Line 2381 C
gtk3-demo.exe!main(int argc, char * * argv) Line 1180 C
[External Code]
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

Automatically download tools

There are some tools that could be automatically downloaded like nuget. I think we should add support for this in some way.

Gtk-WARNING **: Could not find the icon

During the execution of the gtk3-demo.exe application warning appears:

Gtk-WARNING **: Could not find the icon 'window-minimize-symbolic-ltr'. The 'hicolor' theme was not found either, perhaps you need to install it.
You can get a copy from:
        http://icon-theme.freedesktop.org/releases

feature request: add support for gobject-introspection?

This is required by harfbuzz to use the python bindings.
The same @fanc999 who wrote the harfbuzz nmake Makefile seems to have contributed similar ones for gobject-introspection.
I wish I could help but I have no experience with powershell nor with Windows build environment.
Thanks in advance!

Cosimo

Error building libepoxy 1.4.1 with VS2013

Building project libepoxy
[1/12] Compiling c object src/epoxy@sha/src_wgl_generated_dispatch.c.obj
FAILED: src/epoxy@sha/src_wgl_generated_dispatch.c.obj
cl @src/epoxy@sha/src_wgl_generated_dispatch.c.obj.rsp
C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(130) : warning C4005: APIENTRY: изменение макроопределения
..\include\epoxy/gl.h(59): см. предыдущее определение "APIENTRY"
src/wgl_generated_dispatch.c(162) : error C2054: требуется "(" после "inline"
src/wgl_generated_dispatch.c(163) : error C2085: get_dispatch_table: отсутствует в списке формальных параметров
src/wgl_generated_dispatch.c(168) : error C2057: требуется константное выражение
...

This issue is fixed in upstream anholt/libepoxy@3f932ae, but i don't know how to fix this in gtk-win32.

Error build the 'glib' solution for vs14

Error build the 'glib' solution for Visual Studio 2015

LINK : fatal error LNK1181: cannot open input file '\lib\intl.lib' [C:\gtk-build\build\x64\release\glib\build\win32\vs14\gmodule.vcxproj]
LINK : fatal error LNK1181: cannot open input file '\lib\intl.lib' [C:\gtk-build\build\x64\release\glib\build\win32\vs14\gthread.vcxproj]
LINK : fatal error LNK1181: cannot open input file '\lib\intl.lib' [C:\gtk-build\build\x64\release\glib\build\win32\vs14\glib-genmarshal.vcxproj]
c:\gtk-build\build\x64\release\glib\glib\glibintl.h(16): fatal error C1083: Cannot open include file: 'libintl.h': No such file or directory [C:\gtk-build\build\x64\release\glib\build\win32\vs14\gspawn-win32-helper.vcxproj]
c:\gtk-build\build\x64\release\glib\glib\glibintl.h(16): fatal error C1083: Cannot open include file: 'libintl.h': No such file or directory [C:\gtk-build\build\x64\release\glib\build\win32\vs14\gspawn-win32-helper-console.vcxproj]

Build glib-openssl with meson

I just pushed an initial version of the meson support for meson, if needed we will need to make some fixes upstream.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.