wiki

Help! I'm trapped in a wiki!

Site Tools


distros:arch:arch_build_system

Arch build system

Tools for compiling packages from source into .pkg.tar.zst archives for use with pacman.
Each package has a git repository that includes a PKGBUILD and sometimes other files. Run makepkg to download, compile and package the sources. Then you can use pacman to install them.

PKGBUILD

A PKGBUILD file is just a bash script that specifies how to compile and package something. It's a collection of functions and variables parsed by makepkg.

Check out examples at /usr/share/pacman.
Use namcap to check for mistakes.

Definitive guide at https://wiki.archlinux.org/title/Arch_package_guidelines

makepkg

makepkg is a shell utility that reads the PKGBUILD and invokes the necesarry commands

You can speed up compilation by setting build directory in tmpfs with BUILDDIR=/tmp/makepkg makepkg

Build packages from source

An outline:

  1. Get PKGBUILD
    • Use pkgctl repo clone <pkgname>
    • Use git: git clone https://gitlab.archlinux.org/archlinux/packaging/packages/pkgname.git
  2. Build package
    • Copy the build dir and edit the PKGBUILD if needed
    • Build with makepkg
distros/arch/arch_build_system.txt · Last modified: by 127.0.0.1