I am not going to write a full guide for how to install GNOME with JHBuild by just giving some commands, instead I will explain some basic points and then you can check on the official documentation before you start building. So this is just a quick intro and doesn’t explain all possibilities of JHBuild tool.
What JHBuild is?
JHBuild is a small application/tool, that helps us to install software from sources by setting a sandboxed environment. It also handles every dependency of the software we want to build by downloading it, configuring it, building it and installing it.
JHBuild is part of freedesktop.org and started for GNOME, but today many applications provide JHBuild modulesets. In this tutorial we just get bother only with building GNOME.
Will JHBuild break my system?
Absolute no! JHBuild will use an isolated from the rest of your system installation similar to NPM and RVM. However it can mess up with your Apps configuration files. For example if you build Gimp with JHBuild and you have also Gimp distributor package, both installation will use the same configs.
You can easily avoid that, by using a different account just for running latest GNOME.
How much time will take to build GNOME?
It depends from your connections and your system! A typical installation (in my case) includes Gnome-Shell, Gnome-Control-Center, Empathy and Gnome Themes ..plus all their dependencies. That means downloading and building around 120 packages from GIT. With my ~7Mbps connection and and an Intel Ivy Bridge i5, it takes approximately 3-4hours and it uses around 6-7GB of space.
However there is not need to staring at it, right? Updating is much faster.
How to install JHBuild
Just clone it from GNOME Git.
$ git clone git://git.gnome.org/jhbuild
Then building it
$ cd jhbuild $ ./autogen.sh $ make $ make install
<jhbuild> should now be in your path. Test with:
$ jhbuild -h
Note: Never run <jhbuild> with root permissions. Always update jhbuild before you going to update GNOME. JHBuild is an extremely active module and everyday developers commit changes to it, that solve dependencies issues and bugs. To update:
$ cd jhbuild $ git pull $ ./autogen.sh $ make $ make install
After installing JHBuild check if everything is ok:
$ jhbuild sanitycheck
That doesn’t guarantee that will find all possible problems, but the most common ones. If everything is okay, it shouldn’t output anything.
Before you build jhbuild you need to install some packages from distributor sources.
- Python >= 2.0 with expat support (jhbuild needs the Python XML modules).
- autoconf 2.5x
- automake 1.4-p6, 1.7.x, 1.8.x and 1.9.x (these are parallel installable).
- libtool >= 1.5
- gettext >= 0.10.40
Since we are going to build GNOME lets install all the necessary tools.
For Fedora 18 run:
$ sudo yum install @development-tools @gnome-software-development libtasn1-tools systemd-devel cups-devel cmake opencc-devel tracker-devel
For other distros check:
After installing these it is important also to run:
$ jhbuild sysdeps --install
That will install any other dependency you might have missed. It will take some time and won’t output anything for a while, just let it running till finishes :)
Although the above should cover all the dependencies, they don’t, at least in Fedora example. Unfortunately I can’t recall the missing dependencies, but this isn’t a big issue anyway. When you try to build a GNOME package you will receive an error jhbuild will output these options:
 Rerun phase build  Ignore error and continue to install  Give up on module  Start shell  Reload configuration  Go to phase "wipe directory and start over"  Go to phase "configure"  Go to phase "clean"  Go to phase "distclean" choice:
