JhBuildInstructions

Building modular X.org with ''jhbuild''

Introduction

This page provides brief instructions on using jhbuild, a Python-based build tool, to build modular X.Org. jhbuild was written to build GNOME from source, but has been adapted to many other projects.

Prerequisites

Building jhbuild

git clone git://git.gnome.org/jhbuild
cd jhbuild
./autogen.sh
make
make install
cp sample.jhbuildrc ~/.jhbuildrc

(On FreeBSD, do gmake && gmake install .)

The jhbuild executable is installed to ~/.local/bin/jhbuild. You will need to either symlink to it, use the full path or add it to your $PATH.

Module Set and jhbuild Config File

The moduleset for jhbuilding xorg and an example jhbuildrc are stored in git in the xorg/util/modular repository.

Building the Server, and Everything It Depends On

To build everything, you can do:

mkdir -p $HOME/xorg/util
git clone git://anongit.freedesktop.org/git/xorg/util/modular/ $HOME/xorg/util/modular
jhbuild -f $HOME/xorg/util/modular/jhbuildrc

But often you would just want to build the X server and key drivers to enable support of your latest shiny hardware, without replacing all of your X libraries and utilities. In this case, you can build specific targets rather than everything.

You will need a minimal number of drivers as well as the server; rather than executing separate jhbuild commands, you can issue a single one listing all the targets you want to build. The input drivers for PS/2 keyboards and mice are: xf86-input-keyboard and xf86-input-mouse.

To build the server and dependencies, along with these drivers, you would type:

jhbuild -f $HOME/xorg/util/modular/jhbuildrc build xserver xf86-video-intel xf86-input-keyboard xf86-input-mouse

Other interesting targets include xorg-drivers which builds all maintained X.org drivers.

Note: rather than building the target xorg-fonts, which will build you an entire additional set of fonts, you may want to make a link in your $prefix area to link to your existing fonts. Unless you have built your X server with --enable-builtin-fonts it will need to access some fonts to start, even though few applications need legacy bitmap fonts anymore.

cd $prefix/lib/X11; ln -s /usr/share/fonts/X11 fonts

Other drivers you may need include the synaptics driver and/or wacom drivers, currently maintained elsewhere (fixme...).

DRM and Kernel Modules

The X server is finally using a device driver on many systems (e.g. Linux, BSD); this is called DRM. It consists of two parts, the generic DRM module and a driver specific to your hardware. Currently, the kernel modules are not built automatically by jhbuild; you can find them in drm/linux-core or drm/bsd-core. To build the drm driver,

make -C linux-core

You may want to install these where you will be able to use them from your /etc/modules file.

Building Other Modules

Other buildable modules include the applications (e.g. xbiff) and the libraries (e.g. libXfixes), plus there a couple of meta modules; xorg-libs will build all libs and xorg-apps will build all apps.

Running The Results

Now that your development environment is set up, you can try running it (as root).

rmmod i915 # assuming you're using Intel
rmmod drm
insmod <path_to_drm_tree_above>/linux-core/drm.ko
insmod <path_to_drm_tree_above>/linux-core/i915.ko
export LD_LIBRARY_PATH=$prefix/lib
startx -- $prefix/bin/Xorg -verbose # make sure you have a ~/.xinitrc with what you want to run

And there you have it, a fresh stack ready for tracking & doing upstream development. Enjoy!

This page and the modules file for the build were originally written by Kristian Høgsberg, and modified by EricAnholt. Wikified by JimGettys.

Hiccups

JhBuildInstructions (last edited 2010-11-13 18:14:35 by home)