| name | aur-makepkg |
| description | Configure and use makepkg to build Arch Linux packages. Covers flags, options arrays, environment variables, and chroot builds. Use when building packages, troubleshooting build failures, or configuring build settings. |
| license | MIT |
Skill: aur-makepkg
Purpose
Build Arch Linux packages with makepkg, configure build options, and troubleshoot failures.
Basic Usage
makepkg
makepkg -s
makepkg -i
makepkg -r
makepkg --check
makepkg -o
makepkg -e
makepkg -c
makepkg --printsrcinfo
Options Array in PKGBUILD
options=('!emptydirs'
'!strip'
'!libtool'
'!ccache'
'zipman'
'!debug')
Environment Variables
PKGDEST=~/packages
SRCDEST=~/sources
SRCPKGDEST=~/srcpkg
MAKEFLAGS="-j$(nproc)"
Set in ~/.makepkg.conf (user) or /etc/makepkg.conf (system).
Chroot Builds
pkgctl build
Use chroot builds to verify the package builds from scratch in a clean environment.
Common Failures
- Missing deps: add to
makedepends or depends
- Network required at build: unacceptable for official repos; note in comments for AUR
- Outdated checksums: run
updpkgsums
- Parallel build failure: set
MAKEFLAGS="-j1" or add !parallelsmake to options
Reproducible Builds
makerepropkg *.pkg.tar.zst
repro -f *.pkg.tar.zst
If the build embeds timestamps, export SOURCE_DATE_EPOCH (UNIX epoch seconds) — see reproducible-builds.org.
Related
aur-pkgbuild — PKGBUILD structure
aur-audit — validation after build