Difference between revisions of "JHBuild"

From ArchWiki
Jump to: navigation, search
m (Promts.)
(Troubleshooting: Add Geary build failure information)
 
(32 intermediate revisions by 11 users not shown)
Line 1: Line 1:
 
[[Category:Development]]
 
[[Category:Development]]
JHBuild is a tool that allows you to automatically download and compile "modules" (i.e. source code packages). It can pull modules from a variety of sources (CVS, Subversion, Git, Bazaar, tarballs...) and handle dependencies. You can also choose which specific modules you want to build, instead of building the whole project.
+
JHBuild is a tool that allows you to automatically download and compile "modules" (i.e. source code packages). It can pull modules from a variety of sources (CVS, Subversion, Git, Bazaar, tarballs, etc.) and handle dependencies. You can also choose which specific modules you want to build, instead of building the whole project.
  
 
JHBuild was originally written for building [[GNOME]], but has since been extended to be usable with other projects.
 
JHBuild was originally written for building [[GNOME]], but has since been extended to be usable with other projects.
Line 6: Line 6:
 
== Installation ==
 
== Installation ==
  
[[pacman|Install]] one JHBuild variant from the [[AUR]]:
+
Install the {{AUR|jhbuild}} package, which provides the stable version.
* {{AUR|jhbuild}} - Stable version.
+
* {{AUR|jhbuild-git}} - Development version.
+
  
 
== Configuration ==
 
== Configuration ==
  
The configuration file for JHBuild is {{ic|~/.jhbuildrc}}. It uses [[Python]] syntax to set configuration variables. Here is the sample file provided for building GNOME:
+
The configuration file for JHBuild is located at {{ic|~/.config/jhbuildrc}}. It uses [[Python]] syntax to set configuration variables. Here is the sample file provided for building GNOME:
  
 
{{bc|<nowiki>
 
{{bc|<nowiki>
Line 18: Line 16:
 
# -*- coding: utf-8 -*-
 
# -*- coding: utf-8 -*-
  
# edit this file to match your settings and copy it to ~/.jhbuildrc
+
# edit this file to match your settings and copy it to ~/.config/jhbuildrc
  
 
# if you have a GNOME git account, uncomment this line
 
# if you have a GNOME git account, uncomment this line
Line 26: Line 24:
 
# jhbuild/defaults.jhbuildrc, but can be any file in the modulesets directory
 
# jhbuild/defaults.jhbuildrc, but can be any file in the modulesets directory
 
# or a URL of a module set file on a web server.
 
# or a URL of a module set file on a web server.
# moduleset = 'gnome-apps-3.2'
+
# moduleset = 'gnome-apps-3.12'
 
#
 
#
 
# A list of the modules to build. Defaults to the GNOME core and tested apps.
 
# A list of the modules to build. Defaults to the GNOME core and tested apps.
Line 54: Line 52:
 
</nowiki>}}
 
</nowiki>}}
  
