From f7ec4c0615e6c12fce1266fc58ba8e15fbdb2053 Mon Sep 17 00:00:00 2001 From: Felitendo <95575686+Felitendo@users.noreply.github.com> Date: Fri, 24 Jul 2026 08:26:27 +0200 Subject: [PATCH] zapzap-bin: add package (7.0.3-1) --- zapzap-bin/.SRCINFO | 19 +++++++++++++ zapzap-bin/PKGBUILD | 22 +++++++++++++++ zapzap-bin/pkg.sh | 65 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 zapzap-bin/.SRCINFO create mode 100644 zapzap-bin/PKGBUILD create mode 100644 zapzap-bin/pkg.sh diff --git a/zapzap-bin/.SRCINFO b/zapzap-bin/.SRCINFO new file mode 100644 index 0000000..8d2d9d8 --- /dev/null +++ b/zapzap-bin/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = zapzap-bin + pkgdesc = WhatsApp desktop client written in PyQt6 + PyQt6-WebEngine (prebuilt) + pkgver = 7.0.3 + pkgrel = 1 + url = https://github.com/rafatosta/zapzap + arch = any + license = GPL-3.0-or-later + depends = python + depends = python-pyqt6 + depends = python-pyqt6-webengine + depends = python-dbus + depends = qt6-wayland + optdepends = hunspell: spell check + provides = zapzap + conflicts = zapzap + source = https://github.com/Felitendo/PKGBUILDS/releases/download/zapzap-bin-7.0.3/zapzap-bin-7.0.3.tar.zst + sha256sums = 73e5415a7de9b6e3d7d3f8760c23ad3fec901a48e714d964f54293845804e3c8 + +pkgname = zapzap-bin diff --git a/zapzap-bin/PKGBUILD b/zapzap-bin/PKGBUILD new file mode 100644 index 0000000..67e9874 --- /dev/null +++ b/zapzap-bin/PKGBUILD @@ -0,0 +1,22 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=zapzap-bin +pkgver=7.0.3 +pkgrel=1 +pkgdesc="WhatsApp desktop client written in PyQt6 + PyQt6-WebEngine (prebuilt)" +arch=('any') +url="https://github.com/rafatosta/zapzap" +license=('GPL-3.0-or-later') +depends=('python' 'python-pyqt6' 'python-pyqt6-webengine' 'python-dbus' + 'qt6-wayland') +optdepends=('hunspell: spell check') +provides=('zapzap') +conflicts=('zapzap') +source=("https://github.com/Felitendo/PKGBUILDS/releases/download/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.zst") +sha256sums=('73e5415a7de9b6e3d7d3f8760c23ad3fec901a48e714d964f54293845804e3c8') + +package() { + cp -a "$srcdir/usr" "$pkgdir/" +} diff --git a/zapzap-bin/pkg.sh b/zapzap-bin/pkg.sh new file mode 100644 index 0000000..0db9b0e --- /dev/null +++ b/zapzap-bin/pkg.sh @@ -0,0 +1,65 @@ +# zapzap-bin - prebuilt package of 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_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)" + + curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/$ver.tar.gz" | tar -xz -C "$workdir" + srctree="$workdir/zapzap-$ver" + + (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" +}