This episode opens up Void's build system world: setting up xbps-src with binary-bootstrap, building packages from templates via xbps-src pkg, understanding the void-packages template structure, and how to install local packages and contribute to the repository.

Void doesn't only consume packages — it also gives you full control to build your own packages. Episode 15 covers xbps-src, Void's build system that works with the void-packages template repository. With it, you can assemble packages from source, install packages that aren't yet in the binary repository, and even contribute to the Void ecosystem.
xbps-src is one of Void's biggest differentiators. It provides a clean, isolated build environment, so packages are always built consistently and reproducibly.
Let's set up our build environment.
The first step is cloning the template repository:
git clone https://github.com/void-linux/void-packages.git
cd void-packagesvoid-packages contains thousands of package templates ready to build. Its main structure:
srcpkgs/<name>/template : build definition for each package
common/ : build helpers and functions
xbps-src : the build system's main scriptBefore the first build, run the bootstrap to prepare the required environment:
./xbps-src binary-bootstrapThe ./xbps-src binary-bootstrap command downloads the toolchain and base packages into the masterdir. This bootstrap is done once, unless the masterdir is deleted.
To build a package from a template:
./xbps-src pkg wgetThe ./xbps-src pkg wget command builds the wget package along with its dependencies into the hostdir/binpkgs directory. The result is a binary package you can install.
Use -j for parallel builds and -C to clean the masterdir:
./xbps-src -j$(nproc) -C pkg wgetClean up unused build results with:
./xbps-src cleanA template is a shell script containing metadata and build functions. A simple example:
pkgname=hello
version=2.12
revision=1
short_desc="Hello world example package"
maintainer="Arman Dwi Pangestu <arman@example.com>"
license="GPL-3.0-or-later"
homepage="https://www.gnu.org/software/hello"
distfiles="https://ftp.gnu.org/gnu/hello/hello-${version}.tar.gz"
checksum=cb62a6187a6e50a0e8a0d0b1f0b1b0b1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c
do_configure() {
./configure --prefix=/usr
}The key variables in a template are pkgname, version, short_desc, license, distfiles, and checksum.
Dependencies are split into depends, makedepends, and hostmakedepends:
depends : runtime
makedepends : build time
hostmakedepends : tools that run on the host during cross-compileFor example, a C package needs gcc in makedepends, while libfoo goes in depends.
Packages built in hostdir/binpkgs can be installed with XBPS:
./xbps-src install helloThe ./xbps-src install hello command builds and then installs the package into the active Void system. This is useful for testing a package before it's pushed to the repository.
If you want your package in the official repository, follow the contribution guide in CONTRIBUTING.md. The process in general:
./xbps-src pkg hello
./xbps-src chroot lintOnce all checks pass, open a Pull Request in the void-linux/void-packages repository. Community reviewers will inspect your template and build results.
Episode 15 opened up Void's build system world: setting up xbps-src with binary-bootstrap, building packages from templates with xbps-src pkg, understanding template structure like pkgname and checksum, installing local packages, and the path to contributing to void-packages.
Key takeaways:
void-packages is Void's package template repository../xbps-src binary-bootstrap prepares the build environment../xbps-src pkg <name> builds a package along with its dependencies.pkgname, version, distfiles, and checksum variables../xbps-src install.In the next episode, episode 16, we will cover backup, restore, and update — backing up data with rsync, leveraging Btrfs snapshots, tracking configuration changes with etckeeper, plus safe upgrade procedures and recovery from a rescue ISO.