From 8d107cf0e9363871e2823e949de645d75b689986 Mon Sep 17 00:00:00 2001 From: Aleksandr Bogomiakov Date: Tue, 24 Nov 2026 22:11:42 +0200 Subject: [PATCH] Declare installer and tray dependencies in Linux packages Require adduser on Debian and shadow on Arch for the package installation hooks. For GUI packages, derive the minimum glibc version from the tray ELF imports so the dependency follows the binary built by each runner. Checked generated Debian control files and Arch package metadata for both variants on macOS using the released tray binary (glibc 2.43). Checked shell syntax; no Rust changes or release rebuild. --- dist/arch/build-pkg.sh | 4 +++- dist/deb/build-deb.sh | 7 +++++-- dist/linux/required-glibc.sh | 13 +++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 dist/linux/required-glibc.sh diff --git a/dist/arch/build-pkg.sh b/dist/arch/build-pkg.sh index 5ab9c4e..89eaf85 100755 --- a/dist/arch/build-pkg.sh +++ b/dist/arch/build-pkg.sh @@ -55,7 +55,8 @@ if [ -n "$tray" ]; then relations=$'conflict = tsunagi\nprovides = tsunagi\nreplaces = tsunagi\n' # What the tray and its window load at run time; none of it is linked in # statically, so pacman has to be told. - for dep in gtk3 libayatana-appindicator libxkbcommon wayland libx11 libglvnd; do + glibc_min=$(bash "$here/../linux/required-glibc.sh" "$tray") + for dep in "glibc>=$glibc_min" gtk3 libayatana-appindicator libxkbcommon wayland libx11 libglvnd; do relations+="depend = ${dep}"$'\n' done install -D -m 0755 "$tray" "$root/usr/bin/tsunagi-tray" @@ -77,6 +78,7 @@ builddate = $(date +%s) packager = AB size = ${size} arch = ${arch} +depend = shadow ${relations}license = WTFPL PKGINFO diff --git a/dist/deb/build-deb.sh b/dist/deb/build-deb.sh index d422698..fdfb8b0 100755 --- a/dist/deb/build-deb.sh +++ b/dist/deb/build-deb.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Assemble a dependency-free Debian package from prebuilt tsunagi binaries, +# Assemble a Debian package from prebuilt tsunagi binaries, # using only dpkg-deb (no cargo-deb, no nfpm). # # Usage: build-deb.sh [tray_binary] @@ -38,6 +38,7 @@ install -D -m 0644 "$here/../../README.md" "$root/usr/share/doc/tsunagi/README.m install -D -m 0644 "$here/../linux/README.md" "$root/usr/share/doc/tsunagi/INSTALL.md" pkgname=tsunagi +depends="adduser" extra_control="" desc_gui="" if [ -n "$tray" ]; then @@ -46,7 +47,8 @@ if [ -n "$tray" ]; then # with it (both ship /usr/bin/tsng). extra_control=$'Conflicts: tsunagi\nReplaces: tsunagi\nProvides: tsunagi\n' # What the tray and its window load at run time. - extra_control+=$'Depends: libgtk-3-0 | libgtk-3-0t64, libayatana-appindicator3-1 | libappindicator3-1, libxkbcommon0, libwayland-client0, libx11-6, libgl1\n' + glibc_min=$(bash "$here/../linux/required-glibc.sh" "$tray") + depends+=", libc6 (>= $glibc_min), libgtk-3-0 | libgtk-3-0t64, libayatana-appindicator3-1 | libappindicator3-1, libxkbcommon0, libwayland-client0, libx11-6, libgl1" desc_gui=" It also installs the tray GUI (tsunagi-tray) and a desktop launcher so it can be started from the applications menu." install -D -m 0755 "$tray" "$root/usr/bin/tsunagi-tray" install -D -m 0644 "$here/../linux/tsunagi-tray.desktop" \ @@ -64,6 +66,7 @@ Architecture: ${arch} Maintainer: AB Section: net Priority: optional +Depends: ${depends} Homepage: https://github.com/house-of-vanity/tsunagi ${extra_control}Description: Serverless private mesh networking agent tsunagi forms small private mesh IP networks between peers, with NAT diff --git a/dist/linux/required-glibc.sh b/dist/linux/required-glibc.sh new file mode 100644 index 0000000..658e336 --- /dev/null +++ b/dist/linux/required-glibc.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Print the highest glibc symbol version imported by the Linux tray binary. +set -euo pipefail +export LC_ALL=C + +minimum=$(objdump -T "$1" | + sed -nE '/\*UND\*/s/.*GLIBC_([0-9]+(\.[0-9]+)+).*/\1/p' | + sort -V | tail -n 1) +if [[ -z "$minimum" ]]; then + echo "No versioned glibc imports found in $1" >&2 + exit 1 +fi +printf '%s\n' "$minimum"