You should edit at least ''modules'' to the desired modules to be built. A reference for most configuration variables is available at [http://developer.gnome.org/jhbuild/unstable/config-reference.html.en GNOME JHBuild Manual].
+
You should edit (at least) ''modules'' to the desired modules to be built. A reference for most configuration variables is available at [http://developer.gnome.org/jhbuild/unstable/config-reference.html GNOME JHBuild Manual].
  
 
== Usage ==
 
== Usage ==
Line 60: Line 58:
 
=== Installing prerequisites ===
 
=== Installing prerequisites ===
  
JHBuild can check if the required tools are installed by running ''sanitycheck'':
+
JHBuild can check if the required tools are installed by running ''sysdeps'':
  
  $ jhbuild sanitycheck
+
  $ jhbuild sysdeps
 +
 
 +
''sanitycheck'' has the similar function of ''sysdeps'', but it fails on checking automake version due to an [http://lists.gnu.org/archive/html/automake/2016-05/msg00000.html regexp error in automake] until 1.15 ([http://git.savannah.gnu.org/gitweb/?p=automake.git;a=commit;h=13f00eb4493c217269b76614759e452d8302955e Already fixed next automake version]).
  
 
If any errors are shown, missing packages may be installed from repositories or running the ''bootstrap'' command, which tries to download, build and install the build prerequisites:
 
If any errors are shown, missing packages may be installed from repositories or running the ''bootstrap'' command, which tries to download, build and install the build prerequisites:
Line 74: Line 74:
 
  $ jhbuild build
 
  $ jhbuild build
  
JHBuild will download, configure, compile and install each of the modules.
+
JHBuild will download, configure, compile and install each of the modules. See
 +
 
 +
$ jhbuild help
 +
 
 +
for more details.
  
 
If an error occurs at any stage, JHBuild will present a menu asking what to do. The choices include dropping to a shell to fix the error, rerunning the build from various stages, giving up on the module, or ignore the error and continue. Often, dropping to a shell and checking makefiles and configuration files can be helpful. If you face a build error, for example, you can try to manually {{ic|make}} and check errors on the shell.
 
If an error occurs at any stage, JHBuild will present a menu asking what to do. The choices include dropping to a shell to fix the error, rerunning the build from various stages, giving up on the module, or ignore the error and continue. Often, dropping to a shell and checking makefiles and configuration files can be helpful. If you face a build error, for example, you can try to manually {{ic|make}} and check errors on the shell.
Line 86: Line 90:
 
== Troubleshooting ==
 
== Troubleshooting ==
  
{{Note|If you encounter an issue that isn't documented below, please report it in a comment on the {{AUR|jhbuild}} package.}}
+
{{Note|If you encounter an issue that is not documented below, please report it in a comment on the {{AUR|jhbuild}} package.}}
  
 
=== Python issues ===
 
=== Python issues ===
Line 96: Line 100:
 
  $ PYTHON=/usr/bin/python2 ./autogen.sh
 
  $ PYTHON=/usr/bin/python2 ./autogen.sh
  
The shebang line in {{ic|~/.local/bin/jhbuild}} may need to be updated to:
+
And set the PYTHON environment variable in ~/.config/jhbuildrc
#!/usr/bin/python2
+
  
You may need to switch the symlink {{ic|/usr/bin/python}} to point to ''python2.7'' to get "jhbuild build" to run correctly. The folks in #gnome-shell on irc.gnome.org will help in any way they can.
+
os.environ['PYTHON'] = '/usr/bin/python2'
  
=== pkg-config issues ===
+
{{Note|JHBuild uses its own python lib directory in /opt/gnome/lib/python2.7; if you are having problems with python imports check to see that the .py files are there.}}
  
If you have a malformatted .pc file on your PKG_CONFIG_PATH, JHBuild won't be able to detect all the (valid) .pc files you have installed and will complain that the .pc files are missing. Look at the output of {{ic|jhbuild sysdeps}}—there should be a message about the problematic .pc files.
+
==== itstool missing Python modules====
  
=== totem does not build ===
+
Chose {{ic|[4] Start shell}} and run:
 +
$ sed -ir 's/| python /| python2 /' configure
 +
Then, exit the shell and choose {{ic|[1] Rerun phase configure}}. See [https://gitorious.org/itstool/itstool/merge_requests/6 this merge request] for more details.
  
Choose {{ic|[4] Start shell}} and run:
+
=== pkg-config issues ===
$ curl https://git.gnome.org/browse/totem/patch/?id=198d7f251e7816f837378fb2081829188847b916 | git apply
+
Then, exit the shell and choose {{ic|[1] Rerun phase build}}.
+
  
=== evolution does not build ===
+
If you have a malformatted .pc file on your PKG_CONFIG_PATH, JHBuild will not be able to detect all the (valid) .pc files you have installed and will complain that the .pc files are missing. Look at the output of {{ic|jhbuild sysdeps}}—there should be a message about the problematic .pc files.
 
+
Choose {{ic|[4] Start shell}} and run:
+
$ curl https://bug707112.bugzilla-attachments.gnome.org/attachment.cgi?id=253584 | git apply
+
Then, exit the shell and choose {{ic|[1] Rerun phase build}}. See [https://bugzilla.gnome.org/show_bug.cgi?id=707112 this bug] for further details.
+
  
 
=== gnome-devel-docs does not build ===
 
=== gnome-devel-docs does not build ===
Line 123: Line 122:
 
Then, exit the shell and choose {{ic|[1] Rerun phase build}}. See [https://bugzilla.gnome.org/show_bug.cgi?id=707007 this bug] for further details.
 
Then, exit the shell and choose {{ic|[1] Rerun phase build}}. See [https://bugzilla.gnome.org/show_bug.cgi?id=707007 this bug] for further details.
  
=== devhelp does not build ===
+
=== pango does not build ===
  
Choose {{ic|[4] Start shell}} and run:
+
If build failed due to cairo.h not found, do the following: Enter [4]shell, edit {{ic|pango/pangocairo.h}} changing:
$ curl https://bug707490.bugzilla-attachments.gnome.org/attachment.cgi?id=254113 | git apply
+
{{bc| #define <cairo.h>}}
Then, exit the shell and choose {{ic|[1] Rerun phase build}}. See [https://bugzilla.gnome.org/show_bug.cgi?id=707490 this bug] for further details.
+
to
 +
{{bc| #define <cairo/cairo.h>}}
  
=== libosinfo does not build ===
+
=== geary does not build ===
  
Choose {{ic|[4] Start shell}} and run:
+
If you are getting this error message...
$ curl https://fedorahosted.org/libosinfo/raw-attachment/ticket/9/0001-Don-t-use-AM_GNU_GETTEXT.patch | git apply
+
{{bc|[ 78%] Generating webkitgtk-3.0.vapi
Then, exit the shell and choose {{ic|[1] Rerun phase build}}. See [https://fedorahosted.org/libosinfo/ticket/9 this bug] for further details.
+
error: /home/rffontenelle/jhbuild/install/share/gir-1.0/WebKit-3.0.gir not found
 +
Generation failed: 1 error(s), 0 warning(s)
 +
make[2]: *** [src/CMakeFiles/geary.dir/build.make:1277: src/webkitgtk-3.0.vapi] Error 1
 +
make[1]: *** [CMakeFiles/Makefile2:798: src/CMakeFiles/geary.dir/all] Error 2}}
  
=== ibus-pinyin does not build ===
+
... then please notice that geary depends on WebKitGTK (<= 2.4), but JHBuild compiles WebKit2GTK (newer). This is a known issue ([https://bugzilla.gnome.org/show_bug.cgi?id=741866 #741866] and [https://mail.gnome.org/archives/geary-list/2016-June/msg00022.html mailing list]) and there is a plan for porting Geary ([https://bugzilla.gnome.org/show_bug.cgi?id=728002 #728002])
 
+
Choose {{ic|[4] Start shell}} and run:
+
$ curl https://github.com/ibus/ibus-pinyin/commit/3d0680c2b9533d0abff30258d0e772b8aa97af1c.patch | git apply
+
Then, exit the shell and choose {{ic|[8] Go to phase "clean"}}. See [https://code.google.com/p/ibus/issues/detail?id=1581 this bug] for further details.
+
  
 
=== Other broken modules ===
 
=== Other broken modules ===
  
The following modules don't build, and there are no known fixes (feel free to jump in and investigate; I've only made cursory attempts to fix these issues):
+
The following modules do not build, and there are no known/immediate fixes (feel free to jump in and investigate):
 
* aisleriot—[https://bugzilla.gnome.org/show_bug.cgi?id=707106 bug report] (probably easy to fix if you poke around)
 
* aisleriot—[https://bugzilla.gnome.org/show_bug.cgi?id=707106 bug report] (probably easy to fix if you poke around)
 
* gegl
 
* gegl
* gnome-boxes
+
* gnome-boxes—[https://bugzilla.gnome.org/show_bug.cgi?id=725520 bug report] (a fix is provided there)
 
* gnome-photos
 
* gnome-photos
 
* gtksourceviewmm
 
* gtksourceviewmm
Line 155: Line 154:
 
* valadoc
 
* valadoc
  
This list includes modules transitively depending on broken modules (i.e. some of the modules might be fine; I didn't check).
+
This list includes modules transitively depending on broken modules (i.e. some of the modules might be fine; I did not check).
  
 
== Packages needed to build specific modules ==
 
== Packages needed to build specific modules ==
  
 +
* gitg requires {{Pkg|gtkspell3}}
 
* gtk-vnc requires {{AUR|perl-text-csv}}
 
* gtk-vnc requires {{AUR|perl-text-csv}}
 +
* latexila requires {{AUR|lcov}}
 +
* pango requires {{AUR|libpthread-stubs}}
 +
* totem-pl-parser requires {{AUR|libgcrypt15}}
 
* xf86-video-intel requires {{Pkg|xorg-server-devel}}
 
* xf86-video-intel requires {{Pkg|xorg-server-devel}}
* zeitgeist requires {{Pkg|python2-rdflib}}
 
* gitg requires {{Pkg|gtkspell3}}
 
 
* xwayland requires {{Pkg|xtrans}}, {{Pkg|xcmiscproto}}, and {{Pkg|bigreqsproto}}
 
* xwayland requires {{Pkg|xtrans}}, {{Pkg|xcmiscproto}}, and {{Pkg|bigreqsproto}}
 +
* zeitgeist requires {{Pkg|python2-rdflib}}
 +
* wireless-tools requires {{Pkg|wireless_tools}}
 +
* xorg-macros requires {{Pkg|xorg-util-macros}}
  
 
== See also ==
 
== See also ==
  
 
[http://developer.gnome.org/jhbuild/ GNOME JHBuild Manual]
 
[http://developer.gnome.org/jhbuild/ GNOME JHBuild Manual]

Latest revision as of 04:37, 20 June 2016

JHBuild is a tool that allows you to automatically download and compile "modules" (i.e. source code packages). It can pull modules from a variety of sources (CVS, Subversion, Git, Bazaar, tarballs, etc.) and handle dependencies. You can also choose which specific modules you want to build, instead of building the whole project.

JHBuild was originally written for building GNOME, but has since been extended to be usable with other projects.

Installation

Install the jhbuildAUR package, which provides the stable version.

Configuration

The configuration file for JHBuild is located at ~/.config/jhbuildrc. It uses Python syntax to set configuration variables. Here is the sample file provided for building GNOME:

# -*- mode: python -*-
# -*- coding: utf-8 -*-

# edit this file to match your settings and copy it to ~/.config/jhbuildrc

# if you have a GNOME git account, uncomment this line
# repos['git.gnome.org'] = 'ssh://user@git.gnome.org/git/'

# what module set should be used. The default can be found in
# jhbuild/defaults.jhbuildrc, but can be any file in the modulesets directory
# or a URL of a module set file on a web server.
# moduleset = 'gnome-apps-3.12'
#
# A list of the modules to build. Defaults to the GNOME core and tested apps.
# modules = [ 'meta-gnome-core', 'meta-gnome-apps-tested' ]

# Or to build the old GNOME 2.32:
# moduleset = 'gnome2/gnome-2.32'
# modules = ['meta-gnome-desktop']

# what directory should the source be checked out to?
checkoutroot = os.path.expanduser('~/checkout/gnome')

# the prefix to configure/install modules to (must have write access)
prefix = '/opt/gnome'

# custom CFLAGS / environment pieces for the build
# os.environ['CFLAGS'] = '-Wall -g -O0'

# extra arguments to pass to all autogen.sh scripts
# to speed up builds of GNOME, try '--disable-static --disable-gtk-doc'
#autogenargs=''

# On multiprocessor systems setting makeargs to '-j2' may improve compilation
# time. Be aware that not all modules compile correctly with '-j2'.
# Set makeargs to 'V=1' for verbose build output.
#makeargs = '-j2'

You should edit (at least) modules to the desired modules to be built. A reference for most configuration variables is available at GNOME JHBuild Manual.

Usage

Installing prerequisites

JHBuild can check if the required tools are installed by running sysdeps:

$ jhbuild sysdeps

sanitycheck has the similar function of sysdeps, but it fails on checking automake version due to an regexp error in automake until 1.15 (Already fixed next automake version).

If any errors are shown, missing packages may be installed from repositories or running the bootstrap command, which tries to download, build and install the build prerequisites:

$ jhbuild bootstrap

Building

To build all the modules selected in the configuration file, just run the build command:

$ jhbuild build

JHBuild will download, configure, compile and install each of the modules. See

$ jhbuild help

for more details.

If an error occurs at any stage, JHBuild will present a menu asking what to do. The choices include dropping to a shell to fix the error, rerunning the build from various stages, giving up on the module, or ignore the error and continue. Often, dropping to a shell and checking makefiles and configuration files can be helpful. If you face a build error, for example, you can try to manually make and check errors on the shell.

Giving up on a module will cause any modules depending on it to fail.

To build as many packages as possible, skipping broken packages, run:

$ yes 3 | jhbuild --try-checkout build

Troubleshooting

Note: If you encounter an issue that is not documented below, please report it in a comment on the jhbuildAUR package.

Python issues

Building from scratch without JHBuild, or in a JHBuild shell

If you are building from scratch on your own, it may be necessary to run autogen.sh with the following:

$ PYTHON=/usr/bin/python2 ./autogen.sh

And set the PYTHON environment variable in ~/.config/jhbuildrc

os.environ['PYTHON'] = '/usr/bin/python2'
Note: JHBuild uses its own python lib directory in /opt/gnome/lib/python2.7; if you are having problems with python imports check to see that the .py files are there.

itstool missing Python modules

Chose [4] Start shell and run:

$ sed -ir 's/| python /| python2 /' configure

Then, exit the shell and choose [1] Rerun phase configure. See this merge request for more details.

pkg-config issues

If you have a malformatted .pc file on your PKG_CONFIG_PATH, JHBuild will not be able to detect all the (valid) .pc files you have installed and will complain that the .pc files are missing. Look at the output of jhbuild sysdeps—there should be a message about the problematic .pc files.

gnome-devel-docs does not build

Choose [4] Start shell and run:

$ git revert --no-edit 9ba0d959

Then, exit the shell and choose [1] Rerun phase build. See this bug for further details.

pango does not build

If build failed due to cairo.h not found, do the following: Enter [4]shell, edit pango/pangocairo.h changing:

 #define <cairo.h>

to

 #define <cairo/cairo.h>

geary does not build

If you are getting this error message...

[ 78%] Generating webkitgtk-3.0.vapi
error: /home/rffontenelle/jhbuild/install/share/gir-1.0/WebKit-3.0.gir not found
Generation failed: 1 error(s), 0 warning(s)
make[2]: *** [src/CMakeFiles/geary.dir/build.make:1277: src/webkitgtk-3.0.vapi] Error 1
make[1]: *** [CMakeFiles/Makefile2:798: src/CMakeFiles/geary.dir/all] Error 2

... then please notice that geary depends on WebKitGTK (<= 2.4), but JHBuild compiles WebKit2GTK (newer). This is a known issue (#741866 and mailing list) and there is a plan for porting Geary (#728002)

Other broken modules

The following modules do not build, and there are no known/immediate fixes (feel free to jump in and investigate):

  • aisleriot—bug report (probably easy to fix if you poke around)
  • gegl
  • gnome-boxes—bug report (a fix is provided there)
  • gnome-photos
  • gtksourceviewmm
  • meta-gnome-apps-tested
  • nemiver
  • orca
  • rygel
  • valadoc

This list includes modules transitively depending on broken modules (i.e. some of the modules might be fine; I did not check).

Packages needed to build specific modules

See also

GNOME JHBuild Manual