Difference between revisions of "JHBuild"

From ArchWiki
Jump to: navigation, search
(Troubleshooting: Add information about misformatted .pc files)
(update Pkg/AUR templates)
(Tag: wiki-scripts)
 
(77 intermediate revisions by 14 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.
+
[[ja:JHBuild]]
 +
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.
  
==Installation==
+
== Installation ==
  
JHBuild is available in the [[Arch User Repository]]. Install either {{AUR|jhbuild}} or {{AUR|jhbuild-git}}, the development version.
+
Install the {{AUR|jhbuild}} package, which provides the stable 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:
  
# -*- mode: python -*-
+
{{bc|<nowiki>
# -*- coding: utf-8 -*-
+
# -*- mode: python -*-
+
# -*- coding: utf-8 -*-
# edit this file to match your settings and copy it to ~/.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.2'
+
#
+
# 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 [http://developer.gnome.org/jhbuild/unstable/config-reference.html.en GNOME JHBuild Manual].
+
# edit this file to match your settings and copy it to ~/.config/jhbuildrc
  
==Usage==
+
# if you have a GNOME git account, uncomment this line
 +
# repos['git.gnome.org'] = 'ssh://user@git.gnome.org/git/'
  
===Installing Prerequisites===
+
# 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' ]
  
JHBuild can check if the required tools are installed by running ''sanitycheck'':
+
# Or to build the old GNOME 2.32:
 +
# moduleset = 'gnome2/gnome-2.32'
 +
# modules = ['meta-gnome-desktop']
  
  $ jhbuild sanitycheck
+
# 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'
 +
</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 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 [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 64: Line 69:
 
  $ jhbuild bootstrap
 
  $ jhbuild bootstrap
  
===Building===
+
=== Building ===
  
 
To build all the modules selected in the configuration file, just run the ''build'' command:
 
To build all the modules selected in the configuration file, just run the ''build'' command:
Line 70: Line 75:
 
  $ 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 76: Line 85:
 
Giving up on a module will cause any modules depending on it to fail.
 
Giving up on a module will cause any modules depending on it to fail.
  
==Troubleshooting==
+
To build as many packages as possible, skipping broken packages, run:
  
===Python issues===
+
$ yes 3 | jhbuild --try-checkout build
  
{{Note|Users of the {{AUR|jhbuild}} package should not encounter Python-related issues; if you do, please add a comment describing your issue to the {{AUR|jhbuild}} page.}}
+
== Troubleshooting ==
  
Projects which use ''Python 2'' may encounter errors when building, because they refer to paths like {{ic|/usr/bin/python}}, which points to ''Python 3'' on Arch. Building [[GNOME]] with a default configuration may cause this error.
+
{{Note|If you encounter an issue that is not documented below, please report it in a comment on the {{AUR|jhbuild}} package.}}
  
To fix this issue, you can point the correct ''Python 2'' path to JHBuild by appending the following to {{ic|~/.jhbuildrc}}:
+
=== Python issues ===
  
autogenargs='PYTHON=/usr/bin/python2'
+
==== Building from scratch without JHBuild, or in a JHBuild shell ====
  
Packages will then be configured to use Python 2 instead of Python 3.
+
If you are building from scratch on your own, it may be necessary to run ''autogen.sh'' with the following:
  
'''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
  
PYTHON=/usr/bin/python2 ./autogen.sh
+
And set the PYTHON environment variable in ~/.config/jhbuildrc
  
It was also necessary for me to update the shebang line in ~/.local/bin/jhbuild
+
os.environ['PYTHON'] = '/usr/bin/python2'
  
#!/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.}}
  
Once that is finished, run
+
==== itstool missing Python modules====
  
  jhbuild sanitycheck
+
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.
  
That will tell you what dependencies you need. In my case, I had to:
+
=== pkg-config issues ===
  
pacman -S docbook-xsl
+
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.
pacman -S cvs
+
  
I had to switch the symlink "/usr/bin/python" to point to python2.7 to get "jhbuild build" to run correctly. If there is a better way to do this,
+
=== gnome-devel-docs does not build ===
please update this to reflect that. It was difficult for me to track down Arch Users that had built jhbuild from scratch so I figure these
+
notes are better than none and may save some time. The folks in #gnome-shell on irc.gnome.org will help in any way they can.
+
  
=== pkg-config issues ===
+
Choose {{ic|[4] Start shell}} and run:
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.
+
$ git revert --no-edit 9ba0d959
 +
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.
 +
 
 +
=== pango does not build ===
 +
 
 +
If build failed due to cairo.h not found, do the following: Enter [4]shell, edit {{ic|pango/pangocairo.h}} changing:
 +
{{bc| #define <cairo.h>}}
 +
to
 +
{{bc| #define <cairo/cairo.h>}}
 +
 
 +
=== geary does not build ===
 +
 
 +
If you are getting this error message...
 +
{{bc|[ 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 ([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])
 +
 
 +
=== Other broken modules ===
 +
 
 +
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)
 +
* gegl
 +
* gnome-boxes—[https://bugzilla.gnome.org/show_bug.cgi?id=725520 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 ==
 +
 
 +
* gitg requires {{Pkg|gtkspell3}}
 +
* gtk-vnc requires {{Pkg|perl-text-csv}}
 +
* latexila requires {{AUR|lcov}}
 +
* pango requires {{AUR|libpthread-stubs}}
 +
* totem-pl-parser requires {{Pkg|libgcrypt15}}
 +
* xf86-video-intel requires {{Pkg|xorg-server-devel}}
 +
* 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}}
  
==External links==
+
== See also ==
  
 
[http://developer.gnome.org/jhbuild/ GNOME JHBuild Manual]
 
[http://developer.gnome.org/jhbuild/ GNOME JHBuild Manual]

Latest revision as of 13:18, 21 October 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