The `bootstrap` packages are a set of packages required to build any available source package in a container. There are two methods to install the `bootstrap`:
-`bootstrap`: all bootstrap packages will be built from scratch.
-`binary-bootstrap`: the bootstrap binary packages are downloaded via XBPS repositories.
If you don't want to waste your time building everything from scratch probably it's better to use `binary-bootstrap`.
> Please note that the `package expression` must be properly defined to explicitly pick up
the package from the desired repository.
### Enabling distcc for distributed compilation
Setup the slaves (machines that will compile the code):
# xbps-install -Sy distcc
Enable and start the `distccd` service:
# ln -s /etc/sv/distccd /var/service
In the host (machine that executes xbps-src) enable the following settings in the `void-packages/etc/conf` file:
XBPS_DISTCC=yes
XBPS_DISTCC_HOSTS="192.168.2.101 192.168.2.102"
### Cross building packages for a target architecture
Currently `xbps-src` can cross build packages for some target architectures with a cross compiler. The supported target list is the following:
* i686 - for Linux i686 GNU.
* i686-musl - for Linux i686 Musl libc.
* armv6hf - for Linux ARMv6 EABI5 (LE Hard Float / GNU)
* armv6hf-musl - for Linux ARMv6 EABI5 (LE Hard Float / Musl libc)
* armv7hf - for Linux ARMv7 EABI5 (LE Hard Float / GNU)
* armv7hf-musl - for Linux ARMv7 EABI5 (LE Hard Float / Musl libc)
* mips - for Linux MIPS o32 (BE Soft Float / GNU)
* mipsel - for Linux MIPS o32 (LE Soft Float / GNU)
* x86_64-musl - for x86_64 Musl/Linux
If a source package has been adapted to be **cross buildable**`xbps-src` will automatically build the binary package(s) with a simple command:
$ ./xbps-src -a <target> pkg <pkgname>
If the build for whatever reason fails, might be a new build issue or simply because it hasn't been adapted to be **cross built**. Join #xbps on irc.freenode.net for more information.
### Using xbps-src in a foreign linux distribution
xbps-src can be used in any recent linux distribution matching the cpu architecture. At least a linux kernel 2.6.32 is required.
To use xbps-src in your linux distribution use the following instructions. Let's start downloading the xbps static binaries:
and `xbps-src` should be fully functional; just start the `bootstrap` process, i.e:
$ ./xbps-src binary-bootstrap
The default masterdir is created in the current working directory, i.e `void-packages/masterdir`.
### Remaking the masterdir
If for some reason you must update xbps-src and the `bootstrap-update` target is not enough, it's possible to recreate a masterdir with two simple commands (please note that `zap` keeps your `ccache/distcc/host` directories intact):
$ ./xbps-src zap
$ ./xbps-src binary-bootstrap
### Keeping your masterdir uptodate
Sometimes the bootstrap packages must be updated to the latest available version in repositories, this is accomplished with the `bootstrap-update` target:
$ ./xbps-src bootstrap-update
### Building i686/32bit packages on x86_64
A new x86 `masterdir` must be created to build 32bit packages:
Packages that are multilib only (32bit) must be built on a 32bit masterdir.
$ ./xbps-src -m masterdir-x86 ...
#### Building packages natively for the musl C library
A native build environment is required to be able to cross compile the bootstrap packages for the musl C library; this is accomplished by installing them via `binary-bootstrap`:
$ ./xbps-src binary-bootstrap
Now cross compile `base-chroot-musl` for your native architecture:
$ ./xbps-src -a x86_64-musl pkg base-chroot-musl
Wait until all packages are built and when ready, prepare a new masterdir with the musl packages: