SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-04-04 00:04:31

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,433

How to compile the latest GIMP 2.9

I find that I can't wait any more for 2.10 with its 16/32 bit support, so although I'm barely legal with this stuff I decided to have a go at.....

Compiling GIMP 2.9

For those with a good understanding of repos, libraries, compiling etc then by all means shout out so I can change things you think could be done better (or correctly!)

I used these links as references:

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



Prepare the environment, Set up your install prefix

I didn't want to compile GIMP and install in the default location, which would cause conflicts, so I created a ~/gimp-2.9 directory and configured the environment variables so that the correct versions of libraries will be found and used.



Method from gimpbuild  :

Decide on where you're going to put the installed files. By default, the packages will install to /usr/local, but that will cause conflicts with the older version of GIMP already installed on your machine. If you want to keep two or more GIMP versions available, you need to choose an install "prefix". For example, I use /usr/local/gimp-git. It's okay to put all the gimp-related packages in one prefix -- you don't need a separate prefix for each package.

If you're building on a system used only by you, you might want to consider using a prefix in your home directory, e.g. --prefix=/home/yourname/gimp-git. That way, you can run make install without needing to be root.

Set up your PKG_CONFIG_PATH to point to this prefix, otherwise gegl won't be able to find babl and gimp won't find either one of them. The easiest way to do this is to create the prefix, create a share directory inside it, then create a config.site file there containing lines like these:

export PKG_CONFIG_PATH="/usr/local/gimp-git/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="/usr/local/gimp-git/lib:$LD_LIBRARY_PATH"


These are my env variables:

mkdir ~/gimp-2.9

export PREFIX=`echo ~/gimp-2.9`
export PATH=$PREFIX/bin:$PATH
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig

Dependencies

You need to apt-get install some or all of these from the Wheezy repos (NB This list was combined from several others)

libjpeg8-dev libopenexr-dev libopenraw-dev libcairo2-dev librsvg2-dev  liblua5.1-0-dev gtk-doc-tools libtiff5-dev python-dev python-gtk2-dev libasound2-dev libgimp2.0 libgimp2.0-dev libjson-glib-dev libtool  gettext libglib2.0-0 libglib2.0-dev libgtk2.0-0 libgtk2.0-dev ruby intltool libtiff4 libexif-dev libmng-dev liblcms1-dev libxpm-dev libwmf-dev valac xsltproc openexr libexif-dev

Get the source, generate makefiles and compile

(GIMP also needs the latest babl and gegl, which need to be compiled in the right order)

Suggestion from gimpbuild  :

