Monday, April 15, 2013

Building evince with jhbuild under a fresh install of Ubuntu 12.04

In the last year or so, Jhbuild has received a lot of  love and know it is much easier to use (for the first time) than it used to, but how much? Since Google Summer of Code is coming, I wondered whether was easy for a person with no experience building GNOME to build Evince. It turns out it is not that trivial, although it is quite better than the first time I managed to compile Evince using jhbuild.  Since the Jhbuild manual seems to be still a little outdated, I publish here the steps I needed, on a fresh install of Ubuntu 12.04.

  1. Install all the things jhbuild won't install for you. 
    $sudo apt-get install build-essential
    $sudo apt-get install git
    $sudo apt-get install gettext xsltproc docbook-xml docbook-xsl
    $sudo apt-get install apt-file autopoint
  2. Install jhbuild from git (if you have previously installed from apt-get, use apt-get remove jhbuild to remove it)
    $git clone git://
    $cd jhbuild
    $make install
    $echo PATH=$PATH:~/.local/bin >> ~/.bashrc
  3. Prepare your first .jhbuildrc config file.
    $cp examples/sample.jhbuildrc ~/.jhbuildrc
  4. Edit ~/.jhbuildrc file
    • Search for the line starting with "prefix" and change the directory to a writable one (the default /opt/gnome is not writable by default on ubuntu it seems)
    • For evince, you need to add the following lines to ~/.jhbuildrc
      module_autogenargs['evince'] = autogenargs + ' --enable-debug --disable-nautilus' 
  5. Install dependencies using the new "sysdeps" command of jhbuild
    $jhbuild sysdeps --install
  6. Building evince
    $jhbuild build evince --ignore-suggests --nodeps
NOTE: For the time being, this will give you an error because jhbuild won't compile libsecret when compiling using --ignore-suggests. See this bug for more info. If it fails for you with a LIBSECRET not found error, then start a shell, do
$jhbuild buildone libsecret

and then resume the compilation of evince. If you want, you could do, at this stage
$jhbuild buildone evince
to trigger just the compilation of evince and NONE of its dependencies.
We use --ignore-suggests to ignore compiling a lot of modules that are not really important for developping with evince.
If everything goes right, you should have evince 3.8 compiled. If you want master, you need to choose the "gnome-suites-core-3.10" moduleset