You Got A Question? Ask    GNOME Community!

gtk-theme2
 10754   |  Oct 25
gtk_logo2
 9358   |  Mar 17
arch
 7504   |  Mar 28

How to easily install the very latest GNOME in any Distro with JHBuild

This post was made with an older stylesheet


Intro

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.


JHBuild Prerequisites

Before you build jhbuild you need to install some packages from distributor sources.

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 :)


More dependencies

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:

[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:

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.


So far..

..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.


JHBuild Configuration

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://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.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/

Building 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”

jhbuild shell

That will set your environment to your $JHBUILD_PREFIX

which gnome-shell

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:

$jhbuild gui

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.

jhbuild-gdmThis 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 :)


Links

You wont need much :)

https://live.gnome.org/Jhbuild &
https://live.gnome.org/GnomeShell#building &
http://freedesktop.org/wiki/Software/jhbuild

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

 


 
  We can't watch comments unless G+ provides an API or if you send a notification, e.g +World Of Gnome
     Sometimes is better to place your questions on GNOME Community
  • Significan Me

    I hope more people will test dev versions, so we can all get gnome better.

    • alex285

      Testing is always the most tricky development cycle :)

  • Carlos Soriano

    Hi Alex,
    Good work with the jhbuild explanation =)
    But some points:
    1- Even more easy https://live.gnome.org/GnomeShell#building
    2-The default path is /opt but you can not run jhbuild with root, so you have to change the path. I think. The previous script put the installation in your home.
    3-The dependencies for Fedora 18 is not completed. They change along the development cycle and until now the dependencies you posted is only for the minimal installaton. Maybe can you put a warning here? =)

    See you!

    • alex285

      Hello!
      2 I just give permissions to the user to /opt/gnome with chown and chgrp. WP just deleted the “user-name” I re-added it.

  • श्री ऋजु

    fedora 18 i686 here,
    jhbuild build gnome-shell first needs “jhbuild build polkit”

    jhbuild build telepathy-glib fails :(

    jhbuild should more efficiently manage the dependencies.

    many thanks for ‘skip webkit and gtk doc’ it was draining my life away :)

  • श्री ऋजु

    Thanks Alex,

    Just compiled and installed Gnome Shell, gnome control center, nautilus; I must say that gnome 3.8′s (3.7.3′s) 3d performance is many many times better than gnome shell 3.6.3. Really love it! Thank you really!

  • Bruno Melo

    update dependencies for Debian Wheezy

  • Joern Konopka

    Just wondering, shouldn’t the part about creating a separate User Account be the first step?

  • hashem

    This sentence is odd and grammatically incorrect: “Keep on mind that jhbuild needs to locations for installing GNOME, Checkout and GNOME Installation Path .”

  • 2eurocents

    Just make an ISO for crying out loud. Or be satisfied with having about six people testing the thing.

    • hashem

      GNOME does have an iso for the latest stable version: http://www.gnome.org/getting-gnome/
      Do you think an unstable version would be used enough to warrant the effort in making it?

  • Pingback: Links 28/12/2012: Enlightenment 0.17, Qt 5.0 | Techrights

  • MatusT

    I am trying to build gnome shell using jhbuild on Ubuntu 12.10 . But it fails at at-spi2-core. It says No package ‘dbus-1′ found but of course dbus is installed. Do you know solution to this problem?

    • alex285

      I am sorry I don’t having Ubuntu, can you please send this is gnome-shell mailing list?

    • hashem

      Run “locate dbus-1 | grep pc” in terminal.

      Update your ~/.config/jhbuildrc with that location.

      For example: I get: /usr/lib/x86_64-linux-gnu/pkgconfig/dbus-1.pc

      Thus I add this to the end of my .config/jhbuildrc:

      addpath(‘PKG_CONFIG_PATH’, ‘/usr/lib/x86_64/pkgconfig’)

  • Pingback: Links 30/12/2012: PulseAudio 3.0, GNOME Adds Privacy | Techrights

  • hashem

    I just updated the GNOME wiki with some information on building. Check this link out to resolve any issues, and be sure to add any new ones you encounter: https://live.gnome.org/JhbuildIssues

  • http://www.facebook.com/fslurrehman Faisal Rehman

    Hi – I compiled successfully the gnome-shell excluding webkit and evolution on debian cut. But problem is that I cannot compile webkit.
    I get following error while compiling webit with jhbuild. Kindly review and help me out to compile webkit. (libsoup is already installed.)

    ./.libs/libwebkitgtk-3.0.so: undefined reference to `soup_cookie_jar_is_persistent’
    ./.libs/libwebkitgtk-3.0.so: undefined reference to `soup_cookie_jar_add_cookie_with_first_party’
    ./.libs/libwebkitgtk-3.0.so: undefined reference to `soup_cookie_jar_get_cookie_list’
    /opt/gnome/lib64/libgstreamer-1.0.so.0: undefined reference to `g_thread_get_type’

    • alex285

      I am not aware of this issue, but you can try
      $ jhbuild sysdeps –install
      $ jhbuild bootstrap
      $ jhbuild sanitycheck
      $ jhbuild build libsoup

      If that don’t work check on https://live.gnome.org/JhbuildIssues for some further help. I am reading many issues with jhbuild and debian.

      • http://www.facebook.com/fslurrehman Faisal Rehman

        I had tried those commands before commenting here except last one which I tried as well.

        After checking some related bugs (like: https://bugs.webkit.org/show_bug.cgi?id=90332), I think the problem is with
        minor version of libsoup. But I cannot figure it out.

        • alex285

          Try maybe to config your PKG_CONFIG_PATH https://live.gnome.org/JhbuildDependencies/Debian but I doubt that is the reason.

          • http://www.facebook.com/fslurrehman Faisal Rehman

            I tried my best and used every option that I could but could not build webkit with jhbuild. I changed my pkg_config in jhbuildrc to following but got more or less the same error as I listed above.
            addpath(‘PKG_CONFIG_PATH’, ‘/home/faisal/opt/gnome/lib64/pkgconfig’)
            addpath(‘PKG_CONFIG_PATH’, ‘/usr/local/lib/pkgconfig’)
            addpath(‘PKG_CONFIG_PATH’, ‘/usr/lib/pkgconfig’)
            addpath(‘PKG_CONFIG_PATH’, ‘/usr/lib/x86_64-linux-gnu/pkgconfig’)
            addpath(‘PKG_CONFIG_PATH’, ‘/usr/share/pkgconfig’)

            The only option that worked for me is configure, make and make install.

            I set the path for ld and pkg_config:
            $ export LD_LIBRARY_PATH=/home/faisal/opt/gnome/lib64
            $ export PKG_CONFIG_PATH=/home/faisal/opt/gnome/lib64/pkgconfig

            verfied it by:
            $ echo $PKG_CONFIG_PATH
            $ echo $LD_LIBRARY_PATH

            changed the directory to webkit folder which was downloaded and extracted by jhbuild.
            $ cd ~/checkout/gnome/webkitgtk-1.11.4

            configured with same options as used by jhbuild (from config.log):
            $ ./configure –prefix=/opt/gnome –libdir=/opt/gnome/lib64 –enable-introspection –disable-silent-rules –with-gstreamer=1.0 –disable-static –disable-gtk-doc

            then make:
            $ make
            $ make install

            then installed epiphany. This is what I was interested in:
            $ jhbhild buildone epiphany
            (dependencies of epiphany was already installed with ‘jhbuild build epiphany’ but it couldn’t installed webkit)

          • alex285

            I had done the same in another package, but WebKit was working fine in my installation. I tried it after 1-2 days you post it this. I am glad you find a solution!

  • sindhus

    Hi! I think it’s a typo when you say “Will Jhbuild brake my system?”. The spelling should be “break”?

    Also how does one make a GDM login entry to the jhbuilt gnome-shell? Thanks! :)

    • alex285

      Thanks for the typo correction, it was kinda embarrassing!

      You should follow the jhbuild notes on gnome wikis. It has detailed instructions and they have updated lots of things since then. That post was around a yea ago!