If you carefully check the bash output you will track the missing dependencies by a <Package not found> or a similar error. Then open a new terminal tab, install the missing package and re-run <configure> by picking choice 7.
In some cases when you have already installed a GNOME package and you can’t update it, <Go to phase “wipe directory and start over”> can solve the issue. In general you won’t have troubles to solve any problem a least for the common GNOME modules, like Shell. If you got stuck with something you can check on jhbuild issues or don’t hesitate to ask in the Forums, as many people using jhbuild there and can help you.
..you should have jhbuild installed plus all the dependencies you need to start building GNOME. One more step is to setup the jhbuild configuration file. Keep on mind that jhbuild needs to locations for installing GNOME, Checkout and GNOME Installation Path < JHBUILD_PREFIX=/opt/gnome and JHBUILD_LIBDIR=/opt/gnome/lib64 >.
- Checkout: Is the place where jhbuild downloads and builds your packages. By default “~/checkout”.
- GNOME Installation Path: Is the place that JHBuild actually deploys your isolated GNOME installation. By default “/opt/gnome/”.
You can change these folders, but you should keep GNOME Installation under your “/opt/”. If you install it under “/usr/” you might break your system.
JHBuild when it needs something (a lib or a package) will check firstly inside JHBUILD_PREFIX and JHBUILD_LIBDIR, and if won’t find it there, will check in “/usr/. That means that in a GNOME 3.8 jhbuild installation will be able to run GNOME 3.6 Apps, and vice verca.
We can use the defaults, but we better hack this a bit. First we copy the sample jhbuildrc to our ~/.config/jhbuildrc
$ cd jhbuild $ cp examples/sample.jhbuildrc ~/.config/jhbuildrc
Jhbuirdrc looks like:
# -*- mode: python -*- # -*- coding: utf-8 -*- # edit this file to match your settings and copy it to ~/.config/jhbuildrc # if you have a GNOME git account, uncomment this line # repos['git.gnome.org'] = 'ssh://email@example.com/git/' # what module set should be used. The default can be found in # jhbuild/defaults.jhbuildrc, but can be any file in the modulesets directory # or a URL of a module set file on a web server. # moduleset = 'gnome-apps-3.4' # # A list of the modules to build. Defaults to the GNOME core and tested apps. # modules = [ 'meta-gnome-core', 'meta-gnome-apps-tested' ] # Or to build the old GNOME 2.32: # moduleset = 'gnome2/gnome-2.32' # modules = ['meta-gnome-desktop'] # what directory should the source be checked out to? checkoutroot = '~/checkout/gnome' # the prefix to configure/install modules to (must have write access) prefix = '/opt/gnome' # custom CFLAGS / environment pieces for the build # os.environ['CFLAGS'] = '-Wall -g -O0' # extra arguments to pass to all autogen.sh scripts # to speed up builds of GNOME, try '--disable-static --disable-gtk-doc' #autogenargs='' # A string listing additional arguments to be passed to make. # Set makeargs to 'V=1' for verbose build output. #makeargs = ''
Here you might want to change your <checkoutrout> path . Also is better to add
autogenargs = '--disable-static --disable-gtk-doc'
that will save you a great amount of time. Another useful variable is that will skip the modules that you don’t want to build. For example:
skip = 'WebKit'
WebKit takes like 2h to get built. If you want to skip more than one, you should use an array.
skip = ['WebKit', 'evolution']
You can also set various modulessets and modules but we won’t use this at the moment, as the default includes the upstream GNOME. In short:
- moduleset: the collection of modules containing the modules to be built.
- modules: a list of the modules to build.
- skip: a list of modules to skip. Useful if you want to use the system version of some modules
We are now almost ready to star building GNOME. One last step is to create our JHBUILD Prefix. Assuming that you are using the default “/opt/gnome/”, first create the directory
$ sudo mkdir /opt/gnome
and then change the ownership so your user have write access to that directory.
sudo chown your-username /opt/gnome/ sudo chgrp your-username /opt/gnome/
Now we are ready to start building GNOME and of course we will start from GNOME Shell
$ jhbuild build gnome-shell
After that finish, just run it!
$ jhbuild run gnome-shell -r
That was all! To have a more completed environment you might want also build
$ jhbuild build gnome-shell gnome-control-center empathy nautilus gnome-themes-standard gnome-icon-theme gnome-icon-theme-extras gnome-icon-theme-symbolic
You might want to run a singe module (ie Calendar) without loading the whole 3.8 session.
$ jhbuild run gnome-calendar
You can also fire the “jhbuild shell”
That will set your environment to your $JHBUILD_PREFIX
It should now point at your “/opt/gnome/bin/gnome-shell” and not to “/usr/bin/gnome-shell”
If you set your modulesets and modules in jhburdrc you can just run
$ jhbuild build
and that will update and build all the modules that are specified in jhbuildrc. If you want to update but don’t build, you can use:
$ jhbuild update
After you have update all your packages you can build without using network, with “-n”:
$ jhbuild build gnome-shell -n (--no-network)
A very handy command is <buildone> that will build a module without its dependencies, Assuming that dependencies already exist that will save you time. Also some modules like <gnome-music> isn’t accessible via <jhbuild build gnome-music> so you can use this:
$jhbuild buildone gnome-music
JHBuild also offers a GUI which isn’t very convenient to use, but if you want to try it:
Setting jhbuild in GDM Session and more
First of all, by getting an upstream GNOME don’t expect to be fully functional, you are getting software that is not even tested. Therefore if you are not nuts enough (!!) is better to install JHBuild in another account, like gnomenext.
This was just a quickly intro for using JHBuild, please if you are going to use JHBuild read the official and full documentation (which isn’t big either), as I have skipped many important points for making a better use of jhbuild. The point is that is quite easy and you can try this instead of using unstable packages from testing repos that will eventually break your box.
Also, here is your chance to contribute to GNOME by submitting some bugs :)
You wont need much :)
It is a 4 steps process:
1. Installing dependencies
2. Installing jhbuild
3. Edit jhbuild configuration file
4. Install Gnome Modules
Enjoy GNOME 3.8 :)
*You will find all GNOME modules in http://git.gnome.org/browse/ and then you can just start building the one you are interested on.
jhbuild build gnome-boxes gnome-documents gnome-contacts gimp etc