Sunday, September 15, 2013

Compiling GIMP


GIMP is an acronym for GNU Image Manipulation Program. It is a freely distributed program for such tasks as photo retouching, image composition and image authoring. It has many capabilities. It can be used as a simple paint program, an expert quality photo retouching program, an online batch processing system, a mass production image renderer, an image format converter, etc.

GIMP is expandable and extensible. It is designed to be augmented with plug-ins and extensions to do just about anything. The advanced scripting interface allows everything from the simplest task to the most complex image manipulation procedures to be easily scripted.  (taken from the official website)


Set the environment.

Update the environment in c:/msys/etc/profile:
export CPPFLAGS="-I/c/programs/gimp/include"
export LDFLAGS="-L/c/programs/gimp/lib"
export PATH="$PATH:/c/programs/gimp/bin"
export PKG_CONFIG_PATH="c:\\programs\\gimp\\lib\\pkgconfig"
export TERMINFO="/c/programs/gimp/share/terminfo"
export lt_cv_deplibs_check_method="pass_all"


Install Python.

Copy all folders (including files) from Python-2.7.6-1-mingw-x86_64.7z (bin, include, lib, share) to the GIMP installation dir, for example; c:/programs/gimp.


Compile GTK+ and dependencies.

freetype-2.4.12
http://sourceforge.net/projects/freetype/files/freetype2/2.4.12/freetype-2.4.12.tar.bz2/download

cd freetype-2.4.12
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



expat-2.1.0
http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download

cd expat-2.1.0
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



fontconfig-2.11.0
http://freedesktop.org/software/fontconfig/release/fontconfig-2.11.0.tar.bz2
patch: fontconfig-2.11.0_mingw64_gimp.diff

cd fontconfig-2.11.0
patch -p1 <../fontconfig-2.11.0_mingw64_gimp.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-docs --disable-static
make -j2
make install



tiff-4.0.2
http://download.osgeo.org/libtiff/tiff-4.0.2.tar.gz

cd tiff-4.0.2
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-cxx --disable-static
cd port && make
cd ../libtiff
make -j2
make install



jasper-1.900.1
http://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.1.zip
patch: jasper-1.900.1_enable_shared.diff

cd jasper-1.900.1
patch -p1 <../jasper-1.900.1_enable_shared.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



jpeg-9
http://www.ijg.org/files/jpegsrc.v9.tar.gz

cd jpeg-9
./configure --prefix=cd --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



zlib-1.2.8
http://zlib.net/zlib-1.2.8.tar.xz
patch: zlib-1.2.8_disable_static.diff

cd zlib-1.2.8

patch -p1 <../zlib-1.2.8_disable_static.diff
make prefix=/c/programs/gimp -f win32/Makefile.gcc install


libpng-1.5.12
http://sourceforge.net/projects/libpng/files/libpng15/1.5.12/libpng-1.5.12.tar.bz2/download

cd libpng-1.5.12
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



libiconv-1.14
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

cd libiconv-1.14
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



gettext-0.18.2
http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.2.tar.gz
patch: gettext-0.18.2_mingw64.diff

cd gettext-0.18.2
patch -p1 <../gettext-0.18.2_mingw64.diff

cd gettext-runtime
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --enable-threads=win32 --disable-static
make -j2
make install


cd ../gettext-tools
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --enable-threads=win32 --disable-static
make -j2
make install



libiconv-1.14
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

cd libiconv-1.14
make distclean
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



libffi-3.0.12
ftp://sourceware.org/pub/libffi/libffi-3.0.12.tar.gz
patch: libffi-3.0.12_mingw.diff

cd libffi-3.0.12
patch -p1 <../libffi-3.0.12_mingw.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-builddir --disable-static
make -j2
make install



glib-2.35.9
http://ftp.gnome.org/pub/gnome/sources/glib/2.35/glib-2.35.9.tar.xz
patch: glib-2.35.9_mingw-python.diff

cd glib-2.35.9
patch -p1 <../glib-2.35.9_mingw-python.diff

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --with-threads=win32
make -j2

make install


pixman-0.30.2
http://cairographics.org/releases/pixman-0.28.2.tar.gz

