HowToCompileGimp/MacOSX

HowToCompileGimp/MacOSX

Who is this for?

This page explains how to build Gimp 2.5 (SVN and development versions) using Imendio's native port of GTK+ to mac ([WWW] http://developer.imendio.com/projects/gtk-macosx). It is by no means ready to be used, and these instructions are provided to programmers who would like to help fixing bugs firstly in GTK+-quartz and then also help integrate Gimp better with mac OS X.

These instructions were tested on mac OS X 10.4. They will probably not work on 10.3.x and older.

If you have installed some of GIMP's dependencies in /usr/local when e.g. building another app, you may want to be careful about conflicts

Now, the jhbuild script provided by the GTK folks, as well as macports, can both build native GIMP (it has been reported that when using macports, you must be careful to build a non-X11 version of pango). Instructions below might have been a bit superseeded by these installation tools, but can be nontheless useful to see how it's done (or if you like to have control over everything)


Before Building GTK

Install developer tools. This was done with recent autotools (autoconf, automake) versions. If you ever meet problems i would suggest updating them. (be careful, if you build them from source they will be installed to /usr/local - Apple's, in /usr/, may still default over the ones you installed depending on your PATH)

If you have already installed the X11 version of GTK+ with macports/darwinports, i would suggest being careful to avoid conflicts between the various versions of the libs. These instructions were written without any darwinports/macports stuff other than git

You will need to install git and subversion. Either build it from source, or use macports:

% sudo port install git-core
% sudo port install subversion

Download Freetype from [WWW] http://www.freetype.org/

% ./configure --prefix=/opt/gimp
% make
% sudo make install

Fix paths so that FreeType can be found

export PKG_CONFIG_PATH=/opt/gimp/lib/pkgconfig/
export PATH=/opt/gimp/bin/:$PATH

Download Font-Config from [WWW] http://fontconfig.org/release/

% ./configure --prefix=/opt/gimp
% make
% sudo make install

Building GTK

See [WWW] http://developer.imendio.com/projects/gtk-macosx/build-instructions for instructions on how to build. Leave PKG_CONFIG_PATH and PATH defined as previously as we want to build pango with FreeType support so it needs to pick it up.

This will take a while. If everything goes well, GTK+ should be built and installed in /opt/gtk/. If there are build errors, you can wait a few days - sometimes the GTK+ folks commit things that break the mac version, it is often fixed not too long after usually. If not, you can post a message on their forums.


After Building GTK

GTK+ was installed in non-standard /opt/gtk/ prefix, so if you want other programs to see it you will have to change PATH variables:

% export PKG_CONFIG_PATH=/opt/gimp/lib/pkgconfig/:/opt/gtk/lib/pkgconfig/:/opt/local/lib/pkgconfig/:/usr/local/lib/pkgconfig
% export PATH=/opt/gimp/bin:/opt/gtk/bin/:/bin/:~/Source/gnome/gtk/gtk+/gdk-pixbuf/:/usr/bin/

These changes are temporary. Remember that the following instructions depend on these commands, so every time you open a new terminal, you will need to enter these again. You can also change them permanently if you wish, of course.


Prepare to Build Gimp

libart

download from [WWW] ftp://ftp.gnome.org/pub/gnome/sources/libart_lgpl/

% ./configure --prefix=/opt/gimp
% make
% sudo make install

XML::Parser

You need to install the XML::Parser Perl module. (I think the jhbuild script of GTK can install it - may be worth checking)

Sweep the entire directory [WWW] http://search.cpan.org/src/MSERGEANT/XML-Parser-2.34/ (CocoaWGet does a fine job) Remove HTML pages, including in subdirectories

% perl Makefile.PL EXPATLIBPATH=/opt/gtk/lib EXPATINCPATH=/opt/gtk/include
% make
% sudo make install

LCMS

download mac binaries from [WWW] http://www.littlecms.com/ and expand file

% cd lcms-1.16bin
% sudo cp -r * /opt/gimp/
% sudo install_name_tool -id /opt/gimp/lib/liblcms.1.0.16.dylib /opt/gimp/lib/liblcms.1.0.16.dylib
% sudo install_name_tool -id /opt/gimp/lib/liblcms.1.dylib /opt/gimp/lib/liblcms.1.dylib
% sudo install_name_tool -id /opt/gimp/lib/liblcms.dylib /opt/gimp/lib/liblcms.dylib

The last commands fix the libs' "inner" install paths.

babl

Download source archive from [WWW] ftp://ftp.gimp.org/pub/babl/

% cd /path/to/babl-0.0.20
% ./configure --prefix=/opt/gimp
% make
% sudo make install

GEGL

Download source archive from [WWW] ftp://ftp.gimp.org/pub/gegl/

% cd /path/to/gegl-0.0.16
% ./configure --prefix=/opt/gimp
% make
% sudo make install

Python support

If you not want python support, you can skip this section and pass --disable-python to configure.

Cairo

download pyCairo source from from [WWW] http://cairographics.org/releases/ and expand file

% cd pycairo-1.4.0
% ./configure --prefix=/opt/gimp
% make
% sudo make install

pyGObject

download source from [WWW] http://www.t2-project.org/packages/pygobject.html and expand file

% cd pygobject-2.12.3
% ./configure --prefix=/opt/gimp
% make
% sudo make install

PyGTK

download source from from [WWW] http://www.pygtk.org/ and expand file

% cd pygtk-2.10.4
% ./configure --prefix=/opt/gimp
% make
% sudo make install

Getting the source

Either way will work. Source releases are easier but SVN is more recent and bleeding edge.

At this point, make sure your PATH and PKG_CONFIG env variables are set as previously described.

Way 1 : The source releases

get gimp source from [WWW] http://gimp.org/source/index.html#source

% cd /path/to/gimp-source
% ./configure --without-mng --without-alsa --disable-alsatest --without-x LDFLAGS="-L/opt/gtk/lib -L/opt/gimp/lib/" CPPFLAGS="-I/opt/gtk/include -I/opt/gimp/include" --prefix=/opt/gimp

Way 2 : The SVN

Get the source from the SVN repository.

% svn co http://svn.gnome.org/svn/gimp/trunk gimp
% cd gimp
% export ACLOCAL_FLAGS="-I /opt/gtk/share/aclocal/"
% ./autogen.sh --disable-gtk-doc --without-mng --without-alsa --disable-alsatest --without-x LDFLAGS="-L/opt/gtk/lib -L/opt/gimp/lib/" CPPFLAGS="-I/opt/gtk/include -I/opt/gimp/include" --prefix=/opt/gimp

After autogen is successful, if you ever meet a problem during the configure part, you can later call 'configure' like in the source release section.


Building Gimp

% make
% sudo make install

Launching Gimp

If everything goes well, Gimp should finally be ready to run!

% export PYTHONPATH=/opt/gimp/lib/python2.3/site-packages
% /opt/gimp/bin/gimp-2.5

last edited 2008-03-03 02:53:57 by MarianneGagnon