JHBuild uses simple XML files to describe the dependencies between modules. A RELAX-NG schema and Document Type Definition are included with JHBuild in the modulesets/ directory. The RELAX-NG schema makes it trivial to edit module set files using nxml-mode in Emacs.
The toplevel element in a module set file is moduleset element. Currently no XML namespace is used, but in the future this might change. The elements below the toplevel come in three types: module sources, include statements and module definitions.
Rather than listing the full location of every module, a number of "module sources" are listed in the module set, and then referenced by name in the module definitions. As well as reducing the amount of redundant information in the module set, it makes it easy for a user to specify an alternative source for those modules (for CVS and Subversion, it is common for developers and users to use different repository access methods).
The cvsroot element is used to describe a CVS repository.
<cvsroot name="rootname"
[ default="yes|no" ]
root="anon-cvsroot"
password="anon-password"/>
The name attribute should be a unique identifier for the CVS repository.
If default attribute says whether this is the default module source for this module set file.
The root attribute lists the CVS root used for anonymous access to this repository, and the password attribute gives the password used for anonymous access.
The svnroot element is used to describe a Subversion repository.
<svnroot name="rootname"
[ default="yes|no" ]
href="anon-svnroot"/>
The name attribute should be a unique identifier for the Subversion repository.
If default attribute says whether this is the default module source for this module set file.
The href attribute lists the base URL for the repository. This will probably be either a http, https or svn URL.
The arch-archive element is used to describe a GNU Arch archive.
<arch-archive name="archivename"
[ default="yes|no" ]
href="mirror-url"/>
The name attribute should be the Arch archive name.
If default attribute says whether this is the default module source for this module set file.
The href attribute lists a public mirror URL for the archive.
JHBuild allows one module set to include the contents of another by reference using the include element.
<include href="uri"/>
The href is a URI reference to the module set to be included, relative to the file containing the include element.
Only module definitions are imported from the referenced module set — module sources are not. Multiple levels of includes are allowed, but include loops are not (there isn't any code to handle loops at the moment).
There are various types of module definitions that can be used in a module set file, and the list can easily be extended. Only the most common ones will be mentioned here.
The cvsmodule element is used to define a module that is to be built from CVS.
<cvsmodule module="modulename"
[ revision="branch-or-tag" ]
[ checkoutdir="directory" ]
[ root="rootname" ]
[ autogenargs="autogenargs" ]
[ makeargs="makeargs" ]
[ supports-non-srcdir-builds="yes|no" ]>
<dependencies>
<dep package="modulename"/>
...
</dependencies>
<suggests>
<dep package="modulename"/>
...
</suggests>
</cvsmodule>
The module, revision and root attributes identify the module to check out from CVS. The checkoutdir attribute can be used to specify an alternative directory to check out to (by default, the value of module is used).
The autogenargs, makeargs and supports-non-srcdir-builds attributes are common to many different module types. The autogenargs attribute lists additional arguments to be passed to autogen.sh, and makeargs lists additional arguments to be passed to make. The supports-non-srcdir-builds attribute is used to mark modules that can't be cleanly built using a separate source directory.
The dependencies and suggests elements are used to declare the dependencies of the module. Any modules listed in the dependencies element will be added to the module list for jhbuild build if it isn't already included, and make sure the dependent modules are built first.
After generating the modules list, the modules listed in the suggests element will be used to further sort the modules list (although it will not pull any additional modules). This is intended for cases where a module has an optional dependency on another module.
The svnmodule element is used to define a module that is to be built from Subversion.
<svnmodule module="modulename"
[ checkoutdir="directory" ]
[ root="rootname" ]
[ autogenargs="autogenargs" ]
[ makeargs="makeargs" ]
[ supports-non-srcdir-builds="yes|no" ]>
<dependencies>
<dep package="modulename"/>
...
</dependencies>
<suggests>
<dep package="modulename"/>
...
</suggests>
</svnmodule>
The module attribute gives the path of the module relative to the repository URI. All other options for this element are processed as for cvsmodule.
The archmodule element is used to define a module that is to be built from a GNU Arch archive.
<archmodule version="modulename"
[ checkoutdir="directory" ]
[ root="rootname" ]
[ autogenargs="autogenargs" ]
[ makeargs="makeargs" ]
[ supports-non-srcdir-builds="yes|no" ]>
<dependencies>
<dep package="modulename"/>
...
</dependencies>
<suggests>
<dep package="modulename"/>
...
</suggests>
</archmodule>
The version attribute gives the version to be checked out from the archive specified by root. All other options for this element are processed as for cvsmodule.
The tarball element is used to define a module that is to be built from a tarball.
<tarball id="modulename"
[ version="version" ]
[ autogenargs="autogenargs" ]
[ makeargs="makeargs" ]
[ supports-non-srcdir-builds="yes|no" ]>
<source href="source-url"
[ size="source-size" ]
[ md5sum="source-md5sum" ]/>
<patches>
<patch file="filename" strip="level"/>
...
</patches>
<dependencies>
<dep package="modulename"/>
...
</dependencies>
<suggests>
<dep package="modulename"/>
...
</suggests>
</tarball>
The id and version attributes are used to identify the module.
The source element specifies the file to download and compile. The href attribute is mandatory, while the size and md5sum attributes are optional. If the last two attributes are present, they are used to check that the source package was downloaded correctly.
The patches element is used to specify one or more patches to apply to the source tree after unpacking. The patch files are looked up in the jhbuild/patches/ directory, and the strip attribute says how many levels of directories to prune when applying the patch.
The other attributes and the dependencies and suggests sub-elements are processed as for cvsmodule.
The metamodule element defines a module that doesn't actually do anythin. The only purpose of a module of this type is its dependencies.
<metamodule id="modulename">
<dependencies>
<dep package="modulename"/>
...
</dependencies>
<suggests>
<dep package="modulename"/>
...
</suggests>
</metamodule>
The id attribute gives the name of the module. The child elements are handled as for cvsmodule.