You are not logged in.

#1 2015-10-30 02:07:28

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

HowTo: Scripts to Compile and Update the latest GIMP 2.9

EDIT: @xaos52 has made a combination build/update script to do the job: (down the page).
UPDATE: 2016-08-10 Latest successful combi-script is on github, here (See post #28)

As of 06 Jan 2016: The build succeeds with certain libraries installed from jessie-backports, but may fail if they are from deb-multimedia. If you have a problem, then try disabling deb-multimedia, and installing the offending libs from jessie-backports.

------------------------

UPDATE  2016-05-19

Built successfully with @xaos52's script on a basic BunsenLabs Hydrogen installation. There is a further python cairo dependency to add, so edit line #59 to:

required_dependencies=( git scons libgtk2.0-bin libgexiv2-dev libjson-glib-dev libjson-c-dev python-cairo-dev )

NB: if you are using a VM, or for some other reason your hardware only has 1 processor, comment out line #67, otherwise the script has zero threads to work with!

#    number_of_jobs=$(( number_of_jobs -1))

-----------------------

YMMV!

How to compile the latest GIMP 2.9, with 16/32 bit support

Users Guide to high-bit depth GIMP 2.9.2
The new gegl and babl image-processing libraries have had major improvements: many existing filters have now been ported, and some have OpenCL versions. There is multi-threading support and mipmap rendering (both experimental).

These scripts compile and install the latest GIMP-2.9 in the $USER's $HOME. (The compiled libraries are kept here, so there are no conflicts with versions already installed)

This supercedes the original HowTo on the Crunchbang forums: How to compile the latest GIMP 2.9

I used these links as references:

compiling-gimp
meetthegimp
Compile GIMPv2.9.1 for Debian (Wheezy/Sid)
gimpbuild

There is a fairly recent generic method here: Building GIMP for artists and photographers

I've made a couple of scripts which do the heavy lifting, so there need be no manual configuration. Most dependencies should be pulled in by the `build-dep` switch in the `apt-get` commands.

If library version requirements change then you are on your own.....

Don't forget to enable the deb-src line in `/etc/apt/sources.list`:

deb-src http://ftp.uk.debian.org/debian jessie main contrib non-free

***************************************

What do the scripts do?

gimp-build

  1. Creates the pre-build environment (make installation dir, export environment variables)

  2. `apt-get update`, and `apt-get install` the necessary packages

  3. `git clone` babl, gegl and gimp and `make & make install` in `~/.gimp-dev/`

gimp-update

  1. Checks for previous install

  2. `git pull` of the latest babl, gegl and gimp sources

  3. `make & make install` again

***************************************

If you want an auto-updating menu item, then uncomment the menu section at the end of the script (assuming the menu item is "INSTALL GIMP-dev")

## If you add a menu item "INSTALL GIMP-dev", then uncomment below
## to update menu.xml:

#f="$HOME/.config/openbox/menu.xml"

#sed -i 's|INSTALL GIMP|GIMP-2.9|g' "$f"
#sed -i 's|x-terminal-emulator -e gimp-build|~/.gimp-dev/bin/gimp-2.9|g' "$f"

#openbox --reconfigure

**************************************

The executable for your new GIMP will be `~/.gimp-dev/bin/gimp-2.9`.
Run it from the commandline to see the output if there are problems. (You will probably get some error output, especially from plug-ins with deprecated syntax).

gimp-build

#!/bin/bash
##
#   Script by damo <damo@bunsenlabs.org>, March 2014, adapted from one described here:
#   <http://www.gimp.org/source/howtos/gimp-git-build.html>
#
#   Updated for BunsenLabs, October 2015
#
#   Script to compile and install the latest GIMP-2.9 in the $USER's $HOME
#   All libraries are kept here, so there are no conflicts with versions
#   already installed.
#
#########################################################################
#
#   NB  Development tools and dependencies will be installed by the script if needed
#
########################################################################
#
#   [QUOTE from <http://www.gimp.org/source/howtos/gimp-git-build.html>]
#     1.I use autoconf's config.site feature instead of setting up
#       environment variables manually
#     2.I install in my home directory
#       Making use of config.site nullifies the need to manually manage
#       environment variables, and installing in the home directory makes it
#       easy to tinker with an installation since you don't need to
#       be root. So, put this in $GIMP_DIR/share/config.site where $GIMP_DIR is in
#       your home directory eg GIMP_DIR=$HOME/.gimp-dev
#
#   THE SCRIPT DOES:
#   1)  export GIMP_DIR="$HOME/.gimp-dev"
#   2)  mkdir .gimp-dev
#       mkdir .gimp-dev/share
#   3)  creates .gimp-dev/share/config.site
#
#       and adds the following:
#
#       export PATH="$GIMP_DIR/bin:$PATH"
#       export PKG_CONFIG_PATH="$GIMP_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"
#       export LD_LIBRARY_PATH="$GIMP_DIR/lib:$LD_LIBRARY_PATH"
#       export ACLOCAL_FLAGS="-I $GIMP_DIR/share/aclocal $ACLOCAL_FLAGS"
#
#       Now autogen will use the paths in this file, so they no longer
#       need to be managed manually
#
#   4)  Build babl,gegl,gimp the first time with the following script
#
#########################################################################

## Most recent required dependencies:
DEPS="libgtk2.0-bin json-glib-tools libjson-glib-dev libgexiv2-dev"

## Set up pre-build environment for GIMP-dev (set up env variables)
# Needs ~/.gimp-dev to be present
GIMP_DIR="$HOME/.gimp-dev"
echo "Checking if GIMP development directory is present..."
if [[ ! -d $GIMP_DIR ]]; then
    mkdir $GIMP_DIR
    echo "Created $GIMP_DIR"
else
    echo -e "$GIMP_DIR found\n"
fi
echo "Checking for config file to be used by autogen.."
if [[  ! -f "$GIMP_DIR/share/config.site" ]]; then
    echo "Creating config file..."
    if [[ ! -d "$GIMP_DIR/share" ]];then
        mkdir $GIMP_DIR/share
    fi
    touch $GIMP_DIR/share/config.site
    echo 'export PATH="$GIMP_DIR/bin:$PATH"' > $GIMP_DIR/share/config.site
    echo 'export PKG_CONFIG_PATH="$GIMP_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"' >> $GIMP_DIR/share/config.site
    echo 'export LD_LIBRARY_PATH="$GIMP_DIR/lib:$LD_LIBRARY_PATH"' >> $GIMP_DIR/share/config.site
    echo 'export ACLOCAL_FLAGS="-I $GIMP_DIR/share/aclocal $ACLOCAL_FLAGS"' >> $GIMP_DIR/share/config.site
    echo "Created $GIMP_DIR/share/config.site"
else
    echo -e "$GIMP_DIR/share/config.site found\n"
fi

# Check if there is a previous installation, and ask what to do
if [ -d "$GIMP_DIR/babl" ] || [ -d "$GIMP_DIR/gegl" ] || [ -d "$GIMP_DIR/gimp" ]; then
    echo -e "A previous installation has been found\n\
    \tWe can attempt to continue by deleting babl/gegl/gimp directories\n"
    read -p "Continue? (y/N) " yn
    case $yn in
        N|n  )  echo -e "Exiting installation...\n"
                exit
                ;;
        Y|y   ) rm -rf $GIMP_DIR/babl
                rm -rf $GIMP_DIR/gegl
                rm -rf $GIMP_DIR/gimp
                ;;
         *    ) echo -e "Exiting installation...\n"
                exit
                ;;
    esac
