GTK+ Mingw64

Compiling bleeding-edge GTK+ on Windows x86_64 (MINGW)

Install Python27 and Swig on wine

wine64 msiexec /i Python*
unzip -d $HOME/.wine/drive_c swig*zip

Packages

You will need to get the GLib, Cairo, Pango, ATK, and GTK+ developer packages to build against GTK+. To run GTK+ programs you will also need the libpng and zlib packages, and if your code uses gettext for internationalization and/or you want GTK+ internationalization, the gettext package.

Environment

mingw64-env
export BUILDDIR=$HOME/dev/win_64/gtk #dir containing all the download folders
export MINGW=/usr/x86_64-w64-mingw32/sys-root/mingw
export GTK="$HOME/.wine/drive_c/gtk"
export PKG_CONFIG_PATH="$GTK/lib/pkgconfig:$MINGW/lib/pkgconfig"
export LDFLAGS=-L"$GTK/lib -L$MINGW/lib"
export CFLAGS="-mthreads -pthread -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -DG_OS_WIN32 -I$GTK/include" -I$MINGW/include
export PYTHON=$(winepath C:\\Python27\\python.exe|sed 's#dosdevices/c:#drive_c#g')
export PYTHON_CPPFLAGS=-I$(winepath C:\\Python27\\include|sed 's#dosdevices/c:#drive_c#g')
export SWIG=$(winepath C:\\swigwin-3.0.2\\swig.exe|sed 's#dosdevices/c:#drive_c#g')
export SWIG_LIB=$(winepath C:\\swigwin-3.0.2\\Lib|sed 's#dosdevices/c:#drive_c#g')

export OPTS="--build=x86_64-redhat-linux-gnu --host=x86_64-w64-mingw32 --sysconfdir="$GTK/etc" --prefix="$GTK" --exec-prefix="$GTK"  --bindir="$GTK/bin" --libdir="$GTK/lib" --libexecdir="$GTK/libexec" --sbindir="$GTK/sbin" --sharedstatedir="$GTK/lib" --datarootdir="$GTK/share" --datadir="$GTK/share" --includedir="$GTK/include" --infodir="$GTK/share/info" --mandir="$GTK/share/man" --localstatedir="$GTK/var""

-D_WIN32_WINNT=0x0501 -DWINVER=0x0501 is for Windows XP or greater.

Build order:

git clone git:git.gnome.org/glib git clone git:git.gnome.org/atk zlib http:zlib.net/ libpng http:libpng.sourceforge.net/index.html git clone git:git.gnome.org/gdk-pixbuf git clone git:anongit.freedesktop.org/git/pixman git clone git:anongit.freedesktop.org/git/cairo git clone git:git.gnome.org/pango git clone https:github.com/anholt/libepoxy.git git clone git:git.gnome.org/gtk+

Reading

hg clone http:hg.code.sf.net/p/gtkspell/code gtkspell-code

ref http:www.gtk.org/download/win64.php

Detecting mingw compiler macros http:sourceforge.net/p/mingw-w64/discussion/723798/thread/ea355c1f/

Glib

cd glib
patch -p0 < ../glib.patch
less README.win32

git pull
./autogen.sh "$OPTS" --disable-gtk-doc --enable-shared
automake --add-missing
autoconf
./configure $OPTS
gedit po/Makefile.in.in #add blank targets all: clean: install:
touch tests/Makefile.in
touch docs/Makefile.in
touch gtk-doc.make
./configure $OPTS --disable-glibtest

make -j24
make install #no sudo!
cd ..

Atk

cd atk
patch -p0 < ../atk.patch
git pull
./autogen.sh "$OPTS" --disable-gtk-doc --enable-shared
automake --add-missing
autoconf
./configure $OPTS
gedit po/Makefile.in.in #add blank targets all: clean: install:
touch tests/Makefile.in
touch docs/Makefile.in
touch gtk-doc.make
./configure $OPTS --disable-glibtest

make -j24
make install #no sudo!
cd ..

Zlib

./configure --prefix=$HOME/.wine/drive_c/gtk --eprefix=$HOME/.wine/drive_c/gtk --64 --libdir=$HOME/.wine/drive_c/gtk/lib  --includedir=$HOME/.wine/drive_c/gtk/include
make -j24
#(cannot find -lc? Remove -lc from the command and re-execute it)
make install
cd ..

Libpng

mv code libpng
cd libpng
automake --add-missing
autoreconf
make -j24
make install
cd ..

Gdk-pixbuf

cd gdk-pixbuf
./autogen.sh "$OPTS" --disable-static --disable-glibtest
./configure $OPTS --disable-static --disable-glibtest
make -j24
cd tests
wine ../gdk-pixbuf/gdk-pixbuf-query-loaders > ../gdk-pixbuf/loaders.cache
make
make -i install
cd ..

Tests would not build, so hopefully make -i will work.

Pixman

cd pixman
./autogen.sh "$OPTS" --disable-static
./configure $OPTS --disable-static
make -j24
make install
cd ..

Cairo

cd cairo
./autogen.sh "$OPTS"
./configure $OPTS
make -j24
make install
cd ..

Pango

cd pango
./autogen.sh "$OPTS"
./configure $OPTS
make -j24
make install
cd ..

Epoxy

cd libepoxy
./autogen.sh "$OPTS"
./configure $OPTS
make -j24
make install
cd ..

Gtk+

cd gtk+
./autogen.sh "$OPTS" --disable-cups
./configure $OPTS --disable-cups
make -j24
make install
cd

todo: Install gobject-introspection and rebuild with --enable-introspection


CCBY Copyright © 2024 Henry Kroll III, thenerdshow.com This web page is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.