JHbuild

Hello everyone :–). Today I am back to save you from the agony of reinstalling your operating system because your sourecode screwed up your operating system’s dependencies.

hail JHBUILD

JHbuild is a tool that allows you to install programs/modules at a saperate prefix other than the systems default prefix. JHBuild uses “module set” files to describe the modules available to build. The “module set” files include dependency information that allows JHBuild to discover what modules need to be built and in what order.

You might be thinking “Whats so special about that, there are a lot of other programs that does the same thing”, well…

JHBuild can build modules from a variety of sources, including CVS, Subversion, Bazaar, Darcs, Git and Mercurial repositories, as well as Tar and Zip archives hosted on web or FTP sites. JHBuild can build modules using a variety of build systems, including Autotools, CMake, WAF, Python Distutils and Perl Makefiles. If you are a gnome-developer, JHbuild is a must have!

Here is how to get started with JHbuild.

  • Install jhbuild using the command sudo apt-get install jhbuild or from the source.
  • Configure the jhbuildrc present in ~/.config folder.
    • change the checkout root to any directory of your choice, this is where the source code of the dependencies will be downloaded.
    • change the prefix to /opt/gnome. This is where your dependencies will be installed (this can be any directory of your choice too).
    • Change the moduleset to gnome-world-3.10, the latest gnome moduleset.
    • If you are using a proxy server, you might want to use https to download from a git repo rather than ssh, since JHbuild uses ssh by default, adding repos['git.gnome.org'] = 'http://git.gnome.org/browse/' to your jhbuildrc will allow JHbuild to download using https rather than ssh. The same holds true for other git repositories as well.
    • Add ignore_suggests = True which will ignore installing many unwanted dependencies, making the building process a lot faster.
  • Once you are done with configuring JHbuild, install the additional dependencies required for building with jhbuild specific to your distribution from here
  • jhbuild sanitycheck to check if everything is in the right place.
  • jhbuild sysdeps --install to install missing system dependencies( you need apt-file to install the missing dependencies )
  • you now have a working installation of JHbuild. To start jhbuild run jhbuild bootstrap. This will download the necessary tools for building the source code(autotools, gettext et al).
  • voila! you can now build any package from scratch with all its dependencies with the command jhbuild build 'package name'.
  • At any point of time if you are stuck with any package the following menu will be shown.
1
2
3
4
5
6
7
8
9
10
[1] Rerun phase build
    [2] Ignore error and continue to install
    [3] Give up on module
    [4] Start shell
    [5] Reload configuration
    [6] Go to phase "wipe directory and start over"
    [7] Go to phase "configure"
    [8] Go to phase "clean"
    [9] Go to phase "distclean"
    choice:

Just start the shell and installed the required dependency using apt-get or jhbuild and exit the shell with exit command, the building will continue.

Until next time

Flying is learning how to throw yourself at the ground and miss.

Douglas Adams The Hichhikers Guide to the Galaxy

Comments