fi

# set up environment variables
export PATH=$GIMP_DIR/bin:$PATH
export PKG_CONFIG_PATH=$GIMP_DIR/lib/pkgconfig:$GIMP_DIR/share/pkgconfig

set -x # Print commands on the go
set -e # Stop at first non-zero return code

# Get dependencies (hopefully :) )
sudo apt-get update
sudo apt-get install --no-install-recommends git
sudo apt-get install --no-install-recommends $DEPS
sudo apt-get build-dep -y babl
sudo apt-get build-dep -y gegl
sudo apt-get build-dep -y gimp

# Find number of cpu cores, to multi-thread the make
MAKEOPTS="-j$(($(grep '^processor' /proc/cpuinfo | wc -l)))"

# $GIMP_DIR env var points to "$HOME/.gimp-dev"
cd $GIMP_DIR

# Build babl
git clone git://git.gnome.org/babl
cd babl
./autogen.sh --prefix=$GIMP_DIR
make
make install

cd $GIMP_DIR
# Build gegl
git clone git://git.gnome.org/gegl
cd gegl
./autogen.sh --prefix=$GIMP_DIR
make
make install

cd $GIMP_DIR
# Build GIMP
git clone git://git.gnome.org/gimp
cd gimp
./autogen.sh --prefix=$GIMP_DIR
make
make install

###------------------------------------------------------
## If you add a menu item "INSTALL GIMP-dev", then uncomment below
## to update menu.xml:

#f="$HOME/.config/openbox/menu.xml"

#sed -i 's|INSTALL GIMP|GIMP-2.9|g' "$f"
#sed -i 's|x-terminal-emulator -e gimp-build|~/.gimp-dev/bin/gimp-2.9|g' "$f"