cd pixman-0.30.2
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



cairo-1.10.2
http://cairographics.org/releases/cairo-1.10.2.tar.gz
patch: cairo-1.10.2_mingw.diff

cd cairo-1.10.2
patch -p1 <../cairo-1.10.2_mingw.diff

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



gobject-introspection-1.35.4
http://ftp.gnome.org/pub/gnome/sources/gobject-introspection/1.35/gobject-introspection-1.35.4.tar.xz
patch: gobject-introspection-1.35.4_mingw-python.diff

cd gobject-introspection-1.35.4
patch -p1 <../gobject-introspection-1.35.4_mingw-python.diff

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make
make install



harfbuzz-0.9.12
http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.12.tar.bz2

cd harfbuzz-0.9.12
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



pango-1.32.6
http://ftp.gnome.org/pub/gnome/sources/pango/1.32/pango-1.32.6.tar.xz


cd pango-1.32.6
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --with-included-modules --disable-static
make -j2
make install



atk-2.8.0
http://ftp.gnome.org/pub/gnome/sources/atk/2.8/atk-2.8.0.tar.xz
patch: atk-2.8.0_mingw.diff

cd atk-2.8.0
patch -p1 <../atk-2.8.0_mingw.diff

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



gdk-pixbuf-2.28.2
http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.28/gdk-pixbuf-2.28.2.tar.xz

export HEX=`echo gdk-pixbuf_2.28.2 | md5sum | cut -d' ' -f1`
cd gdk-pixbuf-2.28.2
./configure --prefix=/c/programs/$HEX --build=x86_64-w64-mingw32 --with-included-loaders --with-libjasper --without-gdiplus
make -j2
make install


./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --with-included-loaders --with-libjasper --without-gdiplus
make -j2
make install



gtk+-2.24.20
http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.20.tar.xz


cd gtk+-2.24.20
rm -f gtk/gtk.def

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --with-gdktarget=win32 --with-included-immodules
make -j2
make install



Compile the extra dependencies.

babl-0.1.10
ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.10.tar.bz2
patch: babl-0.1.10_mingw.diff

cd babl-0.1.10
patch -p1 <../babl-0.1.10_mingw.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32
make -j2
make install


intltool-0.50.2
https://launchpad.net/intltool/trunk/0.50.2/+download/intltool-0.50.2.tar.gz

cd intltool-0.50.2
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32
make -j2
make install


gegl-0.2.0
ftp://ftp.gtk.org/pub/gegl/0.2/gegl-0.2.0.tar.bz2


cd gegl-0.2.0

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32
make -j2
make install


libexif-0.6.21
http://sourceforge.net/projects/libexif/files/libexif/0.6.21/libexif-0.6.21.tar.bz2/download

cd libexif-0.6.21
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


libwmf-0.2.8.4
http://sourceforge.net/projects/wvware/files/libwmf/0.2.8.4/libwmf-0.2.8.4.tar.gz/download

cd libwmf-0.2.8.4
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


libmng-1.0.10
http://sourceforge.net/projects/libmng/files/libmng-devel/1.0.10/libmng-1.0.10.tar.bz2/download
patch: libmng-1.0.10_mingw_shared.diff

cd libmng-1.0.10
patch -p1 <../libmng-1.0.10_mingw_shared.diff
make -f makefiles/makefile.mingwdll INSTALL_PREFIX=/c/programs/gimp/ install


openjpeg-1.5.1
http://openjpeg.googlecode.com/files/openjpeg-1.5.1.tar.gz

cd openjpeg-1.5.1
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-png --disable-tiff --disable-static
make -j2
make install


poppler-0.24.2
http://poppler.freedesktop.org/poppler-0.24.2.tar.gz

cd poppler-0.24.2
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-poppler-cpp --disable-utils --disable-static
make -j2
make install


libxml2-2.9.0
http://xmlsoft.org/sources/libxml2-2.9.0.tar.gz
patch: libxml2-2.9.0_mingw-python.diff

cd libxml2-2.9.0
patch -p1 <../libxml2-2.9.0_mingw-python.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


libcroco-0.6.8
http://ftp.gnome.org/pub/gnome/sources/libcroco/0.6/libcroco-0.6.8.tar.xz

