This powershell script helps you build a full GTK+ library stack for Windows using Visual Studio.
The script was 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 2013, 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
-
Install the following build tools and dependencies:
- Visual Studio 2013 Express for Windows Desktop - Any version of VS apart from 2013 is not supported.
- Windows Management Framework 4.0 - Not needed for Windows 8.1 and above
- CMake 3.0.2 (also works with CMake 2.8.x)
- msys2
- Perl 5.20 x86 or x64 (extract to C:\perl)
- Ragel (extract to C:\gtk-build so you have C:\gtk-build\ragel\ragel.exe)
- Python 2.7 (install in C:\Python27)
-
Follow the instructions on the msys2 page to update the core packages.
-
Install needed packages in the msys2 shell
pacman -S gzip nasm patch tar xz gettext make coreutils
-
Clone this repository to C:\gtk-build\github\gtk-win32 It contains the build script, project files and patches.
-
Now you have to allow PowerShell scripts to be run on your system. Open a PowerShell prompt as Administrator and run the following command:
Set-ExecutionPolicy RemoteSigned
-
Now start a new PowerShell window as a regular user. Go to the gtk-win32 directory and start building with the script. For example, to build the 32-bit bundle, run:
cd C:\gtk-build\github\gtk-win32 .\build.ps1
To build the 64-bit bundle instead, run:
cd C:\gtk-build\github\gtk-win32 .\build.ps1 -Configuration x64
The script has some parameters you can pass in. Run
Get-Help -Full .\build.ps1
to see the help for the parameters and examples.
-
When the script is done, your GTK+ stack will be found under C:\gtk-build\gtk. Enjoy!