#openbox --reconfigure

exit

**************************************************************

gimp-update

#!/bin/bash
##
#   Script by damo <damo@bunsenlabs.org> March 2014
#   Updated October 2015
#
#   Based on a script from
#   <http://www.gimp.org/source/howtos/gimp-git-build.html>
#
#   To get updated with the latest changes from the constantly moving
#   code base run this script regularly
#
########################################################################
# Note that this works without requiring any environment variables
# to be set since configure will source config.site. And because
# autogen.sh passes --enable-maintainer-mode to configure, it will also
# work when Makefile.am's or configure.ac are changed.
#
# If there are occasions where things break, just run:
#
#       git clean -xdf
#
# which removes all non-version-controlled files so that you can start
# over from autogen.sh
########################################################################

# Check required directories are present
GIMP_DIR="$HOME/.gimp-dev"

echo -e "\nChecking if GIMP development directory is present..."
if [[ ! -d "$GIMP_DIR" ]]; then
    echo "No GIMP development directory found!"
    echo "Build GIMP first, using gimp-build"
    exit
else
    echo "$GIMP_DIR found"
fi
echo
echo -e "\nChecking for config file to be used by autogen..."
if [[ -f "$GIMP_DIR/share/config.site" ]];then
        echo "$GIMP_DIR/share/config.site found"
else
    if [[ -d "$GIMP_DIR/share" ]]; then
        echo "Creating config file..."
        echo
        touch $GIMP_DIR/share/config.site
        echo 'export PATH="$GIMP_DIR/bin:$PATH"' > $GIMP_DIR/share/config.site
        echo 'export PKG_CONFIG_PATH="$GIMP_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"' >> $GIMP_DIR/share/config.site
        echo 'export LD_LIBRARY_PATH="$GIMP_DIR/lib:$LD_LIBRARY_PATH"' >> $GIMP_DIR/share/config.site
        echo 'export ACLOCAL_FLAGS="-I $GIMP_DIR/share/aclocal $ACLOCAL_FLAGS"' >> $GIMP_DIR/share/config.site
        echo "Created $GIMP_DIR/share/config.site"
    else
        echo -e "No GIMP development share directory found!\n\
        Build GIMP first, using gimp-build\n"
        exit
    fi
fi

echo

# update babl
if [[ -d "$GIMP_DIR/babl" ]]; then
    cd $GIMP_DIR/babl
    git pull --rebase
    make
    make install
else
    echo -e "No GIMP development babl directory found!\n\
    Build GIMP first, using gimp-build\n"
    exit
fi
# update gegl
if [[ -d "$GIMP_DIR/gegl" ]]; then
    cd $GIMP_DIR/gegl
    git pull --rebase
    make
    make install
else
    echo -e "No GIMP development gegl directory found!\n\
    Build GIMP first, using gimp-build\n"
    exit
fi

# update gimp
if [[ -d "$GIMP_DIR/gimp" ]]; then
    cd $GIMP_DIR/gimp
    git pull --rebase
    make
    make install
else
    echo -e "No GIMP development gimp directory found!\n\
    Build GIMP first, using gimp-build\n"
    exit
fi

exit

Last edited by damo (2016-08-10 19:15:40)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#2 2015-10-30 08:05:41

Snap
Member
Registered: 2015-10-02
Posts: 465

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

Thanks for this, damo.

Offline

#3 2015-10-30 09:08:56

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

Running gimp-build now, thanks for this!

p.s. scrot
.gimp29.png

Last edited by brontosaurusrex (2015-10-30 09:46:53)

Offline

#4 2015-10-30 10:54:12

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

I guess you have noticed the "Precision" options in `File->New->Advanced` and `Image->Precision`? Ain't that lookin' good big_smile


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#5 2015-10-30 11:41:10

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

That is exactly what I noticed smile

Offline

#6 2015-10-30 15:24:52

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,138
Website

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

damo, I haven't said it lately... you're doing brilliant work. smile


I don't care what you do at home. Would you care to explain?

Offline

#7 2015-10-30 15:37:17

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

Quick test, input is exr and after about 30 heavy color-corrections/curves, noise reducers and such (Something heavy enough one would probably never do for real)
.postbangGlassGimp.png
It is definitely working in 32bpc (Only a very slight break of gradients is noticable).

p.s. If you need something to play around
https://dl.dropboxusercontent.com/u/795 … isolje.exr (d98535d850e78fb0fc2d4e0a0263a1dc)

my (really quick) try
.visolje.png

Last edited by brontosaurusrex (2015-10-30 16:15:53)

Offline

#8 2015-12-21 17:13:37

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

@damo, any problems (license/whatever) if I bundle this two scripts (unchanged so far) to my git?

