Files
omarchy-pkgs/pkgbuilds/omarchy-dev/PKGBUILD
T
Ryan Hughes d87686ca4f Track upstream branches as pinned releases on an unattended lane
Since publishing moved to CI on merge, a package whose PKGBUILD never
changes while its source moves was never rebuilt: omarchy-dev and
omarchy-settings-dev followed quattro through "#branch=" and a pkgver()
function, and nothing in this repository changed when quattro did. The
host timers that used to notice are off, so edge fell days behind.

The rule now: no git source without a commit or tag pin
(tests/pinned-sources.sh, run in CI). A package that has to follow a
branch declares a git_branch upstream watch, and the pin moves through
the same PR/build/publish path as every other version bump.

Watch (helpers/upstream-watch.py)
  git_branch gains tag_pattern: the newest release tag in the pinned
  commit's own history, exposed as {tag}/{version}/{distance}, so a
  branch build is versioned <tag>.r<n>.g<sha>, above the release it
  follows and below the next one. One blobless clone per branch per
  run, shared by every package on it. min_release_age selects the
  newest commit older than the window, so a push burst builds once.

Lane (helpers/package-metadata.sh, bin/sync-upstream --lane)
  "auto_merge": true moves a package from the reviewed 6-hourly sync
  PR to the unattended lane. Packages pinned from the same branch move
  together: a failure on one restores the others and fails the group,
  so the dev pair can never ship from two quattro commits.

Tracker (.github/workflows/track-branches.yml)
  Every two hours: pin, open one PR with a GitHub App token, enable
  auto-merge. Branch protection still gates the merge on result,
  self-tests and build-isolation. A tip that fails to build stays an
  open red PR until the next tick supersedes it. The App is required:
  a PR opened with GITHUB_TOKEN has its checks held for approval and
  its auto-merge would not fire publish.yml.

The reviewed workflows (sync-upstream, sync-rebuilds) open their PRs
with the same App so their builds start without a maintainer clicking
"Approve workflows to run"; without the App they fall back to
GITHUB_TOKEN and behave as before.

Recipes
  The dev pair pins _commit and a real sha256sum, keeps the OMARCHY_SRC
  override, and drops pkgver(). Its r-number stays the branch's total
  commit count because the published history used it and pacman must
  never see the version go down. omasnap-git is new: omacom/omasnap
  main, versioned <tag>.r<distance>.g<sha>, provides/conflicts omasnap.
2026-09-27 12:39:53 -04:00

153 lines
5.5 KiB
Bash

