Difference between revisions of "Hacking:Building with Meson"

From GIMP Developer Wiki
Jump to: navigation, search
(Initial page creation)
 
Line 1: Line 1:
 +
 +
== Introduction ==
 +
 
This page is a guide to build Gimp with the new Meson build system.
 
This page is a guide to build Gimp with the new Meson build system.
  
OS-specific pages are listed here:
 
  
* [[Hacking:Building/Linux with Meson]]
+
== Define the installation prefix ==
* [[Hacking:Building/Windows with Meson]]
+
 
 +
<ins>If you're building Gimp from <code>master</code>,</ins> 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 <code>$HOME/.local</code>.
 +
 
 +
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 : <code>export XDG_DATA_DIRS</code> 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 ===
 +
 
 +
<code>pacman -S --needed </code>
 +
 
 +
=== Debian ===
 +
 
 +
<code>apt install </code>
 +
 
 +
=== Windows / MinGW ===
 +
 
 +
<code>pacman -S --needed </code>
 +
 
 +
== Download the source code ==
 +
 
 +
The source code is hosted on Git, but you can also download tarballs.
 +
 
 +
=== Git clone ===
 +
 
 +
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

Revision as of 15:29, 9 September 2019

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

The source code is hosted on Git, but you can also download tarballs.

Git clone

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