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.
This commit is contained in:
Aleksandr Bogomiakov committed 2026-11-24 22:11:42 +02:00
1 parent 01b51081c3
commit 8d107cf0e9
3 files changed
+21 -3

No files matched your search

+3 -1
View File
@@ -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 <ab@hexor.cy>
size = ${size}
arch = ${arch}
depend = shadow
${relations}license = WTFPL
PKGINFO
+5 -2
View File
@@ -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 <binary> <deb_arch> <version> <output.deb> [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 <ab@hexor.cy>
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
+13
View File
@@ -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"