Jhbuild
Jhbuild is a tool used to build the whole GNOME desktop from the git source, however, it can be used to build other projects creating a moduleset for it.
Useful resources
The JHBuild Manual
/Modulesets, a list of available module sets
garnome is an alternate project that will build gnome from released tarballs
The Gnome Developer Kit is another alternative that provides an installable ISO, a VMWare image, and a qemu image. You can install a full svn-up-to-date gnome system on a real machine or in a virtual machine. Using a virtual machine means you are unlikely to screw up your main system, and it "just works" more than jhbuild usually does...
Installation
Install the dependencies following JhbuildDependencies
- Create a directory for the GNOME source code (this will be used to download the source from the SVN repository), it's recommended to create a dedicated user for build and test the build environment:
mkdir -p ~/checkout/gnome2
- Clone jhbuild from git:
cd ~/checkout/gnome2 git clone git://git.gnome.org/jhbuild
- Install jhbuild (just creates some stuff in ~/.local/bin, so you don't need to become root):
cd jhbuild ./autogen.sh make make install
- List the available modulesets:
ls modulesets/
- Copy the sample .jhbuildrc, and edit the file as required (make sure the moduleset you want is enabled):
cp sample.jhbuildrc ~/.jhbuildrc vim ~/.jhbuildrc
Create the directory where gnome will be installed; Make it owned by you so we don't have to build as root:
sudo mkdir -p /opt/gnome2 sudo chown username:usergroup /opt/gnome2
- Check that jhbuild is in your PATH. Try:
jhbuild --help
- Add jhbuild to your path if necessary (you could put this in your .bashrc):
export PATH=$PATH:~/.local/bin
- Make sure the build environment is sane:
jhbuild sanitycheck
Any reasonably recent distribution should have all the packages required to compile the packages in the GNOME moduleset. If you cannot install those packages, you can use the boostrap command to build the minimal development environment required:
jhbuild bootstrap
- Now, do all the actual downloading, building, and installing of GNOME:
jhbuild build
- In order to build a single package with all the dependencies, you can specify its name; if you want to build GTK+ and its every dependency, for instance, you can use:
jhbuild build gtk+
Individual modules may break from time to time. If you are running jhbuild in a nightly cron job, and you want JHBuild to automatically skip the broken ones, you can set interact = False in .jhbuildrc or use the --no-interact command-line switch; also if you want broken modules not to cause dependencies to be skipped, you can set nopoison = True in .jhbuildrc.
Running the Code
Now that jhbuild has built your software, you will want to run it! There are several ways to do this. If you are working with a single program, the easiest way is to have jhbuild launch a shell that has all the necessary environment variables set. For instance, to run nautilus:
jhbuild build nautilus jhbuild shell which nautilus (should give "/opt/gnome2/bin/nautilus") nautilus
If you want to run an entire gnome desktop, you'll need define a jhbuild session and launch it from gdm (or, alternatively, you can launch your custom session from vnc.) You should create a dedicated user account for this, or your normal working desktop may become unstable. First, create a file called "/usr/bin/jhbuild-session", with this in it (and /etc/jhbuild.conf would be a link to your ~/.jhbuildrc):
#!/bin/sh exec jhbuild --file=/etc/jhbuild.conf run gnome-session
and make it executable
sudo chmod a+x /usr/bin/jhbuild-session
Then, as root, create a file called "/usr/share/xsessions/jhbuild.desktop", with this in it:
[Desktop Entry] Encoding=UTF-8 Name=Jhbuild GNOME Comment=This session logs you into Jhbuild GNOME Exec=/usr/bin/jhbuild-session Icon= Type=Application
Now, when you log in using gdm, "Jhbuild GNOME" should be listed as one of the choices.
For remote development, you can also use vnc. Modify your ~/.vnc/xstartup file like so:
#!/bin/sh [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & jhbuild-session & #gnome-session &
Examples of use
A guide for your distribution may be available at JhbuildDependencies
Usual problems/answers about building jhbuild modules are available at JhbuildIssues.