# Maintainer: Ryan Hughes <ryan@omarchy.org>
pkgname='omarchy-dev'
pkgver=4.0.0.r6514.gee8ebf6
pkgrel=1
# Pinned by the upstream watch in .omarchy/package.json (bin/sync-upstream):
# every quattro tip becomes a commit pin here, so the package is versioned,
# checksummed and built exactly like a release, just more often. The r-number
# is the branch's total commit count, not the distance from the last tag: the
# published history used the total, and pacman must never see it go down.
_commit=ee8ebf615dcbf9e1a126b22a894f907d6795a9a5
pkgdesc='Beautiful, modern, and opinionated Arch Linux by DHH (quattro branch tip)'
# The payload is architecture-independent, but the dependency set is not: the
# boot stack differs per architecture (see depends_x86_64 / depends_aarch64),
# and makepkg only honours arch-suffixed arrays on arch-specific packages.
arch=('x86_64' 'aarch64')
url='https://github.com/basecamp/omarchy'
license=('MIT')
provides=('omarchy')
conflicts=('omarchy')
# Hard depends: only packages whose removal would brick the desktop. The ISO
# pacstraps the full default install set from install/omarchy-base.packages.
depends=(
# Omarchy meta
'omarchy-keyring'
'omarchy-settings-dev'
# Wayland / Hyprland core
'hyprland'
'quickshell'
'uwsm'
'sddm'
'xdg-desktop-portal-hyprland'
# Audio / auth / portal essentials
'wireplumber'
'pipewire'
'gnome-keyring'
# Required by omarchy-* scripts and omarchy-shell
'gum'
'jq'
'git'
'perl' # /usr/bin/omarchy-shell invokes perl directly
# Update availability checks (checkupdates from pacman-contrib uses fakeroot)
'fakeroot'
'pacman-contrib'
# System font (UI assumes it)
'ttf-jetbrains-mono-nerd-basic'
)
# Bootloader stack. Lives here rather than on omarchy-settings because
# omarchy-settings is also installed into the live ISO env (for plymouth
# / /etc/skel seeding), where the limine-mkinitcpio-hook would fail with
# 'Cannot detect an ESP path' inside the chroot. The omarchy-settings
# config drop-ins under /etc/mkinitcpio.conf.d/, /etc/limine-entry-tool.d/,
# and /etc/snapper/config-templates/ only do anything when these are
# installed alongside.
depends_x86_64=(
'limine'
'limine-mkinitcpio-hook'
'limine-snapper-sync'
'snapper'
)
# Apple Silicon boots through m1n1 + GRUB from the Asahi packages and keeps
# Arch Linux ARM's kernel and boot layout, so the Limine/Snapper stack does not
# apply. Wi-Fi on the Broadcom parts only scans reliably through the iwd
# backend, which install/hardware/network.sh selects on Apple Silicon.
depends_aarch64=(
'iwd'
'networkmanager'
)
makedepends=(
'git'
)
# Source: the pinned quattro commit. Set OMARCHY_SRC=/path/to/checkout to
# build from a local source tree instead (mirrors omarchy-zsh/omarchy-fish DX);
# the arrays are emptied below so nothing is downloaded in that case.
source=("omarchy::git+https://github.com/basecamp/omarchy.git#commit=${_commit}")
sha256sums=('4f55a96e32143c766f925ec7f721a374c32bd20e66f9a081f5dbe0772c609ecd')
if [[ -n "${OMARCHY_SRC:-}" ]]; then
source=()
sha256sums=()
fi
prepare() {
if [[ -n "${OMARCHY_SRC:-}" ]]; then
rm -rf "$srcdir/omarchy"
mkdir -p "$srcdir/omarchy"
cp -a "${OMARCHY_SRC}/." "$srcdir/omarchy/"
fi
}
package() {
cd "$srcdir/omarchy"
# Runtime binaries — ship everything in bin/ except the debug helpers
# that ship from omarchy-settings (needed before omarchy is installed,
# e.g. on the ISO live env).
install -d "$pkgdir/usr/bin" "$pkgdir/usr/share/omarchy/bin"
for bin in bin/*; do
[[ -f $bin ]] || continue
local base
base=$(basename "$bin")
case "$base" in
omarchy-debug|omarchy-debug-idle|omarchy-upload-log)
continue
;;
esac
install -Dm755 "$bin" "$pkgdir/usr/bin/$base"
ln -s "/usr/bin/$base" "$pkgdir/usr/share/omarchy/bin/$base"
done
install -d "$pkgdir/usr/share/omarchy"
# Guard direct pacman upgrades from bypassing the Omarchy update pipeline,
# and pause Hyprland live config reloads while settings files are replaced.
# Ship hooks with their Exec targets so package skew cannot leave a broken
# hook pointing at a missing binary.
install -Dm644 default/libalpm/hooks/00-omarchy-update-guard.hook "$pkgdir/usr/share/libalpm/hooks/00-omarchy-update-guard.hook"
install -Dm644 default/libalpm/hooks/10-omarchy-hyprland-reload-pause.hook "$pkgdir/usr/share/libalpm/hooks/10-omarchy-hyprland-reload-pause.hook"
install -Dm644 default/libalpm/hooks/90-omarchy-hyprland-reload-resume.hook "$pkgdir/usr/share/libalpm/hooks/90-omarchy-hyprland-reload-resume.hook"
# Target-side setup scripts and package lists used by ISO finalization,
# first login, future users, migrations, and reinstall/reset commands.
cp -a install "$pkgdir/usr/share/omarchy/"
# Theme bundles for theme switching.
cp -a themes "$pkgdir/usr/share/omarchy/"
# Versioned migrations runner reads from this tree.
cp -a migrations "$pkgdir/usr/share/omarchy/"
# Fresh users created after install are already on the package layout in this
# build, so seed migration markers through /etc/skel. Existing users keep
# their own state and still run pending migrations on update.
if compgen -G 'migrations/*.sh' >/dev/null; then
install -d "$pkgdir/etc/skel/.local/state/omarchy/migrations"
for migration in migrations/*.sh; do
touch "$pkgdir/etc/skel/.local/state/omarchy/migrations/$(basename "$migration")"
done
fi
# Quickshell desktop shell tree.
cp -a shell "$pkgdir/usr/share/omarchy/"
# Runtime version file.
install -Dm644 version "$pkgdir/usr/share/omarchy/version"
}