https://wiki.archlinux.org/api.php?action=feedcontributions&user=Davidcollins4481&feedformat=atomArchWiki - User contributions [en]2024-03-28T19:09:47ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=JHBuild&diff=174442JHBuild2011-12-16T02:16:43Z<p>Davidcollins4481: /* Python issues */</p>
<hr />
<div>[[Category:Development (English)]]<br />
{{i18n|JHBuild}}<br />
<br />
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.<br />
<br />
JHBuild was originally written for building [[GNOME]], but has since been extended to be usable with other projects.<br />
<br />
==Installation==<br />
<br />
JHBuild is available in the [[Arch User Repository]]. Install either {{AUR|jhbuild}} or {{AUR|jhbuild-git}}, the development version.<br />
<br />
==Configuration==<br />
<br />
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:<br />
<br />
# -*- mode: python -*-<br />
# -*- coding: utf-8 -*-<br />
<br />
# edit this file to match your settings and copy it to ~/.jhbuildrc<br />
<br />
# if you have a GNOME git account, uncomment this line<br />
# repos['git.gnome.org'] = 'ssh://user@git.gnome.org/git/'<br />
<br />
# what module set should be used. The default can be found in<br />
# jhbuild/defaults.jhbuildrc, but can be any file in the modulesets directory<br />
# or a URL of a module set file on a web server.<br />
# moduleset = 'gnome-apps-3.2'<br />
#<br />
# A list of the modules to build. Defaults to the GNOME core and tested apps.<br />
# modules = [ 'meta-gnome-core', 'meta-gnome-apps-tested' ]<br />
<br />
# Or to build the old GNOME 2.32:<br />
# moduleset = 'gnome2/gnome-2.32'<br />
# modules = ['meta-gnome-desktop']<br />
<br />
# what directory should the source be checked out to?<br />
checkoutroot = os.path.expanduser('~/checkout/gnome')<br />
<br />
# the prefix to configure/install modules to (must have write access)<br />
prefix = '/opt/gnome'<br />
<br />
# custom CFLAGS / environment pieces for the build<br />
# os.environ['CFLAGS'] = '-Wall -g -O0'<br />
<br />
# extra arguments to pass to all autogen.sh scripts<br />
# to speed up builds of GNOME, try '--disable-static --disable-gtk-doc'<br />
#autogenargs=''<br />
<br />
# On multiprocessor systems setting makeargs to '-j2' may improve compilation<br />
# time. Be aware that not all modules compile correctly with '-j2'.<br />
# Set makeargs to 'V=1' for verbose build output.<br />
#makeargs = '-j2'<br />
<br />
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].<br />
<br />
==Usage==<br />
<br />
===Installing Prerequisites===<br />
<br />
JHBuild can check if the required tools are installed by running ''sanitycheck'':<br />
<br />
$ jhbuild sanitycheck<br />
<br />
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:<br />
<br />
$ jhbuild bootstrap<br />
<br />
===Building===<br />
<br />
To build all the modules selected in the configuration file, just run the ''build'' command:<br />
<br />
$ jhbuild build<br />
<br />
JHBuild will download, configure, compile and install each of the modules.<br />
<br />
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.<br />
<br />
Giving up on a module will cause any modules depending on it to fail.<br />
<br />
==Troubleshooting==<br />
<br />
===Python issues===<br />
<br />
Projects which use ''Python 2'' may present building errors, because they will refer to paths like {{ic|/usr/bin/python}}, which points to ''Python 3'' on Arch. Namely, building [[GNOME]] under default configuration may cause this error.<br />
<br />
To fix this issue, you can point the correct ''Python 2'' path to JHBuild by appending the following to {{ic|~/.jhbuildrc}}:<br />
<br />
os.environ['PYTHON'] = '/usr/bin/python2'<br />
addpath('PYTHONPATH', '/usr/lib/python2.7/site-packages')<br />
addpath('PYTHONPATH', os.path.join(prefix, 'lib/python2.7/site-packages'))<br />
<br />
This code points Python version 2.7 to JHBuild environment Python path.<br />
<br />
'''If you are building from scratch on your own''', it may be necessary to run autogen.sh with the following:<br />
<br />
PYTHON=/usr/bin/python2 ./autogen.sh<br />
<br />
It was also necessary for me to update the shebang line in ~/.local/bin/jhbuild<br />
<br />
#!/usr/bin/python2<br />
<br />
Once that is finished, run<br />
<br />
jhbuild sanitycheck<br />
<br />
That will tell you what dependencies you need. In my case, I had to:<br />
<br />
pacman -S docbook-xsl<br />
pacman -S cvs<br />
<br />
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, <br />
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<br />
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.<br />
<br />
==External links==<br />
<br />
[http://developer.gnome.org/jhbuild/ GNOME JHBuild Manual]</div>Davidcollins4481https://wiki.archlinux.org/index.php?title=JHBuild&diff=174441JHBuild2011-12-16T02:15:52Z<p>Davidcollins4481: /* Python issues */</p>
<hr />
<div>[[Category:Development (English)]]<br />
{{i18n|JHBuild}}<br />
<br />
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.<br />
<br />
JHBuild was originally written for building [[GNOME]], but has since been extended to be usable with other projects.<br />
<br />
==Installation==<br />
<br />
JHBuild is available in the [[Arch User Repository]]. Install either {{AUR|jhbuild}} or {{AUR|jhbuild-git}}, the development version.<br />
<br />
==Configuration==<br />
<br />
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:<br />
<br />
# -*- mode: python -*-<br />
# -*- coding: utf-8 -*-<br />
<br />
# edit this file to match your settings and copy it to ~/.jhbuildrc<br />
<br />
# if you have a GNOME git account, uncomment this line<br />
# repos['git.gnome.org'] = 'ssh://user@git.gnome.org/git/'<br />
<br />
# what module set should be used. The default can be found in<br />
# jhbuild/defaults.jhbuildrc, but can be any file in the modulesets directory<br />
# or a URL of a module set file on a web server.<br />
# moduleset = 'gnome-apps-3.2'<br />
#<br />
# A list of the modules to build. Defaults to the GNOME core and tested apps.<br />
# modules = [ 'meta-gnome-core', 'meta-gnome-apps-tested' ]<br />
<br />
# Or to build the old GNOME 2.32:<br />
# moduleset = 'gnome2/gnome-2.32'<br />
# modules = ['meta-gnome-desktop']<br />
<br />
# what directory should the source be checked out to?<br />
checkoutroot = os.path.expanduser('~/checkout/gnome')<br />
<br />
# the prefix to configure/install modules to (must have write access)<br />
prefix = '/opt/gnome'<br />
<br />
# custom CFLAGS / environment pieces for the build<br />
# os.environ['CFLAGS'] = '-Wall -g -O0'<br />
<br />
# extra arguments to pass to all autogen.sh scripts<br />
# to speed up builds of GNOME, try '--disable-static --disable-gtk-doc'<br />
#autogenargs=''<br />
<br />
# On multiprocessor systems setting makeargs to '-j2' may improve compilation<br />
# time. Be aware that not all modules compile correctly with '-j2'.<br />
# Set makeargs to 'V=1' for verbose build output.<br />
#makeargs = '-j2'<br />
<br />
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].<br />
<br />
==Usage==<br />
<br />
===Installing Prerequisites===<br />
<br />
JHBuild can check if the required tools are installed by running ''sanitycheck'':<br />
<br />
$ jhbuild sanitycheck<br />
<br />
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:<br />
<br />
$ jhbuild bootstrap<br />
<br />
===Building===<br />
<br />
To build all the modules selected in the configuration file, just run the ''build'' command:<br />
<br />
$ jhbuild build<br />
<br />
JHBuild will download, configure, compile and install each of the modules.<br />
<br />
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.<br />
<br />
Giving up on a module will cause any modules depending on it to fail.<br />
<br />
==Troubleshooting==<br />
<br />
===Python issues===<br />
<br />
Projects which use ''Python 2'' may present building errors, because they will refer to paths like {{ic|/usr/bin/python}}, which points to ''Python 3'' on Arch. Namely, building [[GNOME]] under default configuration may cause this error.<br />
<br />
To fix this issue, you can point the correct ''Python 2'' path to JHBuild by appending the following to {{ic|~/.jhbuildrc}}:<br />
<br />
os.environ['PYTHON'] = '/usr/bin/python2'<br />
addpath('PYTHONPATH', '/usr/lib/python2.7/site-packages')<br />
addpath('PYTHONPATH', os.path.join(prefix, 'lib/python2.7/site-packages'))<br />
<br />
This code points Python version 2.7 to JHBuild environment Python path.<br />
<br />
'''If you are building from scratch on your own''', it may be necessary to run autogen.sh with the following:<br />
<br />
PYTHON=/usr/bin/python2 ./autogen.sh<br />
<br />
It was also necessary for me to update the she-bang line in ~/.local/bin/jhbuild<br />
<br />
#!/usr/bin/python2<br />
<br />
Once that is finished, run<br />
<br />
jhbuild sanitycheck<br />
<br />
That will tell you what dependencies you need. In my case, I had to:<br />
<br />
pacman -S docbook-xsl<br />
pacman -S cvs<br />
<br />
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, <br />
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<br />
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.<br />
<br />
==External links==<br />
<br />
[http://developer.gnome.org/jhbuild/ GNOME JHBuild Manual]</div>Davidcollins4481