From fa1c190d1709223b28a1cdf6470f00736ba59349 Mon Sep 17 00:00:00 2001 From: Felitendo <95575686+Felitendo@users.noreply.github.com> Date: Mon, 27 Jul 2026 17:40:53 +0200 Subject: [PATCH] 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]. --- chiaki-ng-bin/.SRCINFO | 50 ++++++++++--------- chiaki-ng-bin/PKGBUILD | 56 +++++++++++++++++---- chiaki-ng-bin/Qt6GuiPrivate-fix.patch | 18 ------- chiaki-ng-bin/pkg.sh | 64 ++++++------------------ faugus-launcher-bin/.SRCINFO | 9 ++-- faugus-launcher-bin/PKGBUILD | 52 ++++++++++++++++++-- faugus-launcher-bin/pkg.sh | 64 +++++++++--------------- snapx-bin/.SRCINFO | 9 ++-- snapx-bin/PKGBUILD | 32 ++++++++++-- snapx-bin/pkg.sh | 54 +++++++------------- waydroid-helper-bin/.SRCINFO | 31 +++++------- waydroid-helper-bin/PKGBUILD | 70 ++++++++++++++++++++++---- waydroid-helper-bin/pkg.sh | 43 +++++----------- wiiudownloader-bin/.SRCINFO | 27 ++++++---- wiiudownloader-bin/PKGBUILD | 42 +++++++++++++--- wiiudownloader-bin/pkg.sh | 59 +++++----------------- zapzap-bin/.SRCINFO | 11 +++-- zapzap-bin/PKGBUILD | 45 +++++++++++++++-- zapzap-bin/pkg.sh | 71 +++++++-------------------- 19 files changed, 428 insertions(+), 379 deletions(-) delete mode 100644 chiaki-ng-bin/Qt6GuiPrivate-fix.patch diff --git a/chiaki-ng-bin/.SRCINFO b/chiaki-ng-bin/.SRCINFO index 02d8f9d..defe35c 100644 --- a/chiaki-ng-bin/.SRCINFO +++ b/chiaki-ng-bin/.SRCINFO @@ -1,32 +1,29 @@ pkgbase = chiaki-ng-bin - pkgdesc = Free and Open Source PlayStation Remote Play client (prebuilt) + pkgdesc = Free and Open Source PlayStation Remote Play client (upstream AppImage) pkgver = 1.10.0 - pkgrel = 1 + pkgrel = 2 url = https://streetpea.github.io/chiaki-ng/ arch = x86_64 license = LicenseRef-AGPL-3.0-only-OpenSSL - depends = curl - depends = ffmpeg - depends = fftw - depends = gcc-libs depends = glibc - depends = hicolor-icon-theme - depends = hidapi - depends = json-c - depends = libidn2 - depends = libplacebo - depends = libpsl - depends = libssh2 - depends = miniupnpc - depends = openssl - depends = opus - depends = qt6-base - depends = qt6-declarative - depends = qt6-svg - depends = qt6-webengine - depends = sdl2 - depends = speexdsp + depends = gcc-libs depends = zlib + depends = bzip2 + depends = brotli + depends = expat + depends = libgpg-error + depends = e2fsprogs + depends = fontconfig + depends = freetype2 + depends = alsa-lib + depends = libx11 + depends = libxcb + depends = libdrm + depends = libva + depends = libglvnd + depends = mesa + depends = vulkan-icd-loader + depends = hicolor-icon-theme optdepends = intel-media-driver: vaapi backend for Intel GPUs [>= Broadwell] optdepends = libva-intel-driver: vaapi backend for Intel GPUs [<= Haswell] optdepends = libva-mesa-driver: vaapi backend for AMD GPUs @@ -34,7 +31,12 @@ pkgbase = chiaki-ng-bin provides = chiaki conflicts = chiaki-ng conflicts = chiaki - source = chiaki-ng-bin-1.10.0-1.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/chiaki-ng-bin-1.10.0/chiaki-ng-bin-1.10.0.tar.zst - sha256sums = 76c55be0342c651a65ffe5df5ed14930d43b844590cac9f4ea67d23e80557599 + noextract = chiaki-ng-bin-1.10.0.AppImage + options = !strip + options = !debug + source = chiaki-ng-bin-1.10.0.AppImage::https://github.com/streetpea/chiaki-ng/releases/download/v1.10.0/chiaki-ng.AppImage_x86_64 + source = COPYING-1.10.0::https://raw.githubusercontent.com/streetpea/chiaki-ng/v1.10.0/COPYING + sha256sums = cac42c21a19a111f2f0729bb9eef7d3878c6d2a4f06e017d383aff2aba719fd3 + sha256sums = fff3acb5eddbde97746cc1ad2082a1e95f50c2315a8748b26b8a81a499d8d216 pkgname = chiaki-ng-bin diff --git a/chiaki-ng-bin/PKGBUILD b/chiaki-ng-bin/PKGBUILD index 2974619..f61f6c0 100644 --- a/chiaki-ng-bin/PKGBUILD +++ b/chiaki-ng-bin/PKGBUILD @@ -4,23 +4,61 @@ pkgname=chiaki-ng-bin pkgver=1.10.0 -pkgrel=1 -pkgdesc="Free and Open Source PlayStation Remote Play client (prebuilt)" +pkgrel=2 +pkgdesc="Free and Open Source PlayStation Remote Play client (upstream AppImage)" arch=('x86_64') url="https://streetpea.github.io/chiaki-ng/" license=('LicenseRef-AGPL-3.0-only-OpenSSL') -depends=('curl' 'ffmpeg' 'fftw' 'gcc-libs' 'glibc' 'hicolor-icon-theme' - 'hidapi' 'json-c' 'libidn2' 'libplacebo' 'libpsl' 'libssh2' - 'miniupnpc' 'openssl' 'opus' 'qt6-base' 'qt6-declarative' 'qt6-svg' - 'qt6-webengine' 'sdl2' 'speexdsp' 'zlib') +# the AppImage bundles Qt6, ffmpeg, SDL and the rest of the stack; these are +# what is left over +depends=('glibc' 'gcc-libs' 'zlib' 'bzip2' 'brotli' 'expat' 'libgpg-error' + 'e2fsprogs' 'fontconfig' 'freetype2' 'alsa-lib' 'libx11' 'libxcb' + 'libdrm' 'libva' 'libglvnd' 'mesa' 'vulkan-icd-loader' + 'hicolor-icon-theme') optdepends=('intel-media-driver: vaapi backend for Intel GPUs [>= Broadwell]' 'libva-intel-driver: vaapi backend for Intel GPUs [<= Haswell]' 'libva-mesa-driver: vaapi backend for AMD GPUs') provides=('chiaki-ng' 'chiaki') conflicts=('chiaki-ng' 'chiaki') -source=("${pkgname}-${pkgver}-${pkgrel}.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.zst") -sha256sums=('76c55be0342c651a65ffe5df5ed14930d43b844590cac9f4ea67d23e80557599') +options=('!strip' '!debug') +source=("${pkgname}-${pkgver}.AppImage::https://github.com/streetpea/chiaki-ng/releases/download/v${pkgver}/chiaki-ng.AppImage_x86_64" + "COPYING-${pkgver}::https://raw.githubusercontent.com/streetpea/chiaki-ng/v${pkgver}/COPYING") +noextract=("${pkgname}-${pkgver}.AppImage") +sha256sums=('cac42c21a19a111f2f0729bb9eef7d3878c6d2a4f06e017d383aff2aba719fd3' 'fff3acb5eddbde97746cc1ad2082a1e95f50c2315a8748b26b8a81a499d8d216') + +prepare() { + chmod +x "$srcdir/${pkgname}-${pkgver}.AppImage" + "$srcdir/${pkgname}-${pkgver}.AppImage" --appimage-extract > /dev/null +} package() { - cp -a "$srcdir/usr" "$pkgdir/" + local _root="$srcdir/squashfs-root" + + # upstream's AppImage payload, installed unchanged + install -d "$pkgdir/opt/$pkgname" + cp -a "$_root/." "$pkgdir/opt/$pkgname/" + rm -f "$pkgdir/opt/$pkgname/.DirIcon" + + # the binaries carry a RUNPATH into the bundle and read the qt.conf next to + # them, so they have to be exec'd where they are + install -d "$pkgdir/usr/bin" + local _bin + for _bin in chiaki chiaki-cli; do + cat > "$pkgdir/usr/bin/$_bin" << EOF +#!/bin/sh +exec /opt/$pkgname/usr/bin/$_bin "\$@" +EOF + chmod 755 "$pkgdir/usr/bin/$_bin" + done + + install -Dm644 "$_root/usr/share/applications/chiaking.desktop" \ + "$pkgdir/usr/share/applications/chiaking.desktop" + install -Dm644 "$_root/usr/share/metainfo/io.github.streetpea.Chiaki4deck.appdata.xml" \ + "$pkgdir/usr/share/metainfo/io.github.streetpea.Chiaki4deck.appdata.xml" + install -Dm644 "$_root/usr/share/icons/hicolor/512x512/apps/chiaking.png" \ + "$pkgdir/usr/share/icons/hicolor/512x512/apps/chiaking.png" + + # AGPL-3.0-only-OpenSSL is not a common license, ship the text + install -Dm644 "$srcdir/COPYING-${pkgver}" \ + "$pkgdir/usr/share/licenses/$pkgname/COPYING" } diff --git a/chiaki-ng-bin/Qt6GuiPrivate-fix.patch b/chiaki-ng-bin/Qt6GuiPrivate-fix.patch deleted file mode 100644 index bc90278..0000000 --- a/chiaki-ng-bin/Qt6GuiPrivate-fix.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/gui/CMakeLists.txt 2025-10-11 20:52:37.048868767 +0100 -+++ b/gui/CMakeLists.txt 2025-10-11 20:52:42.506427662 +0100 -@@ -7,7 +7,7 @@ - enable_language(OBJCXX) - endif() - --find_package(Qt6 REQUIRED COMPONENTS Core Gui Concurrent Svg Qml Quick Widgets) -+find_package(Qt6 REQUIRED COMPONENTS Core Gui Concurrent Svg Qml Quick Widgets GuiPrivate) - find_package(Qt6 COMPONENTS WebEngineQuick) - find_package(Qt6 COMPONENTS DBus) - -@@ -154,4 +154,4 @@ - BUNDLE DESTINATION bin) - install(FILES chiaking.desktop DESTINATION share/applications) - install(FILES chiaking.png DESTINATION share/icons/hicolor/512x512/apps) --install(FILES io.github.streetpea.Chiaki4deck.appdata.xml DESTINATION share/metainfo) -\ No newline at end of file -+install(FILES io.github.streetpea.Chiaki4deck.appdata.xml DESTINATION share/metainfo) diff --git a/chiaki-ng-bin/pkg.sh b/chiaki-ng-bin/pkg.sh index b794dda..d4e700f 100644 --- a/chiaki-ng-bin/pkg.sh +++ b/chiaki-ng-bin/pkg.sh @@ -1,60 +1,26 @@ -# chiaki-ng-bin - prebuilt package of https://github.com/streetpea/chiaki-ng -# (free PlayStation Remote Play client, C/C++ + Qt6). +# chiaki-ng-bin - chiaki-ng (https://github.com/streetpea/chiaki-ng), a free +# PlayStation Remote Play client (C/C++ + Qt6). # -# Upstream ships no plain Linux binaries (only AppImage/flatpak), so -# build_artifact() builds from a git checkout of the release tag (the source -# tarballs lack the required submodules). Mirrors the AUR source package: -# system curl instead of the vendored submodule, plus the Qt6GuiPrivate -# CMake fix carried in this directory. +# Upstream publishes an AppImage per release, which the PKGBUILD unpacks and +# installs into /opt - so there is no build step here, only pkgver and the +# checksums are refreshed on a new version. The license texts are not part of +# the AppImage and come from the matching source tag. UPSTREAM_REPO="streetpea/chiaki-ng" -# Installed in CI (pacman) before build_artifact runs. -BUILD_DEPS=(cmake git python-protobuf python-setuptools protobuf - vulkan-headers qt6-base qt6-declarative qt6-svg qt6-webengine - sdl2 ffmpeg fftw hidapi json-c libplacebo miniupnpc opus speexdsp - openssl curl libssh2) - latest_version() { gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//' } -# build_artifact -build_artifact() { - local ver="$1" outfile="$2" - local pkgdir workdir destdir srctree - pkgdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - workdir="$(mktemp -d)" - destdir="$(mktemp -d)" - srctree="$workdir/src" +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local sha_img sha_lic - git clone --branch "v$ver" --depth 1 "https://github.com/$UPSTREAM_REPO.git" "$srctree" + sha_img="$(curl -sfL "https://github.com/$UPSTREAM_REPO/releases/download/v$ver/chiaki-ng.AppImage_x86_64" \ + | sha256sum | cut -d' ' -f1)" + sha_lic="$(curl -sfL "https://raw.githubusercontent.com/$UPSTREAM_REPO/v$ver/COPYING" \ + | sha256sum | cut -d' ' -f1)" - # use the system curl instead of the vendored submodule - git -C "$srctree" rm -q third-party/curl - sed -i 's:libcurl_shared:libcurl:' "$srctree/lib/CMakeLists.txt" - # newer tags (>= 1.10.0) carry the GuiPrivate fix themselves - if ! grep -q 'GuiPrivate' "$srctree/gui/CMakeLists.txt"; then - patch -d "$srctree" -p1 < "$pkgdir/Qt6GuiPrivate-fix.patch" - fi - git -C "$srctree" submodule update --init - - CFLAGS="${CFLAGS:-} -std=gnu17" cmake -B "$workdir/build" -S "$srctree" -Wno-dev \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCHIAKI_USE_SYSTEM_CURL=ON - cmake --build "$workdir/build" -j"$(nproc)" - DESTDIR="$destdir" cmake --install "$workdir/build" - - # AGPL-3.0-only-OpenSSL: not a common license, ship the texts - mkdir -p "$destdir/usr/share/licenses/chiaki-ng-bin" - install -m644 "$srctree/LICENSES/"* "$destdir/usr/share/licenses/chiaki-ng-bin/" - - rm -f "$destdir/usr/share/applications/mimeinfo.cache" \ - "$destdir/usr/share/icons/hicolor/icon-theme.cache" - - tar --zstd --sort=name --owner=0 --group=0 --numeric-owner --mtime='@0' \ - -cf "$outfile" -C "$destdir" usr - - rm -rf "$workdir" "$destdir" + sed -i "s|^sha256sums=.*|sha256sums=('$sha_img' '$sha_lic')|" "$pkgbuild" } diff --git a/faugus-launcher-bin/.SRCINFO b/faugus-launcher-bin/.SRCINFO index 7105fb9..f35c3db 100644 --- a/faugus-launcher-bin/.SRCINFO +++ b/faugus-launcher-bin/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = faugus-launcher-bin - pkgdesc = Simple and lightweight app for running Windows games using UMU-Launcher (prebuilt) + pkgdesc = Simple and lightweight app for running Windows games using UMU-Launcher (upstream binary) pkgver = 2.0.2 - pkgrel = 1 + pkgrel = 2 url = https://github.com/Faugus/faugus-launcher arch = any license = MIT @@ -21,7 +21,8 @@ pkgbase = faugus-launcher-bin optdepends = gamemode: feral gamemode integration provides = faugus-launcher conflicts = faugus-launcher - source = faugus-launcher-bin-2.0.2-1.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/faugus-launcher-bin-2.0.2/faugus-launcher-bin-2.0.2.tar.zst - sha256sums = 5fcf441cccb1ccc0ac554760e93744d557fd05a3fc4335132a59e55aefe902af + noextract = faugus-launcher-bin-2.0.2.deb + source = faugus-launcher-bin-2.0.2.deb::https://github.com/Faugus/faugus-launcher/releases/download/2.0.2/faugus-launcher_2.0.2-1_all.deb + sha256sums = c694d85af50cdc5fc6fbd50453075b799d5a458cc0bd123abe31aafde8cdc6fa pkgname = faugus-launcher-bin diff --git a/faugus-launcher-bin/PKGBUILD b/faugus-launcher-bin/PKGBUILD index b1baee3..3650271 100644 --- a/faugus-launcher-bin/PKGBUILD +++ b/faugus-launcher-bin/PKGBUILD @@ -4,8 +4,8 @@ pkgname=faugus-launcher-bin pkgver=2.0.2 -pkgrel=1 -pkgdesc="Simple and lightweight app for running Windows games using UMU-Launcher (prebuilt)" +pkgrel=2 +pkgdesc="Simple and lightweight app for running Windows games using UMU-Launcher (upstream binary)" arch=('any') url="https://github.com/Faugus/faugus-launcher" license=('MIT') @@ -16,9 +16,51 @@ optdepends=('mangohud: performance overlay' 'gamemode: feral gamemode integration') provides=('faugus-launcher') conflicts=('faugus-launcher') -source=("${pkgname}-${pkgver}-${pkgrel}.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.zst") -sha256sums=('5fcf441cccb1ccc0ac554760e93744d557fd05a3fc4335132a59e55aefe902af') +# The Debian revision in the asset name does not follow from pkgver, so the +# exact name is tracked here and refreshed automatically. +_asset="faugus-launcher_2.0.2-1_all.deb" +source=("${pkgname}-${pkgver}.deb::${url}/releases/download/${pkgver}/${_asset}") +noextract=("${pkgname}-${pkgver}.deb") +sha256sums=('c694d85af50cdc5fc6fbd50453075b799d5a458cc0bd123abe31aafde8cdc6fa') package() { - cp -a "$srcdir/usr" "$pkgdir/" + local _deb="$srcdir/deb" + + install -d "$_deb" + bsdtar -xOf "$srcdir/${pkgname}-${pkgver}.deb" 'data.tar.*' \ + | bsdtar -xpf - -C "$_deb" ./usr + + # Debian puts the modules in dist-packages, which is not on Arch's + # sys.path. A fixed private directory also keeps the package working + # across Python minor bumps, since it is only rebuilt for new releases. + install -d "$pkgdir/usr/lib/faugus-launcher" + cp -a "$_deb/usr/lib/python3/dist-packages/faugus" "$pkgdir/usr/lib/faugus-launcher/" + # .pyc compiled for Debian's Python, useless here + find "$pkgdir/usr/lib/faugus-launcher" -type d -name __pycache__ -exec rm -rf {} + + + cp -a "$_deb/usr/share" "$pkgdir/usr/" + # generated by pacman hooks; shipping them would cause file conflicts + rm -f "$pkgdir/usr/share/applications/mimeinfo.cache" \ + "$pkgdir/usr/share/icons/hicolor/icon-theme.cache" + + # upstream's wrapper relies on Debian's default sys.path, ours points at + # the directory above; the rest matches upstream verbatim + install -d "$pkgdir/usr/bin" + cat > "$pkgdir/usr/bin/faugus-launcher" << 'EOF' +#!/bin/sh + +export PYTHONPATH="/usr/lib/faugus-launcher${PYTHONPATH:+:$PYTHONPATH}" +export GTK_IM_MODULE="${GTK_IM_MODULE:-simple}" + +case "$1" in + --shortcut) exec /usr/bin/python3 -m faugus.shortcut "$2";; + --game) exec /usr/bin/python3 -m faugus.runner --game "$2";; + --run) msg="$2"; shift 2; exec /usr/bin/python3 -m faugus.runner "$msg" "$@";; + *) exec /usr/bin/python3 -m faugus.launcher "$@";; +esac +EOF + chmod 755 "$pkgdir/usr/bin/faugus-launcher" + + mv "$pkgdir/usr/share/licenses/faugus-launcher" \ + "$pkgdir/usr/share/licenses/$pkgname" } diff --git a/faugus-launcher-bin/pkg.sh b/faugus-launcher-bin/pkg.sh index bb71264..7a321f4 100644 --- a/faugus-launcher-bin/pkg.sh +++ b/faugus-launcher-bin/pkg.sh @@ -1,54 +1,34 @@ -# faugus-launcher-bin - prebuilt package of https://github.com/Faugus/faugus-launcher -# (GTK4 game launcher for running Windows games through UMU-Launcher, Python). +# faugus-launcher-bin - Faugus Launcher +# (https://github.com/Faugus/faugus-launcher), a GTK4 front-end for running +# Windows games through UMU-Launcher. # -# Upstream ships AppImage/deb/rpm but no Arch-friendly binary, so -# build_artifact() builds the meson project from the release tarball. +# Upstream publishes an architecture-independent .deb per release, which the +# PKGBUILD repackages. The Debian revision in the asset name is not derived +# from the version, so refresh_checksums() resolves the asset via the GitHub +# API and syncs the _asset variable in the PKGBUILD along with the checksum. +# +# Upstream tags carry no "v" prefix. UPSTREAM_REPO="Faugus/faugus-launcher" -# Installed in CI (pacman) before build_artifact runs. -# (Translations ship as prebuilt .mo files, so no gettext needed.) -BUILD_DEPS=(meson ninja python) - latest_version() { gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//' } -# build_artifact -build_artifact() { - local ver="$1" outfile="$2" - local workdir destdir srctree sitedir - workdir="$(mktemp -d)" - destdir="$(mktemp -d)" +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local asset sha - curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/$ver.tar.gz" | tar -xz -C "$workdir" - srctree="$workdir/faugus-launcher-$ver" + asset="$(gh api "repos/$UPSTREAM_REPO/releases/tags/$ver" --jq '.assets[].name' \ + | grep -E "^faugus-launcher_${ver}-[0-9]+_all\.deb$")" + [[ "$(wc -l <<< "$asset")" -eq 1 ]] || { echo "expected exactly one deb, got: $asset" >&2; return 1; } - meson setup "$workdir/build" "$srctree" --prefix=/usr --buildtype=release - meson install -C "$workdir/build" --destdir "$destdir" + sha="$(curl -sfL "https://github.com/$UPSTREAM_REPO/releases/download/$ver/$asset" \ + | sha256sum | cut -d' ' -f1)" - # meson installs the python modules into site-packages, whose path changes - # with every Python minor bump and would silently break a prebuilt package. - # Relocate to a fixed dir and put it on the launcher's PYTHONPATH (the - # launcher script already appends any pre-set PYTHONPATH to its own). - sitedir="$(find "$destdir/usr/lib" -maxdepth 2 -type d -name site-packages)" - [[ -d "$sitedir/faugus" ]] || { echo "faugus module not found in $sitedir" >&2; return 1; } - mkdir -p "$destdir/usr/lib/faugus-launcher" - mv "$sitedir/faugus" "$destdir/usr/lib/faugus-launcher/" - rm -rf "$destdir/usr/lib/python"* - - head -1 "$destdir/usr/bin/faugus-launcher" | grep -qx '#!/bin/sh' \ - || { echo "unexpected launcher script format" >&2; return 1; } - sed -i '1a export PYTHONPATH="/usr/lib/faugus-launcher${PYTHONPATH:+:$PYTHONPATH}"' \ - "$destdir/usr/bin/faugus-launcher" - - # These caches are generated by pacman hooks; shipping them would cause - # file conflicts on install. - rm -f "$destdir/usr/share/applications/mimeinfo.cache" \ - "$destdir/usr/share/icons/hicolor/icon-theme.cache" - - tar --zstd --sort=name --owner=0 --group=0 --numeric-owner --mtime='@0' \ - -cf "$outfile" -C "$destdir" usr - - rm -rf "$workdir" "$destdir" + sed -i \ + -e "s|^_asset=.*|_asset=\"$asset\"|" \ + -e "s|^sha256sums=.*|sha256sums=('$sha')|" \ + "$pkgbuild" } diff --git a/snapx-bin/.SRCINFO b/snapx-bin/.SRCINFO index aa5662f..5f57581 100644 --- a/snapx-bin/.SRCINFO +++ b/snapx-bin/.SRCINFO @@ -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 diff --git a/snapx-bin/PKGBUILD b/snapx-bin/PKGBUILD index 7aff5d4..f4a0b28 100644 --- a/snapx-bin/PKGBUILD +++ b/snapx-bin/PKGBUILD @@ -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" } diff --git a/snapx-bin/pkg.sh b/snapx-bin/pkg.sh index 3ffc7b6..fc71df5 100644 --- a/snapx-bin/pkg.sh +++ b/snapx-bin/pkg.sh @@ -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 -build_artifact() { - local ver="$1" outfile="$2" - local workdir destdir asset - workdir="$(mktemp -d)" - destdir="$(mktemp -d)" +# refresh_checksums +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" } diff --git a/waydroid-helper-bin/.SRCINFO b/waydroid-helper-bin/.SRCINFO index a4700d2..42156bc 100644 --- a/waydroid-helper-bin/.SRCINFO +++ b/waydroid-helper-bin/.SRCINFO @@ -1,30 +1,23 @@ pkgbase = waydroid-helper-bin - pkgdesc = GUI application for Waydroid configuration and extension installation (prebuilt) + pkgdesc = GUI application for Waydroid configuration and extension installation (upstream AppImage) pkgver = 0.2.9 - pkgrel = 1 + pkgrel = 2 url = https://github.com/ayasa520/waydroid-helper - arch = any + arch = x86_64 license = GPL-3.0-or-later - depends = python - depends = fakeroot - depends = python-bidict - depends = python-httpx - depends = python-gobject - depends = python-yaml - depends = python-pywayland - depends = python-cairo - depends = gtk4 - depends = libadwaita - depends = python-aiofiles - depends = python-dbus - depends = android-tools - depends = vte4 + depends = glibc + depends = wayland + depends = libxcb + depends = polkit depends = hicolor-icon-theme optdepends = bindfs: shared folders support optdepends = waydroid: the container this tool configures provides = waydroid-helper conflicts = waydroid-helper - source = waydroid-helper-bin-0.2.9-1.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/waydroid-helper-bin-0.2.9/waydroid-helper-bin-0.2.9.tar.zst - sha256sums = 8a02695c6a3f102d1fa2a0b6266bb1978874338eac5a33b3391ada3243c01e56 + noextract = waydroid-helper-bin-0.2.9.AppImage + options = !strip + options = !debug + source = waydroid-helper-bin-0.2.9.AppImage::https://github.com/ayasa520/waydroid-helper/releases/download/v0.2.9/waydroid-helper-0.2.9-x86_64.AppImage + sha256sums = 4e477a02f7fb52e879aec3ab582995ccb3d2003dce24d9e3e71ea7576b12ac33 pkgname = waydroid-helper-bin diff --git a/waydroid-helper-bin/PKGBUILD b/waydroid-helper-bin/PKGBUILD index 9f64de5..dda30cf 100644 --- a/waydroid-helper-bin/PKGBUILD +++ b/waydroid-helper-bin/PKGBUILD @@ -4,22 +4,72 @@ pkgname=waydroid-helper-bin pkgver=0.2.9 -pkgrel=1 -pkgdesc="GUI application for Waydroid configuration and extension installation (prebuilt)" -arch=('any') +pkgrel=2 +pkgdesc="GUI application for Waydroid configuration and extension installation (upstream AppImage)" +arch=('x86_64') url="https://github.com/ayasa520/waydroid-helper" license=('GPL-3.0-or-later') -depends=('python' 'fakeroot' 'python-bidict' 'python-httpx' 'python-gobject' - 'python-yaml' 'python-pywayland' 'python-cairo' 'gtk4' 'libadwaita' - 'python-aiofiles' 'python-dbus' 'android-tools' 'vte4' - 'hicolor-icon-theme') +# the AppImage bundles Python, GTK4, VTE, adb and fakeroot; these are what is +# left over +depends=('glibc' 'wayland' 'libxcb' 'polkit' 'hicolor-icon-theme') optdepends=('bindfs: shared folders support' 'waydroid: the container this tool configures') provides=('waydroid-helper') conflicts=('waydroid-helper') -source=("${pkgname}-${pkgver}-${pkgrel}.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.zst") -sha256sums=('8a02695c6a3f102d1fa2a0b6266bb1978874338eac5a33b3391ada3243c01e56') +options=('!strip' '!debug') +source=("${pkgname}-${pkgver}.AppImage::${url}/releases/download/v${pkgver}/waydroid-helper-${pkgver}-x86_64.AppImage") +noextract=("${pkgname}-${pkgver}.AppImage") +sha256sums=('4e477a02f7fb52e879aec3ab582995ccb3d2003dce24d9e3e71ea7576b12ac33') + +prepare() { + chmod +x "$srcdir/${pkgname}-${pkgver}.AppImage" + "$srcdir/${pkgname}-${pkgver}.AppImage" --appimage-extract > /dev/null +} package() { - cp -a "$srcdir/usr" "$pkgdir/" + local _root="$srcdir/squashfs-root" + + # upstream's AppImage payload, installed unchanged + install -d "$pkgdir/opt/$pkgname" + cp -a "$_root/." "$pkgdir/opt/$pkgname/" + rm -f "$pkgdir/opt/$pkgname/.DirIcon" + + # The payload is a PyInstaller bundle that locates its data through + # $APPDIR, and AppRun resolves nothing by itself - so both entry points get + # a wrapper rather than a symlink. The paths match what upstream's systemd + # unit (/usr/bin/waydroid-helper) and polkit policy (/usr/bin/waydroid-cli) + # expect, so those files can be installed unmodified. + install -d "$pkgdir/usr/bin" + cat > "$pkgdir/usr/bin/waydroid-helper" << EOF +#!/bin/sh +export APPDIR=/opt/$pkgname +exec "\$APPDIR/AppRun" "\$@" +EOF + cat > "$pkgdir/usr/bin/waydroid-cli" << EOF +#!/bin/sh +export APPDIR=/opt/$pkgname +exec "\$APPDIR/usr/bin/waydroid-cli" "\$@" +EOF + chmod 755 "$pkgdir/usr/bin/waydroid-helper" "$pkgdir/usr/bin/waydroid-cli" + + # desktop integration has to live in the system tree to have any effect + install -Dm644 "$_root/usr/share/applications/com.jaoushingan.WaydroidHelper.desktop" \ + "$pkgdir/usr/share/applications/com.jaoushingan.WaydroidHelper.desktop" + install -Dm644 "$_root/usr/share/metainfo/com.jaoushingan.WaydroidHelper.metainfo.xml" \ + "$pkgdir/usr/share/metainfo/com.jaoushingan.WaydroidHelper.metainfo.xml" + install -Dm644 "$_root/usr/share/icons/hicolor/scalable/apps/com.jaoushingan.WaydroidHelper.svg" \ + "$pkgdir/usr/share/icons/hicolor/scalable/apps/com.jaoushingan.WaydroidHelper.svg" + install -Dm644 "$_root/usr/share/icons/hicolor/symbolic/apps/com.jaoushingan.WaydroidHelper-symbolic.svg" \ + "$pkgdir/usr/share/icons/hicolor/symbolic/apps/com.jaoushingan.WaydroidHelper-symbolic.svg" + install -Dm644 "$_root/usr/share/polkit-1/actions/com.jaoushingan.WaydroidHelper.policy" \ + "$pkgdir/usr/share/polkit-1/actions/com.jaoushingan.WaydroidHelper.policy" + install -Dm644 "$_root/usr/share/dbus-1/system.d/id.waydro.Mount.conf" \ + "$pkgdir/usr/share/dbus-1/system.d/id.waydro.Mount.conf" + install -Dm644 "$_root/usr/share/dbus-1/system-services/id.waydro.Mount.service" \ + "$pkgdir/usr/share/dbus-1/system-services/id.waydro.Mount.service" + install -Dm644 "$_root/usr/lib/systemd/user/waydroid-monitor.service" \ + "$pkgdir/usr/lib/systemd/user/waydroid-monitor.service" + + install -Dm644 "$_root/usr/LICENSE" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } diff --git a/waydroid-helper-bin/pkg.sh b/waydroid-helper-bin/pkg.sh index 350f213..1e899fd 100644 --- a/waydroid-helper-bin/pkg.sh +++ b/waydroid-helper-bin/pkg.sh @@ -1,39 +1,22 @@ -# waydroid-helper-bin - prebuilt package of https://github.com/ayasa520/waydroid-helper -# (GTK4 + LibAdwaita GUI for Waydroid configuration/extensions, Python). +# waydroid-helper-bin - Waydroid Helper +# (https://github.com/ayasa520/waydroid-helper), a GTK4 + LibAdwaita GUI for +# Waydroid configuration and extension installation. # -# Upstream only ships AppImages, so build_artifact() builds the meson project -# from the release tarball. +# Upstream publishes an AppImage per release, which the PKGBUILD unpacks and +# installs into /opt - so there is no build step here, only pkgver and the +# checksum are refreshed on a new version. UPSTREAM_REPO="ayasa520/waydroid-helper" -# Installed in CI (pacman) before build_artifact runs. -BUILD_DEPS=(meson ninja python python-setuptools glib2 glib2-devel gettext) - latest_version() { gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//' } -# build_artifact -build_artifact() { - local ver="$1" outfile="$2" - local workdir destdir srctree - workdir="$(mktemp -d)" - destdir="$(mktemp -d)" - - curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/v$ver.tar.gz" | tar -xz -C "$workdir" - srctree="$workdir/waydroid-helper-$ver" - - meson setup "$workdir/build" "$srctree" --prefix=/usr --buildtype=release - meson install -C "$workdir/build" --destdir "$destdir" - - # These caches are generated by pacman hooks; shipping them would cause - # file conflicts on install. - rm -f "$destdir/usr/share/glib-2.0/schemas/gschemas.compiled" \ - "$destdir/usr/share/applications/mimeinfo.cache" \ - "$destdir/usr/share/icons/hicolor/icon-theme.cache" - - tar --zstd --sort=name --owner=0 --group=0 --numeric-owner --mtime='@0' \ - -cf "$outfile" -C "$destdir" usr - - rm -rf "$workdir" "$destdir" +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local sha + sha="$(curl -sfL "https://github.com/$UPSTREAM_REPO/releases/download/v$ver/waydroid-helper-$ver-x86_64.AppImage" \ + | sha256sum | cut -d' ' -f1)" + sed -i "s|^sha256sums=.*|sha256sums=('$sha')|" "$pkgbuild" } diff --git a/wiiudownloader-bin/.SRCINFO b/wiiudownloader-bin/.SRCINFO index f70fff5..c0cb04b 100644 --- a/wiiudownloader-bin/.SRCINFO +++ b/wiiudownloader-bin/.SRCINFO @@ -1,22 +1,29 @@ pkgbase = wiiudownloader-bin - pkgdesc = Download encrypted Wii U files from Nintendo's official servers (prebuilt) + pkgdesc = Download encrypted Wii U files from Nintendo's official servers (upstream AppImage) pkgver = 2.99 - pkgrel = 1 + pkgrel = 2 url = https://github.com/Xpl0itU/WiiUDownloader arch = x86_64 license = GPL-3.0-or-later depends = glibc - depends = glib2 - depends = hicolor-icon-theme depends = libx11 - depends = gtk3 - depends = gdk-pixbuf2 - depends = cairo - depends = pango + depends = libxcb + depends = wayland depends = fontconfig + depends = freetype2 + depends = harfbuzz + depends = fribidi + depends = zlib + depends = bzip2 + depends = expat + depends = libgpg-error + depends = hicolor-icon-theme provides = wiiudownloader conflicts = wiiudownloader - source = wiiudownloader-bin-2.99-1.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/wiiudownloader-bin-2.99/wiiudownloader-bin-2.99.tar.zst - sha256sums = 1a43185b07869b8c25b71c3d43ddd829fd79af9d4cf6bfcfddb201f12cf8ff2e + noextract = wiiudownloader-bin-2.99.AppImage + options = !strip + options = !debug + source = wiiudownloader-bin-2.99.AppImage::https://github.com/Xpl0itU/WiiUDownloader/releases/download/v2.99/WiiUDownloader-Linux-x86_64.AppImage + sha256sums = 3a2e8e7f34a288308666032d6834db00c515a0c897a66a2ae1012702d017f240 pkgname = wiiudownloader-bin diff --git a/wiiudownloader-bin/PKGBUILD b/wiiudownloader-bin/PKGBUILD index 43dc047..f3cd27b 100644 --- a/wiiudownloader-bin/PKGBUILD +++ b/wiiudownloader-bin/PKGBUILD @@ -4,18 +4,46 @@ pkgname=wiiudownloader-bin pkgver=2.99 -pkgrel=1 -pkgdesc="Download encrypted Wii U files from Nintendo's official servers (prebuilt)" +pkgrel=2 +pkgdesc="Download encrypted Wii U files from Nintendo's official servers (upstream AppImage)" arch=('x86_64') url="https://github.com/Xpl0itU/WiiUDownloader" license=('GPL-3.0-or-later') -depends=('glibc' 'glib2' 'hicolor-icon-theme' 'libx11' 'gtk3' 'gdk-pixbuf2' - 'cairo' 'pango' 'fontconfig') +# the AppImage bundles GTK3 and its stack; these are what is left over +depends=('glibc' 'libx11' 'libxcb' 'wayland' 'fontconfig' 'freetype2' + 'harfbuzz' 'fribidi' 'zlib' 'bzip2' 'expat' 'libgpg-error' + 'hicolor-icon-theme') provides=('wiiudownloader') conflicts=('wiiudownloader') -source=("${pkgname}-${pkgver}-${pkgrel}.tar.zst::https://github.com/Felitendo/PKGBUILDS/releases/download/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.zst") -sha256sums=('1a43185b07869b8c25b71c3d43ddd829fd79af9d4cf6bfcfddb201f12cf8ff2e') +options=('!strip' '!debug') +source=("${pkgname}-${pkgver}.AppImage::${url}/releases/download/v${pkgver}/WiiUDownloader-Linux-x86_64.AppImage") +noextract=("${pkgname}-${pkgver}.AppImage") +sha256sums=('3a2e8e7f34a288308666032d6834db00c515a0c897a66a2ae1012702d017f240') + +prepare() { + chmod +x "$srcdir/${pkgname}-${pkgver}.AppImage" + "$srcdir/${pkgname}-${pkgver}.AppImage" --appimage-extract > /dev/null +} package() { - cp -a "$srcdir/usr" "$pkgdir/" + # upstream's AppImage payload, installed unchanged + install -d "$pkgdir/opt/$pkgname" + cp -a "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/" + rm -f "$pkgdir/opt/$pkgname/.DirIcon" + + # AppRun resolves its own directory, so it has to be exec'd by its real + # path - a symlink from /usr/bin would make it look next to the symlink + install -d "$pkgdir/usr/bin" + cat > "$pkgdir/usr/bin/wiiudownloader" << EOF +#!/bin/sh +exec /opt/$pkgname/AppRun "\$@" +EOF + chmod 755 "$pkgdir/usr/bin/wiiudownloader" + + install -Dm644 "$srcdir/squashfs-root/usr/share/icons/hicolor/512x512/apps/WiiUDownloader.png" \ + "$pkgdir/usr/share/icons/hicolor/512x512/apps/wiiudownloader.png" + install -Dm644 "$srcdir/squashfs-root/WiiUDownloader.desktop" \ + "$pkgdir/usr/share/applications/wiiudownloader.desktop" + sed -i -e 's|^Exec=.*|Exec=wiiudownloader|' -e 's|^Icon=.*|Icon=wiiudownloader|' \ + "$pkgdir/usr/share/applications/wiiudownloader.desktop" } diff --git a/wiiudownloader-bin/pkg.sh b/wiiudownloader-bin/pkg.sh index 26a4bf6..c7d0f33 100644 --- a/wiiudownloader-bin/pkg.sh +++ b/wiiudownloader-bin/pkg.sh @@ -1,55 +1,22 @@ -# wiiudownloader-bin - prebuilt package of https://github.com/Xpl0itU/WiiUDownloader -# (Go + GTK3 downloader for Wii U titles from Nintendo's official servers). +# wiiudownloader-bin - WiiUDownloader +# (https://github.com/Xpl0itU/WiiUDownloader), a Go + GTK3 downloader for +# Wii U titles from Nintendo's official servers. # -# Upstream only ships AppImages, so build_artifact() builds the Go binary -# from the release tarball (grabTitles.py generates the title database that -# is compiled in). +# Upstream publishes an AppImage per release, which the PKGBUILD unpacks and +# installs into /opt - so there is no build step here, only pkgver and the +# checksum are refreshed on a new version. UPSTREAM_REPO="Xpl0itU/WiiUDownloader" -# Installed in CI (pacman) before build_artifact runs. -BUILD_DEPS=(go gtk3 python) - latest_version() { gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//' } -# build_artifact -build_artifact() { - local ver="$1" outfile="$2" - local workdir destdir srctree - workdir="$(mktemp -d)" - destdir="$(mktemp -d)" - - curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/v$ver.tar.gz" | tar -xz -C "$workdir" - srctree="$workdir/WiiUDownloader-$ver" - - (cd "$srctree" && python3 grabTitles.py) - - (cd "$srctree/cmd/WiiUDownloader" && \ - GOPATH="$workdir/gopath" \ - GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" \ - go build -v -o "$destdir/wiiudownloader" .) - - install -Dm755 "$destdir/wiiudownloader" "$destdir/usr/bin/wiiudownloader" - rm "$destdir/wiiudownloader" - install -Dm644 "$srctree/data/WiiUDownloader.png" \ - "$destdir/usr/share/icons/hicolor/256x256/apps/wiiudownloader.png" - - mkdir -p "$destdir/usr/share/applications" - cat > "$destdir/usr/share/applications/wiiudownloader.desktop" << 'EOF' -[Desktop Entry] -Type=Application -Name=WiiUDownloader -Comment=Download Wii U titles from Nintendo's official servers -Exec=wiiudownloader -Icon=wiiudownloader -Terminal=false -Categories=Utility; -EOF - - tar --zstd --sort=name --owner=0 --group=0 --numeric-owner --mtime='@0' \ - -cf "$outfile" -C "$destdir" usr - - rm -rf "$workdir" "$destdir" +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local sha + sha="$(curl -sfL "https://github.com/$UPSTREAM_REPO/releases/download/v$ver/WiiUDownloader-Linux-x86_64.AppImage" \ + | sha256sum | cut -d' ' -f1)" + sed -i "s|^sha256sums=.*|sha256sums=('$sha')|" "$pkgbuild" } diff --git a/zapzap-bin/.SRCINFO b/zapzap-bin/.SRCINFO index 0054fb4..c3b6a86 100644 --- a/zapzap-bin/.SRCINFO +++ b/zapzap-bin/.SRCINFO @@ -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 diff --git a/zapzap-bin/PKGBUILD b/zapzap-bin/PKGBUILD index 8538126..c5fde84 100644 --- a/zapzap-bin/PKGBUILD +++ b/zapzap-bin/PKGBUILD @@ -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" } diff --git a/zapzap-bin/pkg.sh b/zapzap-bin/pkg.sh index 0db9b0e..4cfe6bc 100644 --- a/zapzap-bin/pkg.sh +++ b/zapzap-bin/pkg.sh @@ -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 -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 +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" }