Developing GNOME Shell under JHBuild (radio edit)
Firstly install the following:
$ sudo yum install gettext m4 autoconf libtool automake pkg-config yelp-tools doc-tools yelp-devel
A lot more is needed but luckily it is possible to get instructions how to get hold of most of the dependencies needed (for various distributions) from https://wiki.gnome.org/JhbuildDependencies.
Next, download and install JHBuild:
$ git clone git://git.gnome.org/jhbuild $ cd jhbuild $ ./autogen.sh $ make $ make install
After that it is useful to know that it is possible to override the default settings found in ~/jhbuild/jhbuild/defaults.jhbuildrc in case it is necessary to optimise the build. If you want to just go straight for it, then it is useful to know that this file gets copied to ~/.local/lib/python2.7/site-packages/jhbuild/defaults.jhbuildrc when jhbuild is installed.
I left defaults.jhbuild to its own devices and created a file called ~/.jhbuildrc and the following code is the configuration I am using for my GNOME Shell JHBuilding.
# -*- mode: python -*- # # policy for modules to build, options are: # - all: build everything requested # - updated: build only modules that have changed # - updated-deps: build modules that have changed, or their dependencies # have changed. build_policy = 'updated' # moduleset settings: # To include wayland moduleset: # moduleset = [ 'gnome-suites-core-3.10', 'other/wayland' ] # to build with dependencies use: # moduleset = [ 'gnome-suites-core-3.10', 'gnome-suites-core-deps-3.10', 'gnome-apps-3.10' ] # to use core modules needed for gnome-shell development: moduleset = [ 'gnome-suites-core-3.10' ] modules = [ 'meta-gnome-core-shell' ] # what directory should the source be checked out to? checkoutroot = os.path.expanduser('~/gnome/source') # the prefix to configure/install modules to (must have write access) prefix = os.path.expanduser('~/gnome/install') interact = True # whether to interact with the user. quiet_mode = True # whether to display running commands output(Builds) progress_bar = True # whether to display a progress bar when running in quiet mode # Use system librariess for the builds if use_lib64: _libdir = 'lib64' else: _libdir = 'lib' addpath('PKG_CONFIG_PATH', os.path.join(os.sep, 'usr', _libdir, 'pkgconfig')) addpath('PKG_CONFIG_PATH', os.path.join(os.sep, 'usr', 'share', 'pkgconfig')) # Look in /usr/share for icons, D-BUS service files, etc addpath('XDG_DATA_DIRS', '/usr/share') # Look in /etc/xdg for system-global autostart files addpath('XDG_CONFIG_DIRS', '/etc/xdg') # further modifications (edit with caution) # override environment variables, command # autogenargs = '--disable-static' # cmakeargs = '' # makeargs = '' # cflags = '' # modules to skip during dependency expansion skip = ['Webkit'] module_autogenargs['NetworkManager']=' --disable-gtk-doc' module_autogenargs['cogl']=' --disable-tests --enable-wayland-egl-platform=no --enable-wayland-egl-server=no' module_autogenargs['clutter']=' --enable-installed-tests=no --enable-wayland-backend=no'
Mostly I used defaults.jhbuildrc and a custom example found in the gnome-shell module as a template to work with. There might be others to blame credit :-) for parts of it too, though.
The following command will install all the dependencies you will need so you have them before you build your module.
$ jhbuild sysdeps --install
Next build the module you want to work on along with all of its dependencies (in my case, the module is GNOME Shell):
$ jhbuild build gnome-shell
Once a module and its dependencies have been build successfully it's not necessary to rebuild every dependency all over again. So, in that case it is possible to use the command:
$ jhbuild buildone gnome-shell
Or for a forced clean, autogen.sh rerun and build:
$ jhbuild buildone -afc gnome-shell
Or for a forced clean, autogen.sh rerun and build without updating from the module's remote repository:
$ jhbuild buildone -nafc gnome-shell
Tricks with .jhbuildrc
I set quiet mode to 'True'. Mostly the terminal is not very interesting to watch for 70+ modules of building and I am not completely certain, but I think it slows things down to have quiet mode set to False (which is the default). If there are problems then it is possible to check the config.log file produced in the directory of the problem module or you can set quiet mode to 'False' and be entertained.
If you need to do a bunch of other stuff and do not want to be interacting with jhbuild then set interact to 'False' this means it will build all the modules it can and tell you at the end which modules broke during the build so you can try various things to fix them using the 'buildone' command on the more stubborn modules.
Generally before copying anything to .jhbuildrc t is worth having a look in ~/jhbuild/jhbuild/defaults.jhbuildrc, just to avoid repeating code that has been written in the default configuration already.
It is probably more worth checking the default moduleset you have called contains the right modules than the configuration though. It is possible to do this by opening them up in firefox to have a look. This is how I discovered that 'gnome-apps-3.10' does not actually contain GNOME Shell. Some autogen arguments have been preset for certain modules in the modulesets there as well,. JHBuild modulesets folder is in the ~/jhbuild/moduleset directory.
Tricks with .bashrc
Why not set up a terminal profile to run jhbuild shell? If you call it JHBuild (or something like that) it will be obvious to you whether you are running under JHBuild or not (without having to use the which command on a module) if you paste the following into your .bashrc.
if [ -n "$CERTIFIED_GNOMIE" ]; then PS1="[JHBuild@\W] " fi
That will work nicely (for the time being anyway). Open a new terminal window running jhbuild shell to see the change. Before doing that paste this into the .bashrc at the end as well:
export PATH=$PATH:$HOME/bin:$HOME/.local/bin
... And Finally: Running GNOME Shell Under JHBuild
To run gnome-shell in 'gnome-shell style' (this tip is courtesy of Jasper), go to the directory where gnome-shell was checked out by jhbuild:
$ cd /path/to/gnome-shell/build
Then execute like so:
$ jhbuild run ./src/gnome-shell --replace