Mustbuild is maintained as a patch series. To build Mustbuild, you first need to generate the sources by applying the patches to the specific Justbuild commit.
You can generate the sources by running the script generate_sources.sh
:
$ ./generate_sources.sh ./srcs
Fetching Justbuild archive to ~/.distfiles
Unpacking sources to ./srcs
Patching sources
SUCCESS
$ cd srcs # step into the source directory for building
Alternatively, you can also check out the specific Justbuild commit and apply the patches manually.
Once the sources have been successfully generated, you can build Mustbuild with
must
:
$ must install must -o ${DESTDIR}
... or with just-mr
:
$ just-mr install must -o ${DESTDIR}
Build options are specified via JSON objects, encoded as string arguments:
$ must install must -D'{"DEBUG":true}' -o ${DESTDIR}
For the full list of variables supported for building Mustbuild, please see Justbuild's build variables.
To obtain a full installation with auxiliary tools, man pages, and bash
completion files, use the target ALL
.
$ must install ALL -o ${DESTDIR}
Note that
pandoc
needs to be installed. You can set its execution environment by specifying variablePANDOC_ENV
as a JSON object, e.g.,-D'{"PANDOC_ENV":{"HOME":"/home/user"}}'
.
In case you have neither must
nor just-mr
available, you need to bootstrap
must
first:
$ ./bin/bootstrap.py ${SRCDIR} ${BUILDDIR}
Build options to the bootstrap process can be provided by
specifying them as a serialized JSON object assigned to the environment variable
JUST_BUILD_CONF
:
$ JUST_BUILD_CONF='{"DEBUG":true}' ./bin/bootstrap.py ${SRCDIR} ${BUILDDIR}
The final target that should be built by the bootstrap process can be specified
using the variable BOOTSTRAP_TARGET
. This is particularly useful to directly
bootstrap the ALL
target described above:
$ BOOTSTRAP_TARGET=ALL ./bin/bootstrap.py ${SRCDIR} ${BUILDDIR}
Additional variables used to achieve package builds (linking against system
libraries) are PACKAGE
, LOCALBASE
, and NON_LOCAL_DEPS
. For more
information on how to use these variables, see Justbuild's bootstrapping
documentation.