This is an old revision of the document!


Build Geany on Windows (using MSYS2)

* UNDER CONSTRUCTION *

Msys2 is a successor to msys which offers a unix-like environment on Windows combined with a pacman-based package manager. It's purpose is to simplify win32 compiliations, and it's doing great at that for GTK+ stack and related projects. In fact, it's so good it should become the default method of compiling Geany on Windows.

See http://sourceforge.net/projects/msys2/ and http://msys2.github.io/

This page aims at showing how to use msys2 to build Geany on Windows, both GTK+2 and GTK+3 versions.

One-time Setup

Download the installer from here. Chose the 32bit or 64bit version depending on your Windows version, not whether you target a 32bit or 64bit compilation of Geany (this guide will always compile for 32bit).

Run the installer and follow the instructions. In the following we will assume that you installed the 32bit version to C:\mingw32.

After installation, open the msys2 environment via Start Menu → All Programs → MSYS2 32bit → MinGW-w64 Win32 Shell

Next, execute:

pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime

Now exit and re-open the msys2 environment and perform a system update:

pacman -Su

Restart msys2 once more, in case pacman -Su updated environment related packages.

Finally, install the dependencies needed by Geany.

# toolchain
pacman -S mingw-w64-i686-binutils mingw-w64-i686-gcc mingw-w64-i686-gdb
# make and Autotools
pacman -S make pkgconfig autoconf automake libtool intltool
# gtk familiy
pacman -S mingw-w64-i686-gtk2 mingw-w64-i686-gtk3
# for building html docs
pacman -S mingw-w64-i686-python2 mingw-w64-i686-python2-docutils
# and if you fancy building from git
pacman -S git

At last, you want to add C:\msys32\mingw32\bin to your PATH environment variable, in order to run Geany from the Windows Explorer.

In case you want also compile the combined Geany-Plugins collection, you need the following dependencies:

# geany-plugins dependencies
pacman -S mingw-w64-i686-check mingw-w64-i686-enchant mingw-w64-i686-lua51 mingw-w64-i686-gpgme mingw-w64-i686-libsoup mingw-w64-i686-libgit2 mingw-w64-i686-gtkspell mingw-w64-i686-webkitgtk2 mingw-w64-i686-webkitgtk3

GTK+3 compilation

This is effectively the same procedure as cross-compiling on Linux. For now (until 1.25), a git clone/export is required as it contains some win32-related autotools fixes.

curl -L -o geany-master.zip https://github.com/geany/geany/archive/master.zip
unzip geany-master.zip
cd geany-master
# autogen.sh is not needed for tarballs!
NOCONFIGURE=1 ./autogen.sh
# configure and make take a while, don't panic
./configure --enable-gtk3 --prefix=/c/geany
make -j2
make install

After that, you can run Geany either through msys2 shell (/c/geany/bin/geany) or use the Windows Explorer to locate the executable and run it.

The first run should look like this, on GTK+ 3.16.3

GTK+2 compilation

This is effectively the same procedure as cross-compiling on Linux. For now (until 1.25), a git clone/export is required as it contains some win32-related autotools fixes.

curl -L -o geany-master.zip https://github.com/geany/geany/archive/master.zip
unzip geany-master.zip
cd geany-master
# autogen.sh is not needed for tarballs!
NOCONFIGURE=1 ./autogen.sh
# configure and make take a while, don't panic
./configure --prefix=/c/geany
make -j2
make install

After that, you can run Geany either through msys2 shell (/c/geany/bin/geany) or use the Windows Explorer to locate the executable and run it.

The first run should look like this, on GTK+ 2.24.27

Creating an installer

TODO

Automated build via MAKEPKG file

TODO

Print/export