Saturday, July 16, 2011

Building gnome from git on Ubuntu Lucid

Lately I've been trying to build gedit from its source repository so that I can help improve it.

It's been hugely painful, I'm sad to say. Downloading from git and running, I got errors about my gnome libraries not being new enough. Fair enough, so I installed Ubuntu Natty on a spare hard disk. No luck, so I updated to the alpha of Ubuntu Oneiric. That actually worked OK, except that Oneiric is so alpha that it's very unstable.

Finally I asked on IRC, and the devs told me I needed to build with "jhbuild", the build manager for gnome. That failed on my Hardy machine, but that's no big deal since Hardy is pretty ancient now.

Lucid it is! I did a clean install on a separate hard disk, and started in with jhbuild. I used the sample.jhbuildrc file, pointing the install directories to my home directory instead of /opt. It chugged along for a while, checking out and building all of gedit's dependencies. Then it bombed while building gtk+/gdk with:
/usr/share/gir-1.0/GdkPixbuf-2.0.gir: Incompatible version 1.0 (supported: 1.2)
The folks at helped me trace the problem to jhbuild/, which sets XDG_DATA_DIRS around line 368. Prepending /usr/share to XDG_DATA_DIRS means that the system data dirs take precedence, and thus the GdkPixbuf compiled by jhbuild doesn't get detected.

Commenting out the XDG_DATA_DIRS stuff and adding this to my .jhbuildrc solved the problem:
addpath('XDG_DATA_DIRS', os.path.join(prefix, 'share'))
addpath('XDG_DATA_DIRS', os.path.join(prefix, 'usr/share'))

Also, it looks to me like there's a bug in the XDG_CONFIG_DIRS around line 378, where it prepends /etc to XDG_DATA_DIRS instead of XDG_CONFIG_DIRS.

Apart from that, I've had to babysit jhbuild as it builds NetworkManager, libproxy and just about everything else in gnome, occasionally bombing out until I track down the right -dev packages to install.


corni said...

nice to see you found a solution. I have the exactly same error but using the normal "./configure -> make" way. Do you have any idea what to do? (Ubuntu 10.04, latest Gdk-Pixbuf 2.24.0 installed correctly)

kind regards,


Anonymous said...

No, as far as I can tell, building without jhbuild is completely broken.