Small picture of Enselic

This is the personal website of Martin Nordholts a.k.a. Enselic. It contains my blog and some other information related to me and what I do. In my spare time I contribute to GIMP and GEGL development and occasionally to other open source projects as well.

Saturday, December 26, 2009

Best way to keep up with GIMP from git

The more people that use the latest GIMP code from git the better. It keeps the required effort to contribute code upstreams small, which in turn increases the likelihood of upstream contributions, and it makes bugs more vulnerable to early discovery which minimizes their impact.

However, keeping up with GIMP from git means extra work compared to using prebuilt packages. Unless you know of an easy way you might not withstand it. What follows is a description of how I do it, which is almost effortless once setup. I assume you know how to install necessary dependencies, what "the install prefix" means, and that you run Linux. The approach I use differs in two principal way compared to the many guides found on the net:
  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 such as PREFIX=/home/martin/gimp-git, either manually or using this script:
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"
Then, assuming you have all the dependencies, you build GIMP the first time with:
git clone git://git.gnome.org/gimp
cd gimp
./autogen.sh --prefix=$PREFIX
make
make install
and then to get updated with the latest changes from the constantly moving code base you regularly do
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. In those rare occasions where things break, just run git clean -x -d -f which removes all non-version-controlled files so that you can start over.

The above approach works for as good as all GNOME projects, including GLib and GTK+. This makes it easy to adapt to GIMP's build requirements of these and other libraries even if your distro doesn't meet them. Let me know if you have problems!

6 Comments:

At December 26, 2009 7:48 PM , Blogger phani said...

thanks a lot for this simple instruction. i wanted to try out GIMP source for a while, but put it off because i thought i'd have to get into the whole git-thing first.

my C++ skills are more than rusty so i doubt i'll be able to contribute anything soon, but i should be able to help with testing at least--and get an idea what you're really up to in the near future.

 
At December 27, 2009 3:22 PM , Anonymous Anonymous said...

hey cool! i like those tips

 
At January 5, 2010 11:49 PM , Anonymous Searcher said...

any news about the reselease of GIMP 2.8 ?

 
At January 11, 2010 6:37 PM , Anonymous Anonymous said...

Please upload somewhere a test version for Gimp for Windows.

 
At January 26, 2010 10:06 PM , Anonymous Anonymous said...

You make want to mention that you have to "git" babl and gegl as well as gimp if this is the first time compiling the 2.7.x code. Adding the -j option to make can also speed up compiling (i.e. make -j3 if you have a duo core machine or make -j5 for a quad core)
Thanks for all your work on gimp.

 
At February 27, 2010 5:02 PM , Anonymous Anonymous said...

I run openSuSE 11.2 which has its own pre-compiled packages, and I've always updated from their download site. I am not sure how to follow the procedure you recommend. Should I uninstall Gimp and remove all traces, then build from scratch? Or what? I tend to like running on the bleeding edge of everything. Must be a character flaw, or something. You can tell me I'm just being frivolous, or an insane thrill-seeker. Just curious.

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home