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

+7 -4
View File
@@ -1,7 +1,7 @@
pkgbase = zapzap-bin
pkgdesc = WhatsApp desktop client written in PyQt6 + PyQt6-WebEngine (prebuilt)
pkgdesc = WhatsApp desktop client written in PyQt6 + PyQt6-WebEngine (upstream wheel)
pkgver = 7.1
pkgrel = 1
pkgrel = 2
url = https://github.com/rafatosta/zapzap
arch = any
license = GPL-3.0-or-later
@@ -13,7 +13,10 @@ pkgbase = zapzap-bin
optdepends = hunspell: spell check
provides = zapzap
conflicts = zapzap
source = zapzap-bin-7.1-1.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/zapzap-bin-7.1/zapzap-bin-7.1.tar.zst
sha256sums = 0bfbdb0c034416e6f88751ddd2aa91a7ae41d61a2f32fc3c3676fa6d86fb0b72
noextract = zapzap-7.1-py3-none-any.whl
source = zapzap-7.1-py3-none-any.whl::https://github.com/rafatosta/zapzap/releases/download/7.1/zapzap-7.1-py3-none-any.whl
source = zapzap-bin-7.1-src.tar.gz::https://github.com/rafatosta/zapzap/archive/refs/tags/7.1.tar.gz
sha256sums = 2d05afbd547b46ef1d8d9503655198f6d82da66f4a380bfa229891b54de12f74
sha256sums = 5de324039932f189a97f2463cde75bda55a72150e67328876b5689bf0590f60a
pkgname = zapzap-bin
+40 -5
View File
@@ -4,8 +4,8 @@
pkgname=zapzap-bin
pkgver=7.1
pkgrel=1
pkgdesc="WhatsApp desktop client written in PyQt6 + PyQt6-WebEngine (prebuilt)"
pkgrel=2
pkgdesc="WhatsApp desktop client written in PyQt6 + PyQt6-WebEngine (upstream wheel)"
arch=('any')
url="https://github.com/rafatosta/zapzap"
license=('GPL-3.0-or-later')
@@ -14,9 +14,44 @@ depends=('python' 'python-pyqt6' 'python-pyqt6-webengine' 'python-dbus'
optdepends=('hunspell: spell check')
provides=('zapzap')
conflicts=('zapzap')
source=("${pkgname}-${pkgver}-${pkgrel}.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.zst")
sha256sums=('0bfbdb0c034416e6f88751ddd2aa91a7ae41d61a2f32fc3c3676fa6d86fb0b72')
source=("zapzap-${pkgver}-py3-none-any.whl::${url}/releases/download/${pkgver}/zapzap-${pkgver}-py3-none-any.whl"
"${pkgname}-${pkgver}-src.tar.gz::${url}/archive/refs/tags/${pkgver}.tar.gz")
noextract=("zapzap-${pkgver}-py3-none-any.whl")
sha256sums=('2d05afbd547b46ef1d8d9503655198f6d82da66f4a380bfa229891b54de12f74' '5de324039932f189a97f2463cde75bda55a72150e67328876b5689bf0590f60a')
package() {
cp -a "$srcdir/usr" "$pkgdir/"
local _entry _srctree="$srcdir/zapzap-${pkgver}"
# Upstream's wheel, unpacked into a fixed directory instead of
# site-packages: that path moves with every Python minor bump and would
# silently break a package that is only rebuilt on new upstream releases.
install -d "$pkgdir/usr/lib/zapzap"
bsdtar -xpf "$srcdir/zapzap-${pkgver}-py3-none-any.whl" -C "$pkgdir/usr/lib/zapzap"
# ... which also means the wheel's console script cannot be used
_entry="$(sed -n 's/^zapzap *= *//p' \
"$pkgdir/usr/lib/zapzap/zapzap-${pkgver}.dist-info/entry_points.txt")"
[[ -n "$_entry" ]] || { echo "no zapzap entry point in the wheel" >&2; return 1; }
install -d "$pkgdir/usr/bin"
cat > "$pkgdir/usr/bin/zapzap" << EOF
#!/usr/bin/python3
import sys
sys.path.insert(0, "/usr/lib/zapzap")
from ${_entry%%:*} import ${_entry#*:}
sys.exit(${_entry#*:}())
EOF
chmod 755 "$pkgdir/usr/bin/zapzap"
# icon, desktop file and metainfo are not part of the wheel
install -Dm644 "$_srctree/share/icons/com.rtosta.zapzap.svg" \
"$pkgdir/usr/share/icons/hicolor/scalable/apps/com.rtosta.zapzap.svg"
install -Dm644 "$_srctree/share/applications/com.rtosta.zapzap.desktop" \
"$pkgdir/usr/share/applications/com.rtosta.zapzap.desktop"
install -Dm644 "$_srctree/share/metainfo/com.rtosta.zapzap.appdata.xml" \
"$pkgdir/usr/share/metainfo/com.rtosta.zapzap.appdata.xml"
install -Dm644 "$pkgdir/usr/lib/zapzap/zapzap-${pkgver}.dist-info/licenses/LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
+17 -54
View File
@@ -1,65 +1,28 @@
# zapzap-bin - prebuilt package of https://github.com/rafatosta/zapzap
# (WhatsApp desktop client written in PyQt6 + PyQt6-WebEngine).
# zapzap-bin - ZapZap (https://github.com/rafatosta/zapzap), WhatsApp desktop
# client written in PyQt6 + PyQt6-WebEngine.
#
# Upstream ships deb/AppImage bundles that vendor all of Qt; instead we build
# the (pure-Python) wheel and install it against the system PyQt6 packages,
# like the AUR source package does.
# Upstream publishes a pure-Python wheel per release, which the PKGBUILD
# installs against the system PyQt6 packages - unlike upstream's deb/AppImage
# bundles, which vendor all of Qt. Icon, desktop file and metainfo are not
# part of the wheel and come from the matching source tag.
#
# Upstream tags carry no "v" prefix.
UPSTREAM_REPO="rafatosta/zapzap"
# Installed in CI (pacman) before build_artifact runs.
BUILD_DEPS=(python python-build python-installer python-setuptools python-wheel)
latest_version() {
gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//'
}
# build_artifact <version> <output-file>
build_artifact() {
local ver="$1" outfile="$2"
local workdir destdir srctree staging sitedir entry
workdir="$(mktemp -d)"
destdir="$(mktemp -d)"
staging="$(mktemp -d)"
# refresh_checksums <version> <pkgbuild-path>
refresh_checksums() {
local ver="$1" pkgbuild="$2"
local sha_whl sha_src
curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/$ver.tar.gz" | tar -xz -C "$workdir"
srctree="$workdir/zapzap-$ver"
sha_whl="$(curl -sfL "https://github.com/$UPSTREAM_REPO/releases/download/$ver/zapzap-$ver-py3-none-any.whl" \
| sha256sum | cut -d' ' -f1)"
sha_src="$(curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/$ver.tar.gz" \
| sha256sum | cut -d' ' -f1)"
(cd "$srctree" && python -m build --wheel --no-isolation)
python -m installer --destdir="$staging" "$srctree"/dist/*.whl
# The wheel installs into site-packages, whose path changes with every
# Python minor bump and would silently break a prebuilt package. Relocate
# to a fixed dir and use our own launcher instead of the generated console
# script (entry point parsed from pyproject.toml).
sitedir="$(find "$staging/usr/lib" -maxdepth 2 -type d -name site-packages)"
[[ -d "$sitedir/zapzap" ]] || { echo "zapzap module not found in $sitedir" >&2; return 1; }
mkdir -p "$destdir/usr/lib/zapzap"
mv "$sitedir/zapzap" "$sitedir"/zapzap-*.dist-info "$destdir/usr/lib/zapzap/"
entry="$(python -c "import tomllib; print(tomllib.load(open('$srctree/pyproject.toml','rb'))['project']['scripts']['zapzap'])")"
mkdir -p "$destdir/usr/bin"
cat > "$destdir/usr/bin/zapzap" << EOF
#!/usr/bin/python3
import sys
sys.path.insert(0, "/usr/lib/zapzap")
from ${entry%%:*} import ${entry#*:}
sys.exit(${entry#*:}())
EOF
chmod 755 "$destdir/usr/bin/zapzap"
# Icon, desktop file and metainfo are not part of the wheel.
install -Dm644 "$srctree/share/icons/com.rtosta.zapzap.svg" \
"$destdir/usr/share/icons/hicolor/scalable/apps/com.rtosta.zapzap.svg"
install -Dm644 "$srctree/share/applications/com.rtosta.zapzap.desktop" \
"$destdir/usr/share/applications/com.rtosta.zapzap.desktop"
install -Dm644 "$srctree/share/metainfo/com.rtosta.zapzap.appdata.xml" \
"$destdir/usr/share/metainfo/com.rtosta.zapzap.appdata.xml"
tar --zstd --sort=name --owner=0 --group=0 --numeric-owner --mtime='@0' \
-cf "$outfile" -C "$destdir" usr
rm -rf "$workdir" "$destdir" "$staging"
sed -i "s|^sha256sums=.*|sha256sums=('$sha_whl' '$sha_src')|" "$pkgbuild"
}