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.
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 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
An outline:
pkgctl repo clone <pkgname>git clone https://gitlab.archlinux.org/archlinux/packaging/packages/pkgname.git