Hacking:Building with Meson

From GIMP Developer Wiki
Revision as of 07:26, 10 September 2019 by Salamandar (Talk | contribs)

Jump to: navigation, search

Introduction

This page is a guide to build Gimp with the new Meson build system.


Define the installation prefix

If you're building Gimp from master, you may not want to install it in your system prefix, as you may break your system Gimp installation.

You should then create another prefix directory where Gimp (and some dependencies) may be installed safely.

On Linux you could use $HOME/.local.

Let's name your custom prefix :

GIMP_PREFIX=${HOME}/gimp_prefix

Some dependencies may be installed in this prefix too, so the build system should be able to find them :

# Used to detect the build dependencies
export PKG_CONFIG_PATH="${GIMP_PREFIX}/lib/pkgconfig:${GIMP_PREFIX}/share/pkgconfig"

# Used to find the glib-introspection dependencies
export XDG_DATA_DIRS="${GIMP_PREFIX}/share"
# Used to find the libraries at runtime
export LD_LIBRARY_PATH="${GIMP_PREFIX}/lib:${LD_LIBRARY_PATH}"

FIXME : export XDG_DATA_DIRS may lead to a gdk-pixbuf bug according to another wiki.


Install the dependencies

Most dependencies from Gimp are available to install with your package manager.

Babl and Gegl are two special cases : if you're building Gimp from master, you need to build them too as they are tightly linked.

Depending on the OS or distro you're using, the package names may be different. Here are widely-used dependency install commands:

Archlinux and derivatives

pacman -S --needed

Debian

apt install

Windows / MinGW

pacman -S --needed

Download the source code

Download with git

git clone https://gitlab.gnome.org/GNOME/babl.git
git clone https://gitlab.gnome.org/GNOME/gegl.git
git clone https://gitlab.gnome.org/GNOME/gimp.git

If your distro does not provide them, you should get the Mypaint libs too :

git clone https://github.com/mypaint/mypaint-brushes.git
git clone https://github.com/mypaint/libmypaint.git

Download release archives

Gimp also provides release archives :

https://download.gimp.org/pub/babl
https://download.gimp.org/pub/gegl
https://download.gimp.org/pub/gimp

Releases for mypaint can be found on their github page.

Build the code

Mypaint

cd libmypaint

Generate the configure script. That may be unnecessary with release archives :

./autogen.sh

Configure the build :

# ./configure --help
./configure --prefix=${GIMP_PREFIX}

Build the code :

make -j$(nproc)
make install
cd ..

cd mypaint-brushes
./autogen.sh
./configure --prefix=${GIMP_PREFIX}

make && make install