Difference between revisions of "JHBuild"

From ArchWiki
Jump to: navigation, search
(Troubleshooting: This was fixed)
(Other broken modules)
Line 127: Line 127:
* devhelp—[https://bugzilla.gnome.org/show_bug.cgi?id=707107 bug report]
* devhelp—[https://bugzilla.gnome.org/show_bug.cgi?id=707107 bug report]
* ibus-pinyin
* ibus-pinyin
* xwayland
* aisleriot—[https://bugzilla.gnome.org/show_bug.cgi?id=707106 bug report] (probably easy to fix if you poke around)
* aisleriot—[https://bugzilla.gnome.org/show_bug.cgi?id=707106 bug report] (probably easy to fix if you poke around)

Revision as of 17:19, 30 August 2013

JHBuild is a tool that allows you to automatically download and compile "modules" (i.e. source code packages). It can pull modules from a variety of sources (CVS, Subversion, Git, Bazaar, tarballs...) and handle dependencies. You can also choose which specific modules you want to build, instead of building the whole project.

JHBuild was originally written for building GNOME, but has since been extended to be usable with other projects.


JHBuild is available in the Arch User Repository. Install either jhbuildAUR or jhbuild-gitAUR, the development version.


The configuration file for JHBuild is ~/.jhbuildrc. It uses Python syntax to set configuration variables. Here is the sample file provided for building GNOME:

# -*- mode: python -*-
# -*- coding: utf-8 -*-

# edit this file to match your settings and copy it to ~/.jhbuildrc

# if you have a GNOME git account, uncomment this line
# repos['git.gnome.org'] = 'ssh://user@git.gnome.org/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.2'
# 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 = os.path.expanduser('~/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'

# On multiprocessor systems setting makeargs to '-j2' may improve compilation
# time. Be aware that not all modules compile correctly with '-j2'.
# Set makeargs to 'V=1' for verbose build output.
#makeargs = '-j2'

You should edit at least modules to the desired modules to be built. A reference for most configuration variables is available at GNOME JHBuild Manual.


Installing Prerequisites

JHBuild can check if the required tools are installed by running sanitycheck:

$ jhbuild sanitycheck

If any errors are shown, missing packages may be installed from repositories or running the bootstrap command, which tries to download, build and install the build prerequisites:

$ jhbuild bootstrap


To build all the modules selected in the configuration file, just run the build command:

$ jhbuild build

JHBuild will download, configure, compile and install each of the modules.

If an error occurs at any stage, JHBuild will present a menu asking what to do. The choices include dropping to a shell to fix the error, rerunning the build from various stages, giving up on the module, or ignore the error and continue. Often, dropping to a shell and checking makefiles and configuration files can be helpful. If you face a build error, for example, you can try to manually make and check errors on the shell.

Giving up on a module will cause any modules depending on it to fail.


Python issues

"error: Python interpreter is too old"

You may get the following error when building various modules:

checking for Python 3 availability.... checking whether /usr/bin/python2 version is >= 3.2.0... no
configure: error: Python interpreter is too old

To work around this issue, choose [4] Start shell. Then, find the autogen.sh command, which should look something like

Running ./configure --enable-maintainer-mode --prefix /home/kerrick/.jhbuild/install --libdir /home/kerrick/.jhbuild/install/lib64 --enable-python3 --disable-static --disable-gtk-doc PYTHON=/usr/bin/python2 ...

Run this autogen.sh command, but remove the PYTHON=/usr/bin/python2 portion. Then, exit the shell, and choose [2] Ignore error and continue to build.

Building from scratch without JHBuild, or in a JHBuild shell

If you are building from scratch on your own, it may be necessary to run autogen.sh with the following:

PYTHON=/usr/bin/python2 ./autogen.sh

The shebang line in ~/.local/bin/jhbuild may need to be updated to:


You may need to switch the symlink "/usr/bin/python" to point to python2.7 to get "jhbuild build" to run correctly. The folks in #gnome-shell on irc.gnome.org will help in any way they can.

pkg-config issues

If you have a malformatted .pc file on your PKG_CONFIG_PATH, JHBuild won't be able to detect all the (valid) .pc files you have installed and will complain that the .pc files are missing. Look at the output of jhbuild sysdeps—there should be a message about the problematic .pc files.

libquvi configure fails

Choose [4] Start shell and run

git checkout next

then choose [7] Go to phase "configure".

libquvi-scripts configure fails

Choose [4] Start shell and run

git checkout next

Then, copy the configure command line from the terminal scrollback and run it (it starts with ./bootstrap.sh && ./configure). Then, exit the shell and choose [2] Ignore error and continue to build.

totem doesn't build

Choose [4] Start shell and run

curl https://git.gnome.org/browse/totem/patch/?id=198d7f251e7816f837378fb2081829188847b916 | git apply

Then, exit the shell and choose [1] Rerun phase build.

evolution doesn't build

Choose [4] Start shell and run

curl https://bug707112.bugzilla-attachments.gnome.org/attachment.cgi?id=253584 | git apply

Then, exit the shell and choose [1] Rerun phase build. See this bug for further details.

Other broken modules

The following modules don't build, and there are no known fixes:

  • devhelp—bug report
  • ibus-pinyin
  • xwayland
  • aisleriot—bug report (probably easy to fix if you poke around)

External links

GNOME JHBuild Manual