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 (note you can use the method I describe for the key dependencies, including babl, GLib, GEGL and GTK+), 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 -xdf which removes all non-version-controlled files so that you can start over from autogen.sh.

The above approach works for as good as all GNOME projects, including GLib, babl, GEGL 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!

13 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 26, 2009 11:50 PM , Anonymous Anonymous said...

hmm, great. but hard for windows/osx noobs like me... hmm

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

hey cool! i like those tips

 
At December 30, 2009 10:36 PM , Anonymous Anonymous said...

It would be nice if a Windows bleeding edge version was available. Then I could contribute info on features / bugs.

 
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.

 
At May 3, 2010 12:26 AM , Anonymous Anonymous said...

thanks for this easy guid. i love gimp 2.7 from now!!

 
At July 6, 2010 5:13 PM , Anonymous John said...

Seems that there are quite a few new dependencies with the most recent builds. Any recommendations on the fastest way to meet those?

 
At July 8, 2010 11:37 AM , Blogger Martin Nordholts said...

@John:
First "yum-builddep gimp gegl babl" or "apt-get build-dep gimp gegl babl" which will give you most build dependencies. Then "yum search" or "apt-cache search" or "yum provides" or "apt-file find" to find the last missing ones. And finally use the method described above for the rest.

 
At August 13, 2010 6:56 PM , Anonymous Anonymous said...

$ git pull --rebase
fatal: Not a git repository (or any parent up to mount parent )
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

 
At August 13, 2010 7:05 PM , Blogger Martin Nordholts said...

You need to be in the source dir. What is your working directory when you issue that command?

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home