Group A: source upstream binaries instead of self-built artifacts

The AUR does not allow packages to ship a binary tarball built by the
maintainer - a -bin package must repackage a deliverable published by
upstream. These six packages now do that:

  snapx-bin            upstream's self-contained Linux tar.zst
  zapzap-bin           upstream's pure-Python wheel
  faugus-launcher-bin  upstream's arch-independent .deb
  wiiudownloader-bin   upstream's AppImage
  waydroid-helper-bin  upstream's AppImage
  chiaki-ng-bin        upstream's AppImage

All six drop build_artifact() and switch to refresh_checksums(), so CI no
longer builds or hosts anything - it only tracks upstream's assets.

Where the asset name carries build metadata that does not follow from
pkgver (snapx, faugus-launcher), refresh_checksums() resolves it via the
GitHub API and syncs an _asset variable in the PKGBUILD.

Dependency lists are re-derived from what the bundles actually resolve
outside themselves; the AppImage payloads land in /opt with wrappers in
/usr/bin, because their entry points resolve paths relative to argv[0].
This commit is contained in:
Felitendo committed 2026-07-27 17:40:53 +02:00
1 parent c25c2790e8
commit fa1c190d17
19 files changed
+428 -379

No files matched your search

+6 -3
View File
@@ -1,7 +1,7 @@
pkgbase = snapx-bin
pkgdesc = Screenshot tool that handles images, text, and video - ShareX fork, Avalonia UI (upstream binary)
pkgver = 0.4.0
pkgrel = 1
pkgrel = 2
url = https://github.com/SnapXL/SnapX
arch = x86_64
license = GPL-3.0-or-later
@@ -10,9 +10,12 @@ pkgbase = snapx-bin
depends = hicolor-icon-theme
provides = snapx-ui
conflicts = snapx-ui
noextract = snapx-bin-0.4.0.tar.zst
options = !strip
options = !debug
source = snapx-bin-0.4.0-1.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/snapx-bin-0.4.0/snapx-bin-0.4.0.tar.zst
sha256sums = d2098cac542bca82e68be0a4fa98db22f2d84d35c683d18582382dc9206eb5ee
source = snapx-bin-0.4.0.tar.zst::https://github.com/SnapXL/SnapX/releases/download/v0.4.0/SnapX-UI-Release-Linux-0.4.0-alpha.0+g7eafb0f-X64.tar.zst
source = snapx-bin-0.4.0-src.tar.gz::https://github.com/SnapXL/SnapX/archive/refs/tags/v0.4.0.tar.gz
sha256sums = 1cbecd1caca21e611030eedbb8e5a43cc4bf62d55cfa56a2e5c2ac31b3d21e35
sha256sums = d85f4d2c3ea55ed5040f166fdf44ce03dd0270dc6ab05ee26771dbd02eaacc06
pkgname = snapx-bin
+27 -5
View File
@@ -4,7 +4,7 @@
pkgname=snapx-bin
pkgver=0.4.0
pkgrel=1
pkgrel=2
pkgdesc="Screenshot tool that handles images, text, and video - ShareX fork, Avalonia UI (upstream binary)"
arch=('x86_64')
url="https://github.com/SnapXL/SnapX"
@@ -13,10 +13,32 @@ depends=('glibc' 'gcc-libs' 'hicolor-icon-theme')
provides=('snapx-ui')
conflicts=('snapx-ui')
options=('!strip' '!debug')
source=("${pkgname}-${pkgver}-${pkgrel}.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.zst")
sha256sums=('d2098cac542bca82e68be0a4fa98db22f2d84d35c683d18582382dc9206eb5ee')
# Upstream asset names embed build metadata that cannot be derived from
# pkgver, so the exact name is tracked here and refreshed automatically.
_asset="SnapX-UI-Release-Linux-0.4.0-alpha.0+g7eafb0f-X64.tar.zst"
source=("${pkgname}-${pkgver}.tar.zst::${url}/releases/download/v${pkgver}/${_asset}"
"${pkgname}-${pkgver}-src.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
noextract=("${pkgname}-${pkgver}.tar.zst")
sha256sums=('1cbecd1caca21e611030eedbb8e5a43cc4bf62d55cfa56a2e5c2ac31b3d21e35' 'd85f4d2c3ea55ed5040f166fdf44ce03dd0270dc6ab05ee26771dbd02eaacc06')
package() {
cp -a "$srcdir/usr" "$pkgdir/"
cp -a "$srcdir/opt" "$pkgdir/"
# upstream's self-contained bundle, installed unchanged
install -d "$pkgdir/opt/snapx"
bsdtar -xpf "$srcdir/${pkgname}-${pkgver}.tar.zst" -C "$pkgdir/opt/snapx"
chmod 755 "$pkgdir/opt/snapx/snapx-ui"
# upstream's launcher resolves its own directory, so a symlink from
# /usr/bin would break it - use a wrapper instead
install -d "$pkgdir/usr/bin"
cat > "$pkgdir/usr/bin/snapx-ui" << 'EOF'
#!/bin/sh
exec /opt/snapx/snapx-ui "$@"
EOF
chmod 755 "$pkgdir/usr/bin/snapx-ui"
# desktop entry, icons and metainfo ship in the source tree only
cp -a "$srcdir/SnapX-${pkgver}/packaging/usr/share" "$pkgdir/usr/"
install -Dm644 "$pkgdir/opt/snapx/LICENSE.md" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
}
+19 -35
View File
@@ -1,52 +1,36 @@
# snapx-bin - SnapX (https://github.com/SnapXL/SnapX), screenshot/sharing
# tool forked from ShareX, C#/.NET Avalonia UI.
#
# Upstream ships a self-contained Linux bundle per (pre)release, but the
# asset names embed build metadata (e.g. ...-0.4.0-alpha.0+g7eafb0f-X64...)
# that cannot be derived from the version alone. build_artifact() therefore
# resolves the asset by pattern via the GitHub API and repackages it under
# our own predictable name. All upstream releases are marked prerelease, so
# latest_version() reads the release list instead of /latest.
# Upstream ships a self-contained Linux bundle per (pre)release which the
# PKGBUILD installs unchanged. The asset names embed build metadata
# (e.g. ...-0.4.0-alpha.0+g7eafb0f-X64...) that cannot be derived from the
# version alone, so refresh_checksums() resolves the asset via the GitHub API
# and syncs the _asset variable in the PKGBUILD along with the checksums.
# All upstream releases are marked prerelease, so latest_version() reads the
# release list instead of /latest.
UPSTREAM_REPO="SnapXL/SnapX"
BUILD_DEPS=()
latest_version() {
gh api "repos/$UPSTREAM_REPO/releases" --jq '.[0].tag_name' | sed 's/^v//'
}
# build_artifact <version> <output-file>
build_artifact() {
local ver="$1" outfile="$2"
local workdir destdir asset
workdir="$(mktemp -d)"
destdir="$(mktemp -d)"
# refresh_checksums <version> <pkgbuild-path>
refresh_checksums() {
local ver="$1" pkgbuild="$2"
local asset sha_bin sha_src
asset="$(gh api "repos/$UPSTREAM_REPO/releases/tags/v$ver" --jq '.assets[].name' \
| grep '^SnapX-UI-Release-Linux-' | grep -v musl | grep -- '-X64\.tar\.zst$')"
[[ "$(wc -l <<< "$asset")" -eq 1 ]] || { echo "expected exactly one UI asset, got: $asset" >&2; return 1; }
gh release download "v$ver" -R "$UPSTREAM_REPO" --pattern "$asset" --dir "$workdir"
mkdir -p "$destdir/opt/snapx"
tar -xf "$workdir/$asset" -C "$destdir/opt/snapx"
chmod 755 "$destdir/opt/snapx/snapx-ui"
sha_bin="$(curl -sfL "https://github.com/$UPSTREAM_REPO/releases/download/v$ver/$asset" \
| sha256sum | cut -d' ' -f1)"
sha_src="$(curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/v$ver.tar.gz" \
| sha256sum | cut -d' ' -f1)"
# upstream's launcher resolves its own directory, so a symlink from
# /usr/bin would break it - use a wrapper instead
mkdir -p "$destdir/usr/bin"
cat > "$destdir/usr/bin/snapx-ui" << 'EOF'
#!/bin/sh
exec /opt/snapx/snapx-ui "$@"
EOF
chmod 755 "$destdir/usr/bin/snapx-ui"
# desktop file, icons and metainfo from the source tree
curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/v$ver.tar.gz" | tar -xz -C "$workdir"
cp -a "$workdir/SnapX-$ver/packaging/usr/share" "$destdir/usr/"
tar --zstd --sort=name --owner=0 --group=0 --numeric-owner --mtime='@0' \
-cf "$outfile" -C "$destdir" usr opt
rm -rf "$workdir" "$destdir"
sed -i \
-e "s|^_asset=.*|_asset=\"$asset\"|" \
-e "s|^sha256sums=.*|sha256sums=('$sha_bin' '$sha_src')|" \
"$pkgbuild"
}