JHBuild と GNOME

このセクションは、GNOME のビルド、インストール、および実行に関するガイダンスです。

3.1. GNOME のビルド

GNOME をビルドするには、以下に示すいくつかの開発用パッケージが必要となります。

  • DocBook XML DTD と XSLT スタイルシート。これらは、XML カタログ (/etc/xml/catalog) に登録する必要があります。

  • X libraries.

  • Samba の libsmbclient (Windows ネットワークのブラウジングに使用)。

  • bzip2 の libbz2

  • libpnglibjpeg、および libtiff (イメージのロードに使用)。

ディストリビューションのパッケージをインストールする場合、お使いのディストリビューションに適用できるなら、対応する “dev”、または “devel” パッケージをインストールしてください。さまざまなディストリビューション用のパッケージ名の一覧が GNOME wiki でメンテナンスされています。

3.2. 単独の GNOME アプリケーションの実行

ここでは、単独の GNOME アプリケーションを実行する方法について説明します。アプリケーションを現在のデスクトップ環境で実行します。アプリケーションを JHBuild で構築した GNOME で実行する方法については、セクション 3.3 - GNOME デスクトップ環境の起動 を参照してください。

JHBuild のシェルを起動します。JHBuild のシェルには、必要となるすべての環境変数が設定されています。

$ jhbuild shell

実行するアプリケーションが正しいことを確認します。たとえば、次のコマンドで確認します。

$ which gedit
/home/wanda/jhbuild/install/bin/gedit

アプリケーションを実行します。

$ gedit &

あるいは、run コマンドでアプリケーションを実行することもできます。

$ jhbuild run gedit

3.3. GNOME デスクトップ環境の起動

Create a new user account to run the JHBuild GNOME. Running JHBuild GNOME using a 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.

新しく作成した gnomedev アカウントの JHBuild 環境をセットアップします。gnomedev のホームディレクトリに、~/.config/jhbuildrc~/.local/bin/jhbuild をコピーするか、ソフトリンクを作成します。

gnomedev ユーザーで端末を開きます。以下のコマンドにより、PATH 変数に ~/.local/bin を追加します。

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

JHBuild が動作することを確認します。

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

3.3.1. GNOME をディスプレイマネージャーから起動するためのセットアップ

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 ~/jhbuild/install//share/dbus-1/services/. Replace ~/jhbuild/install with GNOME install prefix in the command below:

$ rm -rf ~/jhbuild/install/var/run/dbus
$ ln -s /var/run/dbus ~/jhbuild/install/var/run/dbus
$ rm -rf ~/jhbuild/install/var/lib/dbus/machine-id
$ ln -s /var/lib/dbus/machine-id ~/jhbuild/install/var/lib/dbus/machine-id

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

#!/bin/sh

GNOME=~/jhbuild/install

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

/usr/bin/gnome-jhbuild-session を実行可能にします。

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

ディスプレイマネージャーに新しいセッションエントリを追加するために、/usr/share/xsessions/gnome-jhbuild.desktop を作成して、次のとおり入力します。

[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

gdm を再起動します。

3.3.2. ディスプレイマネージャーから GNOME を起動する

JHBuild GNOME を起動するには、ディスプレイマネージャーで GNOME (JHBuild) セッションを選択してから、gnomedev のログイン情報を入力します。成功した場合は、JHBuild GNOME が表示されます。失敗した場合は、ログファイルを確認してください。ログファイルの場所は、~gnomedev/.cache/gdm/session.log~gnomedev/.xsession-errors です。

3.4. Static Analysis

JHBuild supports running static analysis tools on the code in modules as they’re built. To enable this, set the static_analyzer configuration variable to True in the .jhbuildrc configuration file.

If enabled, every time a module is built using JHBuild, the build process will be wrapped in a static analyzer, which will generate a report of any problems it finds with the code. These reports are saved as HTML files in subdirectories of /tmp/jhbuild_static_analyzer (by default; the path can be changed using the static_analyzer_outputdir configuration variable).

Static analysis currently only works for modules which use autotools as their build system. It requires the scan-build program to be installed, although the command it uses can be changed by modifying the static_analyzer_template configuration variable.