A wrapper around GNOME's JHBuild build and dependency manager which allows to automatic download of tarballs and checkout of source roots with various SCMs, automatic build, test and installation into a user prefix as well as specification and resolution of dependencies. The wrapper uses some system binaries which are expected to be present and otherwise need to be installed manually by the caller (e.g.
sh and
make. Other non-system binaries, like
git and
jhbuild itself are searched for and automatically downloaded and installed in case of absence. Both system and non-system binaries are search for in the environment variable
PATH and the subdirectory
bin of the specified
installationPrefix so that it's possible to install them as non-root user (system-binaries don't necessarily have to be installed manually into
installationPrefix since any other installation prefix can be added to
PATH before the wrapper is used).
stdout and
stderr of build processes are redirected to
stdout and
stderr of the JVM except
silenceStdout or
silenceStderr are set to
true. In this case the content of both process streams is wrapped in a BuildFailureException in case a build process returns a code which is unequal
0. The Wrapper make JHBuild use it's default cache directory for downloads and build results under the user's home directory since there's few incentive to make the location configurable. Only the
JHBuildJavaWrapper.cancelInstallModuleset is allowed to be called from another thread, calls to other methods from other threads result in unpredictable behaviour. The initialization routine makes sure that a C compiler and
make are provided by the system since it's very hard or impossible to build a C compiler without an existing one as well as building
make without
make. The initialization routine then builds and installs
git and all of its prerequisites and then uses it to clone the
jhbuild repository and build and install it. A tarball of
jhbuild could be used, but that's a TODO.