cd libcroco-0.6.8
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


librsvg-2.36.4
http://ftp.gnome.org/pub/gnome/sources/librsvg/2.36/librsvg-2.36.4.tar.xz

cd librsvg-2.36.4
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-introspection --disable-static
make -j2
make install


lcms-1.19
http://sourceforge.net/projects/lcms/files/lcms/1.19/lcms-1.19.tar.gz/download
patch: lcms-1.19_mingw.diff

cd lcms-1.19
patch -p1 <../lcms-1.19_mingw.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


bzip2-1.0.6
http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
patch: bzip2-1.0.6_mingw_shared.diff

cd bzip2-1.0.6
patch -p1 <../bzip2-1.0.6_mingw_shared.diff
make -f Makefile-libbz2_so
install -m 755 libbz2-2.dll /c/programs/gimp/bin
install -m 644 libbz2.dll.a /c/programs/gimp/lib
install -m 644 bzlib.h /c/programs/gimp/include




Compile PyGTK.


py2cairo-1.10.0
http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2
patch: py2cairo-1.10.0_mingw.diff

cd py2cairo-1.10.0
patch -p1 <../py2cairo-1.10.0_mingw.diff
rm -f config.lt config.status libtool *.pc
touch ChangeLog
autoreconf -fiv

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make
make install


pygobject-2.28.6
http://ftp.gnome.org/pub/gnome/sources/pygobject/2.28/pygobject-2.28.6.tar.xz
patch: pygobject-2.28.6_mingw.diff

cd pygobject-2.28.6
patch -p1 <../pygobject-2.28.6_mingw.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make
make install



pygtk-2.24.0
http://ftp.gnome.org/pub/gnome/sources/pygtk/2.24/pygtk-2.24.0.tar.bz2
patch: pygtk-2.24.0_mingw.diff

cd pygtk-2.24.0
patch -p1 <../pygtk-2.24.0_mingw.diff

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make
make install



Compile GIMP.

gimp-2.8.10
ftp://ftp.gimp.org/pub/gimp/v2.8/gimp-2.8.10.tar.bz2
patch: gimp-2.8.10_mingw-python.diff

cd gimp-2.8.10
patch -p1 <../gimp-2.8.10_mingw-python.diff
./configure --prefix=c:/programs/gimp --build=x86_64-w64-mingw32
make -j3
make install-strip


* move pyconsole.py: 
mv c:/programs/gimp/lib/gimp/2.0/plug-ins/pyconsole.py c:/programs/gimp/lib/gimp/2.0/python


Downloads:

gimp-2.8.10-x86-64.7z




Saturday, September 14, 2013

Compiling GTK+ 2

GTK+, or the GIMP Toolkit, is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK+ is suitable for projects ranging from small one-off tools to complete application suites.

Update the environment.

Edit 'c:/msys/etc/profile':
export CPPFLAGS="-I/c/programs/gtk2/include -I/c/programs/python27/include/python2.7"
export LDFLAGS="-L/c/programs/gtk2/lib"
export PATH="$PATH:/c/programs/gtk2/bin:/c/programs/python27/bin"
export PKG_CONFIG_PATH="c:\\programs\\gtk2\\lib\\pkgconfig"
export TERMINFO="/c/programs/python27/share/terminfo"
export lt_cv_deplibs_check_method="pass_all"


Install Python-2.7.x (refer to our previous Python installation).


Compile the dependencies.

freetype-2.4.12
http://sourceforge.net/projects/freetype/files/freetype2/2.4.12/freetype-2.4.12.tar.bz2/download

cd freetype-2.4.12
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


expat-2.1.0
http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download

cd expat-2.1.0
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


fontconfig-2.11.0
http://freedesktop.org/software/fontconfig/release/fontconfig-2.11.0.tar.bz2
patch: fontconfig-2.11.0_mingw64.diff

cd fontconfig-2.5.0
patch -p1 <../fontconfig-2.11.0_mingw64.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-docs --disable-static
make -j2
make install


tiff-4.0.2
http://download.osgeo.org/libtiff/tiff-4.0.2.tar.gz

