LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

devtools

Arch Linux package building scripts

TLDR

Build a package in a clean chroot
$ extra-x86_64-build
copy
Build testing package
$ testing-x86_64-build
copy
Build staging package
$ staging-x86_64-build
copy
Create a clean chroot
$ mkarchroot [/path/to/chroot/root] base-devel
copy
Update packages in chroot
$ arch-nspawn [/path/to/chroot/root] pacman -Syu
copy
Run command in chroot
$ arch-nspawn [/path/to/chroot/root] [command]
copy
Sign a package
$ signpkg [package.pkg.tar.zst]
copy

SYNOPSIS

extra-x86_64-build [options]mkarchroot chroot packages...arch-nspawn chroot command

DESCRIPTION

devtools is a collection of tools used by Arch Linux developers and Trusted Users to build packages in clean chroot environments. It comes with a unified command-line frontend called pkgctl that aids to conveniently interact with all the different tools this collection provides.The build scripts (extra-x86_64-build, etc.) create isolated chroots matching official repository states, build packages, and verify the results. This guarantees packages work on fresh Arch installations.Additional tools help with package maintenance: finding dependencies, comparing versions, signing packages, and managing chroots.

CONFIGURATION

/etc/makepkg.conf

System-wide makepkg configuration affecting build behavior.
~/.makepkg.conf
User-specific makepkg overrides for package building.

BUILD COMMANDS

extra-x86_64-build

Build for extra repository.
testing-x86_64-build
Build for testing repository.
staging-x86_64-build
Build for staging repository.
multilib-build
Build 32-bit multilib packages.

CHROOT COMMANDS

mkarchroot path pkgs

Create a new chroot with specified packages.
arch-nspawn chroot cmd
Run command in existing chroot using nspawn.
makechrootpkg [options]
Build package in chroot.
makerepropkg [options]
Rebuild a package to check reproducibility.

PACKAGE TOOLS

signpkg pkg

Sign a package with GPG.
checkpkg
Compare package with repository version.
diffpkg pkg
Compare package files using different modes.
find-libdeps pkg
Find shared library dependencies.
find-libprovides pkg
Find sonames provided by a package.
lddd
Find broken library links on your system.
sogrep repo lib
Search for packages using a library.

CAVEATS

Requires sudo and systemd-nspawn. Initial chroot creation downloads the base system. Disk space needed for chroot (several GB). Build times depend on package complexity. Chroots should be updated before building.

HISTORY

devtools was developed by Arch Linux developers to standardize package building. The scripts evolved from manual processes into automated tools. Using clean chroots became mandatory for official Arch packages to ensure reproducibility. The tools have been refined over years of use by the Arch packaging community.

SEE ALSO

Copied to clipboard
Kai