This python script helps you build a full GTK+ library stack for Windows using Visual Studio.
The powershell script was originally developed by the HexChat developers, make sure to check their page for more information about the original script.
HexChat developers decided that their script should focus on their specific needs, this fork tries to be a bit more generic, in particular it pursues the following goals
- Build GTK+ 3 - we want to focus on the current version of GTK
- Support multiple version of Visual Studio - at the moment we are focusing on VS 2017, but we include projects for other versions and we gladly accept patches
- We try to follow as much as possible the conventions of the upstream MSVC projects by Fan Chun-wei - Compiling the GTK+ (and Clutter) stack using Visual C++ 2008 and later.
- We are pretty liberal about adding more libraries to the script - at some point we will need to make the set of libraries that are built configurable and easily extensible, but right now we are ok with adding libraries that are useful to the users of this script
- We try to fetch tarballs from their original locations - if patches are needed we try to fork the project on github and host a patched tarball there
- We check sha256 hashes of the downloaded files: if error arise check that the download is not been interrupted: a partial file is likely to miss the hash check. Delete the file and try again.
- The download is done using the ssl certificate (handled by the system), in case of error the download is tried again without the certificate.
- We try to download also the tools needed and using them from a local directory, without any installation. Actually we use directly, among others, cmake, meson, ninja, nuget and perl.
-
Install the following build tools and dependencies:
- Visual Studio for Windows Desktop - 2013, 2015 and 2017 are currently supported.
- msys2
- Python 3.6 (install in C:\Python36 or use the --python-dir option to tell the script the correct location), or other package like Miniconda 3
-
Follow the instructions on the msys2 page to update the core packages. The needed packages for the script (make, diffutils, ...) are download and installed automatically if not presents in the msys2 installation.
-
Clone this repository to C:\gtk-build\github\gvsbuild It contains the build script, project files and patches.
-
Now start a command-line window as a regular user. Go to the gvsbuild directory and start building with the script. For example, to build 32-bit GTK+ 3 and its dependencies, run:
cd C:\gtk-build\github\gvsbuild python .\build.py build gtk3
To build the 64-bit version, run:
cd C:\gtk-build\github\gvsbuild python .\build.py build -p x64 gtk3
For more information about the possible commands. Run
python .\build.py --help
-
When the script is done, your GTK+ stack will be found under C:\gtk-build\gtk. Enjoy!
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 gets 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.