cd tiff-4.0.2
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-cxx --disable-static
cd port && make
cd ../libtiff
make -j2
make install


jasper-1.900.1
http://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.1.zip
patch: jasper-1.900.1_enable_shared.diff

cd jasper-1.900.1
patch -p1 <../jasper-1.900.1_enable_shared.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


jpeg-9
http://www.ijg.org/files/jpegsrc.v9.tar.gz

cd jpeg-9
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


zlib-1.2.8
http://zlib.net/zlib-1.2.8.tar.bz2
patch: zlib-1.2.8_disable_static.diff

cd zlib-1.2.8
patch -p1 <../zlib-1.2.8_disable_static.diff
make prefix=/c/programs/gtk2 -f win32/Makefile.gcc install


libpng-1.5.12
http://sourceforge.net/projects/libpng/files/libpng15/1.5.12/libpng-1.5.12.tar.bz2/download

cd libpng-1.5.12
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


libiconv-1.14
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

cd libiconv-1.14
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


gettext-0.18.2
http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.2.tar.gz
patch: gettext-0.18.2_mingw64.diff

cd gettext-0.18.2
patch -p1 <../gettext-0.18.2_mingw64.diff

cd gettext-0.18.2/gettext-runtime
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --enable-threads=win32 --disable-static
make -j2
make install

cd ../gettext-tools
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --enable-threads=win32 --disable-static
make -j2
make install


libiconv-1.14
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

cd libiconv-1.14
make distclean
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


libffi-3.0.12
ftp://sourceware.org/pub/libffi/libffi-3.0.12.tar.gz
patch: libffi-3.0.12_mingw.diff

cd libffi-3.0.12
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-builddir --disable-static
make -j2
make install


glib-2.35.9
http://ftp.gnome.org/pub/gnome/sources/glib/2.35/glib-2.35.9.tar.xz
patch: glib-2.35.9_mingw-python.diff

cd glib-2.35.9
patch -p1 <../glib-2.35.9_mingw-python.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --with-threads=win32
make -j2
make install


pixman-0.30.2
http://cairographics.org/releases/pixman-0.30.2.tar.gz

cd pixman-0.30.2
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


cairo-1.10.2
http://cairographics.org/releases/cairo-1.10.2.tar.gz
patch: cairo-1.10.2_mingw.diff

cd cairo-1.10.2
patch -p1 <../cairo-1.10.2_mingw.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


gobject-introspection-1.35.4
http://ftp.gnome.org/pub/gnome/sources/gobject-introspection/1.35/gobject-introspection-1.35.4.tar.xz
patch: gobject-introspection-1.35.4_mingw-python.diff

cd gobject-introspection-1.35.4
patch -p1 <../gobject-introspection-1.35.4_mingw-python.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make
make install


harfbuzz-0.9.12
http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.12.tar.bz2

cd harfbuzz-0.9.12
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


pango-1.32.6
http://ftp.gnome.org/pub/gnome/sources/pango/1.32/pango-1.32.6.tar.xz

cd pango-1.32.6
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --with-dynamic-modules=basic-win32 --disable-static
make -j2
make install


atk-2.8.0
http://ftp.gnome.org/pub/gnome/sources/atk/2.7/atk-2.8.0.tar.xz
patch: atk-2.8.0_mingw.diff

cd atk-2.8.0
patch -p1 <../atk-2.8.0_mingw.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


gdk-pixbuf-2.28.2
http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.28/gdk-pixbuf-2.28.2.tar.xz

export HEX=`echo gdk-pixbuf_2.28.2 | md5sum | cut -d' ' -f1`
cd gdk-pixbuf-2.28.2

./configure --prefix=/c/programs/$HEX --build=x86_64-w64-mingw32 --with-libjasper --without-gdiplus
make -j2
make install

./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --with-libjasper --without-gdiplus
make -j2
make install


Compile GTK+

gtk+-2.24.20
http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.20.tar.xz


cd gtk+-2.24.20

rm -f gtk/gtk.def
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --with-gdktarget=win32 --with-included-immodules
make -j2
make install


If all went well, you should be able to test your compilation by executing 'gtk-demo.exe'