With that said, here's an archive of past GIMP building instructions I've had on that page over the years ...
GIMP has a fair number of dependencies, which can seem intimidating the first time you try to build it. Although configure is usually clear about what's missing, that's not always helpful in figuring out what package you need to add on a particular distro. The git instructions might also be helpful to anyone who hasn't used git very much yet.
If you want to build the latest GIMP but also keep another version, like the one from your distro, it's very important to include the --prefix argument when running autogen.sh or configure. Otherwise GIMP will end up installed to /usr/local/bin and either of your GIMP versions may get confused about which set of libraries applies to which binary. I've also included a wrapper script you can use to set up the include paths appropriately.
After running ./configure (or ./autogen.sh if you're building the CVS version), check to make sure you aren't missing anything. ./configure (or ./autogen.sh, if you're pulling from svn) will print out the full list of requirements, and what was and was not found, before it begins building. Be sure to review the list and make sure you're not missing anything you ought to have!
If configure gave errors, you're probably missing some build dependencies. But configure doesn't always give you much information about what's really missing. Here are the packages I needed:
GIMP 2.6 is quite a bit harder to build than earlier releases, because you first have to build babl and gegl. But the list of development packages you'll need is pretty much the same as for 2.4 on Hardy (see below for how to get those). You don't want to try to build 2.6 with anything earlier than Hardy. (2.7 (the current development release) has now bumped its requirements past Hardy, so you'll want "Intrepid Ibex." I haven't built 2.7 on Intrepid myself yet, but the procedure should be pretty much the same as 2.6 on Hardy.)
First you need the build requirements. Try this:
apt-get build-dep gimp
That might be all you need, but if not, here's a longer version that actually installs less stuff (the Ubuntu version of GIMP enables features you may not need or care about):
apt-get install build-essential subversion make gcc
libtool gtk-doc-tools g++ libart-2.0-dev libtiff4-dev
libjpeg62-dev libmng-dev libpng12-dev librsvg2-dev
libgutenprintui2-dev libaa1-dev python2.5-dev python-gtk2-dev
libaa1-dev libxpm-dev libwmf-bin libwmf-dev libgtkhtml2-dev
(You might also need a package or two for gvfs if you're running
gnome, otherwise you might want to configure --without-gvfs.)
In case you're curious, in intrepid that pulls in the following list:
The following NEW packages will be installed: autoconf automake1.7 automake1.9 autotools-dev build-essential debhelper docbook docbook-dsssl docbook-to-man docbook-xsl docbook-xsl-doc-html dpkg-dev g++ g++-4.3 gettext gnome-common gtk-doc-tools gutenprint-locales html2text intltool intltool-debian jade libaa1-dev libapr1 libaprutil1 libart-2.0-dev libatk1.0-dev libcairo2-dev libdbus-1-dev libdbus-glib-1-dev libexif-dev libexpat1-dev libffi-dev libfontconfig1-dev libfreetype6-dev libglib2.0-dev libgtk2.0-dev libgtkhtml2-dev libgutenprintui2-1 libgutenprintui2-dev libice-dev libjpeg62-dev liblcms1-dev libltdl7-dev libmail-sendmail-perl libmng-dev libmysqlclient15off libncurses5-dev libneon27-gnutls libosp5 libostyle1c2 libpango1.0-dev libpixman-1-dev libpng12-dev libpq5 libpthread-stubs0 libpthread-stubs0-dev librsvg2-dev libslang2-dev libsm-dev libsp1c2 libstdc++6-4.3-dev libsvn1 libsys-hostname-long-perl libtiff4-dev libtiffxx0c2 libtool libwmf-bin libwmf-dev libx11-dev libxau-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-xlib0-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxml2-dev libxmu-dev libxmu-headers libxpm-dev libxrandr-dev libxrender-dev libxt-dev m4 mysql-common openjade patch pkg-config po-debconf python-dev python-gobject-dev python-gtk2-dev python-gtk2-doc python2.5-dev sp subversion x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev x11proto-xext-dev x11proto-xinerama-dev xtrans-dev zlib1g-dev
Once you have those, you also need gegl and babl (Intrepid may already have packages for them, but Hardy doesn't). GEGL has a few tricks: Currently gegl's svn build requires Ruby (not true for gimp) and its docs require something or other that the previously listed packages didn't pull in, so I had to configure without docs.
sudo make install
First, try this: apt-get build-dep gimp
That might be all you need, but if not, here's the long version:
aptitude install build-essential subversion make gcc libglib2.0-dev libgtk2.0-dev intltool automake1.9 libtool gtk-doc-tools g++-3.3 libart-2.0-dev libtiff4-dev libexif-dev libxmu-dev libjpeg62-dev libmng-dev libpng12-dev librsvg2-dev libgutenprintui2-dev libaa1-dev python2.5-dev python-gtk2-dev libaa1-dev libxpm-dev libwmf-bin libwmf-dev libgtkhtml2-dev
However, there's one more catch: there's a bug in pygtk 2.10, so you will either need to disable gimp-python in the build, or patch your file locally. GIMP bug 381389 describes the problem and gives a patch. Unfortunately, Ubuntu doesn't plan to fix this in Edgy (bug 75327). Perhaps you'll have better luck filing a bug with your distro.
aptitude install cvs make gcc libgdk-pixbuf-dev intltool automake1.9 libtool gtk-doc-tools g++-3.3 libart-2.0-dev libtiff4-dev libexif-dev libxmu-dev libjpeg62-dev libmng-dev libpng12-dev librsvg2-dev libwmf0-dev libgutenprintui2-dev aalib1-dev python2.4-dev python-gtk2-dev libaa1-dev libxpm-dev libwmf-bin libwmf-dev libgtkhtml2-dev
After that, this command should install everything:
aptitude install intltool automake1.9 libtool gtk-doc-tools g++-3.3 libart-2.0-dev libtiff4-dev libjpeg62-dev libmng-dev libpng12-dev librsvg2-dev libwmf0-dev libgimpprint1-dev aalib1-dev python2.4-dev python-gtk2-dev
which installs these packages:
[several gcc and gtk related packages, plus:] autoconf automake1.7 autotools-dev intltool libcompress-zlib-perl libfont-afm-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libmailtools-perl libtimedate-perl liburi-perl libwww-perl libxml-parser-perl automake1.9 libltdl3 libltdl3-dev libtool docbook-to-man docbook-xsl gnome-common gtk-doc-tools jade libsp1 sp g++-3.3 libstdc++5-3.3-dev libart-2.0-dev libtiff4-dev libjpeg62-dev libbz2-dev libcroco3-dev libgsf-1-dev liblcms1-dev libmng-dev libpng12-dev libpopt-dev librsvg2-dev libxml2-dev aalib1-dev libgimpprint1-dev libncurses5-dev slang1-dev python2.4-dev python-gtk2-dev For 2.2 and earlier, you also need this step:
After running ./configure (or ./autogen.sh if you're building the CVS version), check to make sure you aren't missing anything:
grep "will not" config.logThis will tell you everything configure says "will not be built", which otherwise you wouldn't know about until you tried to use it and it didn't work.
The gtk/glib 2.0 RPMS shouldn't be needed for 1.2, only for 1.3; but I tried 1.3 first so I haven't separated the dependencies.
|libpng-1.2.1-2.i386.rpm||aalib (from tarball)|
|perl-GTK-0.7008-ximian.3.i586.rpm||perl-Parse-RecDescent-1.80-ximian.2.i386.rpm||[needs something for libmpeg]|
rpm -e --nodeps gimp-develthen edit /etc/ld.so.conf to add /usr/local/lib (where the new gimp libraries live), then run ldconfig. After that, autogen.sh worked (albeit with some warnings, which I ignored).