If you have a modern multi-core system, adding a -jN flag to the make line will speed things up. Try make -j4. (People argue incessantly about the best number to use after -j, but it seems to vary from one system to the next. It's not critical.)

cd ~/gimp-2.9

git clone git://git.gnome.org/babl
git clone git://git.gnome.org/gegl
git clone git://git.gnome.org/gimp

cd babl
./autogen.sh --prefix=$PREFIX
make
make install

cd ../gegl
./autogen.sh --prefix=$PREFIX
make
make install

cd ../gimp
./autogen.sh --prefix=$PREFIX --disable-gtk-doc 
make
make install

This hopefully produces a working cutting edge installation, with the executables in ~/gimp-2.9/bin

Run GIMP from the command line to see the output if there are any problems

Install splash images as ~/gimp-2.9/share/gimp/2.0/images/gimp-splash.png
eg this one smile (I don't like the goat-thing going on with gimp!)

gimp_splash_for_2_9_and_crunchbang_by_capn_damo-d60caw1.png


Wrapper script from gimpbuild

One more thing: if you have a distro-installed GIMP too, you may find it helps to have a wrapper script that ensures you're using the right libraries. Otherwise, GIMP and any plug-ins it runs can get confused and exhibit weird behavior.

Here's the script I use, which I install in ~/bin/gimp-git, and then I make a link to it named gimptool-git. I'm sure this could be improved, but it seems to work.

#!/bin/sh

progname=$(basename $0)
if [ $progname = 'gimptool-git' ]; then
  progname=gimptool-2.0
fi

GIMPLOC=/usr/local/gimp-git
export PATH=$GIMPLOC/bin:$PATH
export LD_LIBRARY_PATH=$GIMPLOC/lib

$GIMPLOC/bin/$progname $*

Keeping GIMP up to date

Don't delete the source directories, and update with...

export PREFIX=`echo ~/gimp-2.9`
export PATH=$PREFIX/bin:$PATH
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig


cd ~/gimp-2.9

cd babl
git clean -f
git pull --rebase
./autogen.sh --prefix=$PREFIX
make
make install

cd ../gegl
git clean -f
git pull --rebase
./autogen.sh --prefix=$PREFIX
make
make install

cd ../gimp
git clean -f
git pull --rebase
./autogen.sh --prefix=$PREFIX
make
make install

Happy GIMPing smile

PS If you bork your system it wasn't my fault cos I wasn't there and anyway no one saw me

Last edited by damo (2015-03-28 17:29:07)


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

Help fund CrunchBang, donate to the project!

#2 2013-11-28 15:57:22

brontosaurusrex
#! Red Menace
Registered: 2012-06-15
Posts: 1,643

Re: How to compile the latest GIMP 2.9

You did this on wheezy?

I get this from gegl;

*** GLIB 2.36.0 or better is required. The latest version of
*** GLIB is always available from ftp://ftp.gtk.org/.

Offline

#3 2013-11-28 16:30:30

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,433

Re: How to compile the latest GIMP 2.9

I originally did it running wheezy - at the time the dependencies were satisfied iirc

I'm now on jessie, and I used the method described here

(NB I don't know much about all this stuff, I tend to just follow the recipe)

3 scripts to help automate the process:

gimp-prebuild: sets up env vars, installs dependencies (using a ~/home directory)

#!/bin/bash
##
## Set up pre-build environment for GIMP-2.9 (set up env variables, install dependencies)
#
# Needs ~/gimp-2.9 to be present

# set up environment variables
export PREFIX=`echo ~/gimp-2.9`
export PATH=$PREFIX/bin:$PATH
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig

gimp-build:

#!/bin/bash
##
########################################################################
#
#  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 $PREFIX/share/config.site where $PREFIX is in #your home directory eg PREFIX=/home/user/gimp-2.9
#
#	1)add to .bashrc
#		export PREFIX="/home/user/gimp-2.9" 
#	2)  mkdir gimp-2.9
#		mkdir gimp-2.9/share
#	3)  nano gimp-2.9/share/config.site 
#
#		and add the following:
#
#		export PATH="$PREFIX/bin:$PATH"
#		export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
#		export LD_LIBRARY_PATH="$PREFIX/lib:$LD_LIBRARY_PATH"
#		export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal $ACLOCAL_FLAGS"
#
# 		Now autogen will use the paths in this file, so they no longer #	   need to managed manually
#
#	4)   Build babl,gegl,gimp the first time with the following script
#
#########################################################################
set -x # Print commands on the go
set -e # Stop at first non-zero return code

# Get dependencies (hopefully :) )
sudo apt-get build-dep babl
sudo apt-get build-dep gegl
sudo apt-get build-dep gimp

# Remove these (not sure why!)
sudo apt-get remove libbabl-dev libgegl-dev

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

#------------------------------------------------
# $PREFIX env var points to "/home/user/gimp-2.9"
cd $PREFIX

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

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

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

exit

gimp-update: To get updated with the latest changes

#!/bin/bash
##
########################################################################
#
# From http://www.gimp.org/source/howtos/gimp-git-build.html
#
# To get updated with the latest changes from the constantly moving 
# code base you regularly do:
# ( PREFIX="/home/user/gimp-2.9" )
########################################################################

# update babl
cd $PREFIX/babl
git pull --rebase
make
make install

# update gegl
$PREFIX/gegl
git pull --rebase
make
make install

# update gimp
$PREFIX/gimp
git pull --rebase
make
make install

########################################################################
# Note that the latter 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. 
#
# On those rare 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
########################################################################

exit

BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#4 2013-11-29 14:15:32

iann
#! Die Hard
Registered: 2010-09-10
Posts: 720

Re: How to compile the latest GIMP 2.9

Rather than keep two versions in different places, you might want to create a deb package from your build to keep things tidy.  Or at least a pseudo-package using something like checkinstall.  I don't know if the Gimp makefiles provide a package build option.

Offline

#5 2013-11-29 14:28:21

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,433

Re: How to compile the latest GIMP 2.9

iann wrote:

Rather than keep two versions in different places, you might want to create a deb package from your build to keep things tidy.  Or at least a pseudo-package using something like checkinstall.  I don't know if the Gimp makefiles provide a package build option.

Not sure I understand. The point about having 2 separate installations is to keep the dependencies apart. Are you saying there is a different method? (As I've said before, my knowledge of the ins and outs of apt-get is pretty minimal!)

I've just run the gimp-update script - it does it's stuff and I can run the latest build with its 16/32 bit support and to play with the gegl plugins, and I can run the stable release simultaneously for general use. If there is a better method then by all means point me that direction smile


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#6 2014-02-26 12:04:32

tonyoptical
#! CrunchBanger
Registered: 2009-09-08
Posts: 226

Re: How to compile the latest GIMP 2.9

Hi

I just made a big mistake ... downloaded the sources for 2.8.10 and just compiled it.
Now i can't run the old original one which came with CB defaultwise anymore. This is the error message:

Libgimp version mismatch!

The GIMP binary cannot run with a libgimp version
other than its own. This is GIMP 2.8.10, but the
libgimp version is 2.8.2.

Maybe you have GIMP versions in both /usr and /usr/local ?

I can only run the new one by launching a gimp-2.8 shell script which i found in the subdirectory "app" of "gimp-2.8.10" directory where i built this thing which is a pity because i can't print (Gutenprint & Turboprint) or scan (Canon 8.800F) in 2.8.10 anymore.

Any ideas how to fix this? Any help is highly appreciated.
I prefer to remove the 2.8.10 and just continue using the stock wheezy version again.
Thx.

Last edited by tonyoptical (2014-02-26 18:19:35)

Offline

#7 2014-02-26 18:49:24

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,433

Re: How to compile the latest GIMP 2.9

If you want to run different versions of GIMP you need to install them to different places, as described for 2.9

Have you tried purging GIMP and reinstalling?


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#8 2014-02-27 13:46:48

tonyoptical
#! CrunchBanger
Registered: 2009-09-08
Posts: 226

Re: How to compile the latest GIMP 2.9

@damo
Yes - i tried that already. Complete removal in synaptic - no success. 2.8.10 is still coming up.
In a desparate attempt i tried to delete all instances of gimp files i could find. No success -  faulty gimp w/o menu's is still coming up.
New install of gimp via synaptic - no success - still everything messed up. I am starting to think why this gimp thing is so deeply rooted in the system that you can't make it go away or re-install it ... I don't want a fresh install of Waldorf just because i broke Gimp by my own stupidity.

Last edited by tonyoptical (2014-02-27 13:47:04)

Offline

#9 2014-02-27 22:45:13

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,433

Re: How to compile the latest GIMP 2.9

I think you will need help from someone who knows their way around compiling/installing better than me. The package manager won't know about your compiled application, so it has just removed gimp 2.8.2, and left the broken gimp 2.8.10.

GIMP isn't "deeply embedded", because it is easily removed with synaptic/apt-get - it is the files that you have installed which are causing the problem.

Can you install the required version of libgimp?

(What does 2.8.10 have that makes 2.8.2 undesirable? I use the repo gimp for stability, and 2.9 for the new features, although it is definitely NOT stable)


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#10 2014-03-01 21:08:03

tonyoptical
#! CrunchBanger
Registered: 2009-09-08
Posts: 226

Re: How to compile the latest GIMP 2.9

@damo

Thx. for your message. Actually i was perfectly happy with my stock gimp installed.
I could scan, i could print unsing turboprint, i could use my drawing tablet ... i could manipulate my digital images ... i did not miss anything.

As a matter of fact my father (73 yrs) dropped me a message that the new gimp creates better quality outputs because of it's capability to use a higher bit-depth. It was my fault that i did not question this and just downloaded and compiled the sources ...

Offline

#11 2014-03-01 21:20:01

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,433

Re: How to compile the latest GIMP 2.9

GIMP 2.8.x is still only 8-bit - it is the development version which has higher depth support. It is available with 2.9, and hopefully the next stable release (2.10) will be in the near future. The image menu has a new "Precision" entry in which you choose what you want.


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#12 2014-03-23 16:55:38

beefsteak
New Member
Registered: 2014-03-23
Posts: 1

Re: How to compile the latest GIMP 2.9

Thanks for the intructions, damo, those were very helpful. I compiled it on Ubuntu 13.10 but had to install some extra packages though:

libgexiv2-dev
libbz2-dev
liblcms2-dev

Offline

#13 2014-03-23 17:30:36

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,433

Re: How to compile the latest GIMP 2.9

I've been working on making a couple of scripts - gimp-build and gimp-update - which do the whole thing. It's working fine using the jessie repos, but I'm having trouble with stable (GLIB version issues). I knew about the libgexiv2, but I'll have another look at the others you mentioned.

I think Ubuntu 14 has a ppa for GIMP 2.9


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: zapp

Debian Logo