diff --git a/trayscale-bin/.SRCINFO b/trayscale-bin/.SRCINFO new file mode 100644 index 0000000..3dc1df5 --- /dev/null +++ b/trayscale-bin/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = trayscale-bin + pkgdesc = Unofficial GUI wrapper for the Tailscale CLI client (prebuilt) + pkgver = 0.18.9 + pkgrel = 1 + url = https://github.com/DeedleFake/trayscale + arch = x86_64 + license = MIT + depends = gtk4 + depends = libadwaita + depends = hicolor-icon-theme + optdepends = tailscale: provides the daemon that manages the connection + provides = trayscale + conflicts = trayscale + source = https://github.com/Felitendo/PKGBUILDS/releases/download/trayscale-bin-0.18.9/trayscale-bin-0.18.9.tar.zst + sha256sums = 1b24f332a64a682e972e94fecfc11a7d719a1c74c5fd897c45c08cbd17d0ae93 + +pkgname = trayscale-bin diff --git a/trayscale-bin/PKGBUILD b/trayscale-bin/PKGBUILD new file mode 100644 index 0000000..78e3a64 --- /dev/null +++ b/trayscale-bin/PKGBUILD @@ -0,0 +1,21 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=trayscale-bin +pkgver=0.18.9 +pkgrel=1 +pkgdesc="Unofficial GUI wrapper for the Tailscale CLI client (prebuilt)" +arch=('x86_64') +url="https://github.com/DeedleFake/trayscale" +license=('MIT') +depends=('gtk4' 'libadwaita' 'hicolor-icon-theme') +optdepends=('tailscale: provides the daemon that manages the connection') +provides=('trayscale') +conflicts=('trayscale') +source=("https://github.com/Felitendo/PKGBUILDS/releases/download/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.zst") +sha256sums=('1b24f332a64a682e972e94fecfc11a7d719a1c74c5fd897c45c08cbd17d0ae93') + +package() { + cp -a "$srcdir/usr" "$pkgdir/" +} diff --git a/trayscale-bin/pkg.sh b/trayscale-bin/pkg.sh new file mode 100644 index 0000000..2905740 --- /dev/null +++ b/trayscale-bin/pkg.sh @@ -0,0 +1,36 @@ +# trayscale-bin - prebuilt package of https://github.com/DeedleFake/trayscale +# (unofficial GTK4 + LibAdwaita GUI for the Tailscale CLI, written in Go). +# +# Upstream publishes no Linux binary assets, so build_artifact() builds the +# Go binary from the release tarball via upstream's dist.sh (slow: the gotk4 +# bindings take a while to compile). + +UPSTREAM_REPO="DeedleFake/trayscale" + +# Installed in CI (pacman) before build_artifact runs. +BUILD_DEPS=(go gtk4 libadwaita gobject-introspection) + +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/trayscale-$ver" + + (cd "$srctree" && \ + GOMODCACHE="$workdir/gomodcache" GOFLAGS="-modcacherw" \ + ./dist.sh build "v$ver" && \ + ./dist.sh install "$destdir/usr") + + tar --zstd --sort=name --owner=0 --group=0 --numeric-owner --mtime='@0' \ + -cf "$outfile" -C "$destdir" usr + + rm -rf "$workdir" "$destdir" +}