Offline

#9 2015-12-21 17:48:21

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

No probs with me - just the usual acknowledements AFAIC. Improve them if you can smile

I would suggest a prominent note in the README though: I originally had a previous version working with Wheezy, then the dependency versions changed for babl and gegl, so I had to upgrade to testing.

Maybe 2.10 is now close enough so there won't be any major dependency jumps and they will still compile on jessie (fingers crossed!).

(I should do the same for mine on github as well!  :8 )


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#10 2015-12-31 12:11:30

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

It appears that it needs
https://github.com/mypaint/libmypaint (which brings in json-c)
now, which I have no idea how to compile.

Offline

#11 2015-12-31 17:37:34

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

If you uncomment the following line in `gimp-build`, the script stops at the first error:

set -e # Stop at first non-zero return code

I then get:

.....
Picking 'gegl-dmo' as source package instead of 'gegl'
E: Unable to find a source package for gegl-dmo

Or just do:

[damo@debian ~]$ sudo apt-get -s build-dep gegl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Picking 'gegl-dmo' as source package instead of 'gegl'
E: Unable to find a source package for gegl-dmo

The `gegl-dmo` package is in deb-multimedia source, which needs the following in sources.list:

deb-src ftp://ftp.deb-multimedia.org sid main

I'm not sure I'm willing to try that atm!

It looks like the development has made its first move away from the Stable libs sad

EDIT: Tried it in a VM and get:

....
E: Build-Depends dependency for gegl-dmo cannot be satisfied because candidate version of package libbabl-dev can't satisfy version requirements

EDIT2: `libbabl` version from stretch is required

Last edited by damo (2015-12-31 20:52:23)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#12 2016-01-06 11:24:46

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

@Damo,

I fleshed up your script a bit:

- one script for initial build and update build
- builds from git dev repos
- if an update, before building, the script copies {bin,lib} to {bin.old,lib.old}
- if the build fails, old bin and lib are restored so you should be able to use the old version
- works on fully updated bunsenlabs with backports enabled
- works on Debian sid

I am not an experienced gimp user.
I only use gimp to edit my digital photos and that seem to work OK.
Probably needs more testing from a seasoned gimp user.

You can find the new script at this github location

Offline

#13 2016-01-06 13:49:05

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

Great work smile

xaos52 wrote:

...
- works on Debian sid
...]

Now if we can get it working on Stable...

Picking 'gegl-dmo' as source package instead of 'gegl'
E: Build-Depends dependency for gegl-dmo cannot be satisfied because candidate version of 
package libbabl-dev can't satisfy version requirements
entered finish ...
declare -a executable='()'
gimp development failed to  build

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#14 2016-01-06 14:05:11

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

^ Looks like libbabl-dev may be backportable, the only dependencies are for libabl itself (which will also have to be backported) and libc6 > 2.14 (jessie has 2.17)

Offline

#15 2016-01-06 14:39:18

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

Head_on_a_Stick wrote:

^ Looks like libbabl-dev may be backportable, the only dependencies are for libabl itself (which will also have to be backported) and libc6 > 2.14 (jessie has 2.17)

I had started to investigate that route a few days ago, but then got sidetracked with getting all the functions of my new graphics tablet working with Linux and GIMP!


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#16 2016-01-06 15:08:38

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

Perhaps you missed this:

works on fully updated bunsenlabs with backports enabled

I build libmypaint, babl, gegl and gimp from git repos.
So I am not using libbabl-dev nor libgegl-dev from Debian.

Offline

#17 2016-01-06 15:35:21

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

Now if we can get it working on Stable...

Define 'Stable' please.
I am under the impression that Stable = Debian jessie. Am I wrong? smile

Offline

#18 2016-01-06 15:45:00

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

Remove and purge gegl-dmo. Perhaps also remove the debian-multimedia repo as it seems to be interfering,
and try rebuild again.

Offline

#19 2016-01-06 16:48:52

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

I have jessie-backports enabled, and `gegl-dmo` was never installed anyway.

I'm now getting build failures for various libav libs, but to get round those it seems that half my apps will need removing. I think that I'll leave my Stable (BL jessie) install alone for now, and start from scratch in another partition. The learning continues.... hmm

Thanks for your contribution smile


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#20 2016-01-06 22:41:41

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: HowTo: Scripts to Compile and Update the latest GIMP 2.9

Yay - sorted!

I disabled deb-multimedia, and installed the dependency-offending libs from jessie-backports. @xaos52's script built gimp-2.9 without errors smile

RESULT! big_smile

( Edited the first post accordingly)

Last edited by damo (2016-01-06 23:14:58)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

Board footer

Powered by FluxBB