Files
sunstone/packaging/arch/build-local.sh
T
enki af08e5ced2 Add local Arch package build helper
- packaging/arch/build-local.sh: build a native .pkg.tar.zst from the
  current git HEAD without needing a published forge release (tarballs
  the checkout and runs makepkg --nodeps with the existing PKGBUILD).
- .gitignore: ignore dist/ (local package output).
- sunstone-gtk: drop invalid `margin: 0 auto` on .kind-badge children;
  GTK CSS rejects `auto` for margin, which logged a parse warning. The
  value was already being ignored, so rendering is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 23:58:13 -07:00

41 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build a native Arch package (.pkg.tar.zst) from the current git HEAD, without
# needing a published forge release. Uses the same recipe as ./PKGBUILD but
# sources a tarball of the local checkout instead of downloading from the forge.
#
# Usage: packaging/arch/build-local.sh
# Output: dist/sunstone-<ver>-<rel>-x86_64.pkg.tar.zst (in the repo root)
#
# Install the result with: sudo pacman -U dist/sunstone-*.pkg.tar.zst
set -euo pipefail
repo_root="$(git -C "$(dirname "$0")" rev-parse --show-toplevel)"
pkgbuild="$repo_root/packaging/arch/PKGBUILD"
ver="$(awk -F\" '/^version = / {print $2; exit}' "$repo_root/Cargo.toml")"
distdir="$repo_root/dist"
workdir="$(mktemp -d)"
trap 'rm -rf "$workdir"' EXIT
echo ">> Packaging sunstone $ver from $(git -C "$repo_root" rev-parse --short HEAD)"
# tracked files only, extracted under sunstone/ to match _srcdir in PKGBUILD.
git -C "$repo_root" archive --format=tar.gz --prefix="sunstone/" \
-o "$workdir/sunstone-$ver.tar.gz" HEAD
# Local PKGBUILD: pin pkgver + swap the forge source for the local tarball.
sed -e "s|^pkgver=.*|pkgver=$ver|" \
-e "s|^source=.*|source=(\"sunstone-\$pkgver.tar.gz\")|" \
"$pkgbuild" > "$workdir/PKGBUILD"
# --nodeps: skip makepkg's install-check of runtime deps (gst plugins etc.) —
# they're declared in the package but needn't be installed on the build host.
# Build-time libs are checked separately by the compile itself.
( cd "$workdir" && makepkg -f --nodeps )
mkdir -p "$distdir"
cp -f "$workdir"/*.pkg.tar.* "$distdir"/
echo
echo ">> Built:"
ls -1 "$distdir"/*.pkg.tar.*