page is being written; please be patient
This page describes how to set up an environment to build Gimp from source, to get the source, and to build Gimp (and the necessary prerequisites).
The goal will be to keep the Gimp development environment separate from the rest of the system, to make sure that instabilities in the Gimp development code do not impact the system as a whole. It will allow you to keep using a stable Gimp version while working on the development version.
The initial description on this page is based on working on Linux. Developers with experience developing on other systems are encourage to add details.
- Define the Development Environment
- Getting the necessary source
- Running autoconf / configure
- Running make / make install
Define the Development Environment
The first decision to make is where to set up the Gimp development environment. For instance, you could
create a directory
gimpdev under your home directory, or maybe you have a different
place on your system where you do all your development work. Personally, I do all my development on a
separately mounted drive at
Set the environment variable GIMPDEV to the location where you do your Gimp development (obviously, use your actual location rather than the example given here):
In the $GIMPDEV directory, create two sub-directories:
source (where all
the source code will be located), and
deploy (where the libraries and executable programms
are going to be installed).
With those directories created, four more environment variables should be defined. The PREFIX
variable will be used as the --prefix attribute for configure, and point to the
directory. The PATH, LD_LIBRARY_PATH and PKG_CONFIG_PATH
variables are re-defined to include the Gimp development versions of the component before the
version installed on the system.
export PREFIX=$GIMPDEV/deploy export PATH=$PREFIX/bin:$PATH export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
In order to keep the Gimp development environment separate from regular work, these settings should not
be added to the standard settings. A better solution would be to create a batch file with these settings
startgimpdev) and invoke that:
Note the use of the
source command; that is the only way to get the settings in the current
shell, rather than being lost when the batch file is done.
My complete startgimpdev batch file looks like this:
#!/bin/bash export GIMPDEV=/mnt/lincoln/d3/gimpdev export PREFIX=$GIMPDEV/deploy export PATH=$PREFIX/bin:$PATH export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH cd $GIMPDEV/source