JHBuild and GNOME

This section provides guidance on building, installing and running GNOME.

3.1. Building GNOME

To build GNOME some development packages are required. This includes:

  • DocBook XML DTD and XSLT stylesheets. These need to be registered in the XML catalog (/etc/xml/catalog).

  • X libraries

  • libsmbclient from Samba (used for browsing Windows networks).

  • libbz2 from bzip2.

  • libpng, libjpeg and libtiff (used for image loading).

If installing distribution packages, and if applicable for your distribution, install the corresponding “dev” or “devel” packages. A list of package names for different distributions is maintained on the GNOME wiki.

3.2. Running a Single GNOME Application

This section details how to run a single GNOME application. The application will run within the current desktop environment. To run the application within the complete JHBuild GNOME see Ενότητα 3.3 ― Running the GNOME Desktop Environment.

Launch a JHBuild shell. The JHBuild shell has all the necessary environment variables set.

$jhbuild shell

Verify the correct application will be run. For example:

$which gedit
/opt/gnome/bin/gedit

Run the application:

$gedit &

Alternatively, run the application using the run command:

$jhbuild run gedit

3.3. Running the GNOME Desktop Environment

Create a new user account to run the JHBuild GNOME. Running JHBuild GNOME using different user account is recommended to avoid problems caused by user settings stored in the home directory. This manual refers to the new account as gnomedev.

Setup JHBuild on the new gnomedev account. Copy or soft-link ~/.jhbuildrc and ~/.local/bin/jhbuild to gnomedev home directory.

Open a terminal as the user gnomedev. Permanently add ~/.local/bin to the PATH variable, run the following command:

$ echo PATH=$PATH:~/.local/bin >> ~/.bashrc

Test JHBuild works:

$ jhbuild run pkg-config gtk+-2.0 --modversion
2.20.1

There are two different methods to run JHBuild GNOME:

  1. Nested window (recommended).
  2. Display manager.

3.3.1. Setup GNOME to run in a nested window

Build and install JHBuild GNOME.

Install the Xephyr application. On Fedora the system package is called xorg-x11-server-Xephyr, on Ubuntu and Debian the system package is called xserver-xephyr.

Test Xephyr works:

$Xephyr -ac -screen 800x600 :1 2> /dev/null &

If successful, a window with black background will be displayed. Close the Xephyr window.

Enable system services. JHBuild GNOME will use the /usr/bin system D-Bus daemon and the system services within /usr/share/dbus-1/system-services/. JHBuild GNOME will use the JHBuild session D-Bus daemon and the services within /opt/gnome/share/dbus-1/services/. Replace /opt/gnome with GNOME install prefix in the command below:

$rm -rf /opt/gnome/var/run/dbus
$ln -s /var/run/dbus /opt/gnome/var/run/dbus
$rm -rf /opt/gnome/var/lib/dbus/machine-id
$ln -s /var/lib/dbus/machine-id /opt/gnome/var/lib/dbus/machine-id

Create a GNOME startup script at ~/.local/bin/gnome-jhbuild-xephyr-session with the following, replacing /opt/gnome with GNOME install prefix:

#!/bin/sh

GNOME=/opt/gnome
 
GDK_USE_XFT=1
XDG_DATA_DIRS=$XDG_DATA_DIRS:$GNOME/share
XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:$GNOME/etc/xdg

jhbuild run gnome-session

Make the file ~/.local/bin/gnome-jhbuild-xephyr-session executable:

$chmod u+x ~/.local/bin/gnome-jhbuild-xephyr-session

3.3.2. Running GNOME in a nested window

Open a terminal as the user gnomedev.

Run Xephyr:

#Xephyr -ac -screen 800x600 :1 2> /dev/null &

Set the DISPLAY environment variable:

#export DISPLAY=:1

Start GNOME:

#gnome-jhbuild-xephyr-session

If successful, JHBuild GNOME will be displayed in Xephyr window. If unsuccessful, check the output of the terminal window.

3.3.3. Setup GNOME to run from the display manager

Build and install JHBuild GNOME.

Enable system services. JHBuild GNOME will use the /usr/bin system D-Bus daemon and the system services within /usr/share/dbus-1/system-services/. JHBuild GNOME will use the JHBuild session D-Bus daemon and the services within /opt/gnome/share/dbus-1/services/. Replace /opt/gnome with GNOME install prefix in the command below:

$rm -rf /opt/gnome/var/run/dbus
$ln -s /var/run/dbus /opt/gnome/var/run/dbus
$rm -rf /opt/gnome/var/lib/dbus/machine-id
$ln -s /var/lib/dbus/machine-id /opt/gnome/var/lib/dbus/machine-id

Create a GNOME startup script at /usr/bin/gnome-jhbuild-session with the following, replacing /opt/gnome with GNOME install prefix:

#!/bin/sh

GNOME=/opt/gnome
 
GDK_USE_XFT=1
XDG_DATA_DIRS=$XDG_DATA_DIRS:$GNOME/share
XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:$GNOME/etc/xdg

jhbuild run gnome-session

Make the file /usr/bin/gnome-jhbuild-session executable:

$chmod a+x /usr/bin/gnome-jhbuild-session

To add a new session entry in the display manager, create /usr/share/xsessions/gnome-jhbuild.desktop and enter:

[Desktop Entry]
Name=GNOME (JHBuild)
Comment=This session logs you into GNOME testing session
TryExec=/usr/bin/gnome-jhbuild-session
Exec=/usr/bin/gnome-jhbuild-session
Icon=
Type=Application

Restart gdm.

3.3.4. Running GNOME from the display manager

To run the JHBuild GNOME, select the GNOME (JHBuild) session at the display manager before entering gnomedev login credentials. If successful, JHBuild GNOME will be displayed. If unsuccessful, check the log within the ~gnomedev/.xsession-errors file.