trayscale-bin: add package (0.18.9-1)

This commit is contained in:
Felitendo committed 2026-07-24 09:18:54 +02:00
1 parent 176c0b4e6e
commit 4014aefcdd
3 files changed
+74

No files matched your search

+36
View File
@@ -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 <version> <output-file>
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"
}