Skip to content

enihcam/aur-skills / skills/aur-makepkg

aur-makepkg

Verified

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.

FileKindSize
SKILL.mdskill md2.5 KB
---
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

```bash
makepkg                 # build package
makepkg -s              # sync + install dependencies
makepkg -i              # build + install
makepkg -r              # clean after build
makepkg --check         # run check() function
makepkg -o              # download + prepare only
makepkg -e              # skip extract, resume build
makepkg -c              # clean up leftover files
makepkg --printsrcinfo  # generate .SRCINFO
```

## Options Array in PKGBUILD

```bash
options=('!emptydirs'   # remove empty dirs (default: keep)
         '!strip'       # keep debug symbols (default: strip)
         '!libtool'     # remove .la files (default: keep)
         '!ccache'      # disable ccache (default: use if installed)
         'zipman'       # compress man pages
         '!debug')      # disable debug package
```

## Environment Variables

```bash
PKGDEST=~/packages      # where .pkg.tar.zst files go
SRCDEST=~/sources       # where downloaded sources are cached
SRCPKGDEST=~/srcpkg     # where .src.tar.gz goes
MAKEFLAGS="-j$(nproc)"  # parallel build jobs
```

Set in `~/.makepkg.conf` (user) or `/etc/makepkg.conf` (system).

## Chroot Builds

```bash
pkgctl build            # builds in clean chroot via systemd-nspawn
```

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"` for the build, or add `!makeflags` to `options` so the PKGBUILD ignores user `MAKEFLAGS`

## Reproducible Builds

```bash
makerepropkg *.pkg.tar.zst   # from devtools — verify a package is reproducible
repro -f *.pkg.tar.zst       # from archlinux-repro
```

If the build embeds timestamps, export `SOURCE_DATE_EPOCH` (UNIX epoch seconds) — see [reproducible-builds.org](https://reproducible-builds.org/docs/source-date-epoch/).

## Related

- `aur-pkgbuild` — PKGBUILD structure
- `aur-audit` — validation after build
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall