Building GIMP
This page describes how to build GIMP.
Prerequisites
You should know how to use:
- a terminal and the command line;
- shell environment variables.
Download the source code
The sources needed to compile GIMP can be cloned or downloaded here.
If you clone GIMP, you need to be used to at least managing branches before building. Take a look at this comprehensive page.
GIMP’s dependencies
You may need to install some software to build GIMP, including a C compiler, meson, and more, plus many dependencies. See the OS-specific pages for this and other details like environment etc:
- build/linux - Building GIMP on Linux
- build/windows - Building GIMP on Windows
- build/macos - Building GIMP on macOS
For a complete list of dependencies, if you’re interested, see the files
included in the root of GIMP repo or tarball under the name INSTALL*.
These informative files linked above are generated by our build system and shipped with the tarballs, containing version information for dependencies.
Preparing for Building
After you installed all the dependencies, choose a place to safely install everything you will build, and set a custom environment variable pointing to it.
We can name your custom variable GIMP_PREFIX and set others accordingly.
For information on how to do that, see the OS-specific pages.
Build the source code
babl and GEGL
Babl and GEGL use Meson to facilitate the build process.
master branch (so, unless you know exactly what you’re doing,
avoid pre-compiled binaries and the tarballs).But the build process is simple. From the root of each project (babl then GEGL), run the following commands:
# Configure how the project will be built
# You can read the file `meson_options.txt` for the project options
# Meson itself also provides built-in options: https://mesonbuild.com/Builtin-options.html
meson setup _build -Dprefix="${GIMP_PREFIX}"
# Build in '_build' dir then install in $GIMP_PREFIX
cd _build
ninja
ninja installGIMP
Finally, after building babl and GEGL, you’re ready to build GIMP!
Rejoice! All the commands and comments written above regarding babl and GEGL also applies to GIMP building.
Just regularly make sure that you keep gimp-data updated with git submodule update
(inside gimp repo folder). This is mandatory to generate icons, splash screen, etc.
-Dgimpdir=GIMP/gitProblems?
Most build failures will occur during the meson setup command. You should first re-read this entire page and the OS-specific page. Then, if the problem persists, please report on GIMP bug tracker.
Running Your New GIMP
To run frequently the GIMP you have installed outside the usual places, you need to keep defined the same variables as for the build.
You can do this seting some of these variables in your “profile”: a shell script
that sets environment variables when you login (e.g. $HOME/.*profile on UNIX
and $profile on Windows).
See the OS-specific pages for more specific advice:
- build/linux - Building GIMP on Linux
- build/windows - Building GIMP on Windows
- build/macos - Building GIMP on macOS