JhBuildInstructions

Building modular X.org with ''jhbuild''

Introduction

These instructions assume that you're already familiar with jhbuild and how to use it. This page provides a module set to use with jhbuild and briefly how to use it.

Getting jhbuild

If you don't have jhbuild yet, its homepage is at: http://www.jamesh.id.au/software/jhbuild/ though the instructions are out of date. It can be fetched from svn and installed to your home directory by:

svn co svn://svn.gnome.org/svn/jhbuild/trunk jhbuild
cd jhbuild
./autogen.sh
make install

Our module set requires jhbuild from svn as of 2007-01-08 or so.

Module Set and jhbuild Config File

The moduleset for jhbuilding xorg is stored in git in the xorg/util/modular module. So, create a config file modular-jhbuildrc containing:

moduleset = 'http://gitweb.freedesktop.org/?p=xorg/util/modular.git;a=blob_plain;f=xorg.modules'
modules = [ 'xorg' ]
checkoutroot = os.path.expanduser('~/git')
prefix = os.path.expanduser('~/xorg')
autogenargs = ''
autogenargs = autogenargs + ' --disable-static'
autogenargs = autogenargs + ' --cache-file=' + checkoutroot + '/autoconf-cache'
# FreeBSD's expat is in /usr/local/
#autogenargs = autogenargs + ' --with-expat=/usr/local'
# lots of people really like to always look in /var/log, but change if
# you want the log files out of place
autogenargs = autogenargs + ' --with-log-dir=/var/log'
autogenargs = autogenargs + ' --with-mesa-source=' + checkoutroot + '/mesa'
os.environ['ACLOCAL'] = 'aclocal -I ' + prefix + '/share/aclocal/'
os.environ['INSTALL'] = os.path.expanduser('~/bin/install-check')

Building the Server, and Everything It Depends On

If we wanted to build everything, we would just issue the command:

jhbuild -f modular-jhbuildrc build

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 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 written by Kristian Høgsberg, and modified by EricAnholt. Wikified by JimGettys.