Building GIMP for macOS
The main GIMP building instructions are at Building GIMP. This page is for macOS-specific changes.
Supported macOS API
The supported versions of macOS are noted in the
devel-docs/os-support.txt file of the GIMP source you cloned or downloaded.
GIMP project is favoring backward compatibility as a general rule and we really don’t like deprecating hardware when it is just a few years old. Nevertheless we may have to bump our macOS requirement when it becomes too hard to maintain. This is especially true as this OS has extremely low contribution rate while core system changes happen at nearly each macOS release. Sometimes, lowering compatibility with old versions is the only way to reduce hardship for the few contributor(s) we have.
Therefore if you find the minimum supported macOS version too high, the best solution would be to contribute.
Building GIMP natively under macOS using MacPorts
MacPorts is a project that provides basically everything you would need (package manager, recipes) to build macOS software.
Running, from GIMP source, build\macos\1_build-deps-macports.sh then
build\macos\2_build-gimp-macports.sh might be all there is to do.
To better understand the compilation flow, you may read below.
Install the dependencies for GIMP
- First, if you don’t have MacPorts installed, go to:
https://www.macports.org/install.php
- To be able to later use MacPorts packages, you need to detect it:
export OPT_PREFIX=$(which port | sed 's|/bin/port||')- Update the system:
eval $( [ "$OPT_PREFIX" = /opt/local ] && echo sudo ) port sync && eval $( [ "$OPT_PREFIX" = /opt/local ] && echo sudo ) port upgrade outdated- Dependencies are installed with the following command, from GIMP source:
eval $( [ "$OPT_PREFIX" = /opt/local ] && echo sudo ) port install -N $(grep -v '^#' build/macos/all-deps-uni.txt | sed 's/|homebrew:[^ ]*//g' | tr -d '\' | xargs)This step will download a ton of packages, and may take a while.
Prepare for building
On macOS, environment variables are defined this way:
export GIMP_PREFIX=${HOME}/_install
# Used to detect the build dependencies
export PKG_CONFIG_PATH="${GIMP_PREFIX}/lib/pkgconfig:${OPT_PREFIX}/lib/pkgconfig:${OPT_PREFIX}/opt/libarchive/lib/pkgconfig"
# Used to find the glib-introspection dependencies
export XDG_DATA_DIRS="${GIMP_PREFIX}/share:${OPT_PREFIX}/share"
# Used to find programs/tools during build and at runtime
export PATH="${GIMP_PREFIX}/bin:${OPT_PREFIX}/bin:$PATH"
# Used to find introspection files
export GI_TYPELIB_PATH="${GIMP_PREFIX}/lib/girepository-1.0:${OPT_PREFIX}/lib/girepository-1.0"Building the software
You can now just run the build commands on the main page.
Be careful that, since you are using two separate prefixes ($OPT_PREFIX and $GIMP_PREFIX),
the option of relocatability should be disabled at meson setup: -Drelocatable-bundle=no.
Also, considering that the compiler (Apple Clang) have a prefix that takes precedence at
build-time, set the following meson options for babl, GEGL and GIMP:
-Dc_args=-I${OPT_PREFIX}/include -Dcpp_args=-I${OPT_PREFIX}/include -Dc_link_args=-L${OPT_PREFIX}/lib -Dcpp_link_args=-L${OPT_PREFIX}/lib.
Once installed, you can always run gimp* using a .sh profile.