Showing posts with label gimp 2.8. Show all posts
Showing posts with label gimp 2.8. Show all posts

16 December 2012

293. Running GIMP 2.8 in a chroot on debian stable/squeeze (ugly)

Update: because I had copied and pasted some of the instructions from one of my earlier attempts at building gimp under stable, there were some minor discrepancies. Those are fixed now.

Original post:
Here's the least elegant and functional way of running GIMP 2.8 on stable/squeeze other than running it in a virtual machine.
 I've previously tried
 * creating a statically linked binary of gimp 2.8 under testing, then using it under stable (didn't work --
 * compiling gimp + all dependencies from scratch -- ballooned out of control
 * compiling the bare minimum needed for gimp from scratch, but had issues with libglib2.0-dev -- the dev files are obviously taken care of when you compile glib, but the -dev package is required by a lot of libraries needed for graphics support, and I wanted to replace the libglib2.0-0 package.

Long story short, I gave up. If you don't mind the overhead in terms of space, you can run it in a chrooted environment. It's not pretty, but it works.


We first set up a chrooted environment

sudo apt-get install debootstrap coreutils
mkdir -p $HOME/tmp/architectures/testing
cd $HOME/tmp/architectures
sudo debootstrap --arch amd64 testing $HOME/tmp/architectures/testing/ http://ftp.au.debian.org/debian/
sudo chroot testing/

Cosmetic
Sort out locales to avoid annoying error messages
apt-get install locales
echo 'export LC_ALL="C"'>>/etc/bash.bashrc
echo 'export LANG="C"'>>/etc/bash.bashrc
source /etc/bash.bashrc

Also, add your hostname (=beryllium) to /etc/hosts by putting your hostname at the end of the 127.0.0.1 line:
127.0.0.1 localhost beryllium

to avoid constant warnings about unresolved hostname like the one below
sudo: unable to resolve host beryllium

Continue
I don't like working as root even in a chrooted environment, so create a new user, 'build' and give it superuser powers:
adduser gimp

And edit /etc/sudoers to add
gimp ALL=ALL:ALL
Defaults !tty_tickets

The reason we add the !tty_tickets is that otherwise you will have to type the password each time you use sudo i.e. it will time out instantaneously.

Run the echo command below and exit your chroot:
echo "export DISPLAY=:0.0">>/etc/bash.bashrc
exit
And put this in a file, e.g. gimp.sh
xhost + sudo mount -o bind /proc $HOME/tmp/architectures/testing/proc sudo cp /etc/resolv.conf $HOME/tmp/architectures/testing/etc/resolv.conf sudo chroot $HOME/tmp/architectures/testing
Run
sh gimp.sh

Now inside the chrooted shell that you just started, do
su gimp
cd ~

Time to install gimp
sudo apt-get install gimp

And you're done!

You can now run GIMP 2.8 in the chrooted environment. It is NOT elegant though.
Gimp running in a chrooted Wheezy on a Squeeze virtual machine (LXDE) on a Wheezy physical machine (gnome 3).
Moving files in and out of the jail:
There are a few options -- you can obviously always move files from your host system to the chroot jail. A major point of a chroot jail is that you can't access the host system though, but we've set up our gimp.sh so that we can connect via ssh or sftp as well

In your chroot, as the user gimp, do e.g.
sudo apt-get install openssh-client
sftp me@host:shared/

I warned you that it wasn't elegant...

05 May 2012

136. Compiling GIMP 2.8 on Debian Wheezy/Testing

EDIT 14/12/2012: To use an ugly approach to running gimp 2.8 on debian stable/squeeze, look here:
http://verahill.blogspot.com.au/2012/12/running-gimp-28-in-chroot-on-debian.html
It ain't pretty...

EDIT 27/05/2012: GIMP 2.8 is now in the debian testing repos.

GIMP 2.8 is out -- and it's got the fabled single-window mode: http://www.phoronix.com/scan.php?page=news_item&px=MTA5NjA

First you need to install babl >=0.1.10, and gegl-0.2 >= 0.2.0,  then you can compile and install GIMP 2.8. The versions of babel and gegl in the debian testing/wheezy repos are too old, so you will need to compile tboth babel and gegl yourself -- luckily it is very easy to do so (see below).

Building with python script support needed a ton of packages (it requires PyGTK which depends on pygobject which depends on glib and gobject-introspection etc.), so here I passed --disable-python during build. It just means you can't script gimp with python. No python.

As always, I only spot what packages are missing on my system. If you find that other packages are missing, let me know in the comment section and I'll expand the post. At a minimum, you will need build-essential

LMDE MINT USERS: it seems like you need to add a single line to your /etc/ld.so.conf file:
/usr/local/lib
Then do
sudo ldconfig 

ldconfig is in the package libc-bin

Both babl and gegl are gimp specific, so not giving install prefixes is probably ok. Just don't try to uninstall the pre-existing versions or gnome will disappear on you. See here http://forums.linuxmint.com/viewtopic.php?f=190&t=101253 for more LMDE discussions. See here http://cloudplasma.co.uk/2012/05/gimp-2-8-on-linux-mint-debian-edition/ for a compile based on this post.

START HERE
0. sudo apt-get install build-essential libatk1.0-dev libfontconfig1-dev libcairo2-dev libgudev-1.0-0 libdbus-1-dev libdbus-glib-1-dev liblcms1-dev libexif-dev libxfixes-dev libgtk2.0-dev python2.7-dev libtiff4-dev libpango1.0-dev

1. babl 0.1.10
wget ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.10.tar.bz2
tar xvf babl-0.1.10.tar.bz2
cd babl-0.1.10/
./configure
make
sudo make install

2. gegl 0.2.0
sudo apt-get install libglib2.0-dev zlib1g-dev
wget ftp://ftp.gtk.org/pub/gegl/0.2/gegl-0.2.0.tar.bz2
tar xvf gegl-0.2.0.tar.bz2 
cd gegl-0.2.0/
./configure
make
sudo make install

3. gimp 2.8.0
sudo apt-get install intltool
wget ftp://ftp.gimp.org/pub/gimp/v2.8/gimp-2.8.0.tar.bz2
tar xvf gimp-2.8.0.tar.bz2 
cd gimp-2.8.0/
./configure --prefix=/home/me/.gimp --disable-python
make
make install

3. ~/.bashrc
Chuck the following in your ~/.bashrc
alias gimp28='/home/me/.gimp/bin/gimp-2.8'
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

and source it. (source ~/.bashrc)

Start from the terminal using
gimp28

Done!

You can turn on single-window mode, by going to Windows and checking Single-Window Mode.


Edit: posted the how-to above eight hours ago, and already linked to by Debian-facile :-)


Links to this post:
http://forums.linuxmint.com/viewtopic.php?t=101253&f=190
http://cloudplasma.co.uk/2012/05/gimp-2-8-on-linux-mint-debian-edition/
http://linuxmint-fr.org/forum/graphisme/92501-installation-de-gimp-28.html