R2: Debian package, desktop entry, launcher and application icon

- make deb (tools/deb.sh) builds tidewall_<version>-1_amd64.deb with
  dpkg-deb: launchers in /usr/games, the game in /usr/lib/tidewall, a
  validated desktop entry, hicolor icons, man pages, a DEP-5 copyright,
  the engine's licences and md5sums. No maintainer scripts. Depends on
  libc6 (>= 2.28), from the binary's GLIBC symbol versions.
- make deb-check (tools/deb_check.sh) checks it in a throwaway debian:13
  container: apt install with no recommends, desktop-file-validate,
  icons, man pages and licences, tidewall on a user's PATH, the server
  and the game headless as a user, lintian, and a purge that leaves
  nothing behind.
- The tarball gains a tidewall launcher (any directory, through a
  symlink), install-desktop-entry.sh (per-user menu entry, --remove),
  tidewall.png and ENGINE-LICENSES.txt (Godot's MIT text and bundled
  notices, which R1 lacked). make dist-check covers the launcher and the
  menu entry.
- Application icon: a hand-written SVG in palette colours, rendered to
  16-512 px by make app-icon, and set as the window icon.
  test_app_icon checks the renders, the colours and the setting.
- Fix: looping ambience played into the Dummy audio driver could be
  reported as resources in use at exit. Directors play nothing without
  real audio output (SoundBank.has_output()) and stop their voices on
  exit.

Tests: make check (648), make dist-check, make deb-check all pass.

Closes #61

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 03:12:47 -05:00
co-authored by Claude Opus 5.5
parent 9b5064d7a8
commit f3161bf46c
47 changed files with 1078 additions and 4 deletions
Executable
+76
View File
@@ -0,0 +1,76 @@
#!/usr/bin/env bash
# R2: builds build/dist/tidewall_<version>-1_amd64.deb from the release package that
# tools/dist.sh makes, with dpkg-deb. Nothing is installed on this machine; see
# tools/deb_check.sh for the check in a clean Debian 13 container.
#
# tools/deb.sh
#
# Layout:
# /usr/games/tidewall, /usr/games/tidewall-server launchers
# /usr/lib/tidewall/ engine, game pack, server wrapper
# /usr/share/applications/tidewall.desktop menu entry
# /usr/share/icons/hicolor/*/apps/tidewall.{png,svg} icons
# /usr/share/man/man6/tidewall{,-server}.6.gz manual pages
# /usr/share/doc/tidewall/ copyright, README, provenance,
# engine licences, example server.cfg
# The desktop and icon caches are refreshed by dpkg triggers, so the package has no
# maintainer scripts.
set -euo pipefail
repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$repo"
tools/dist.sh >/dev/null
version="$(sed -n 's/^config\/version="\(.*\)"$/\1/p' project.godot)"
package="build/dist/tidewall-$version-linux-x86_64"
commit="$(sed -n 's/^commit //p' "$package/VERSION")"
debversion="$version-1"
deb="build/dist/tidewall_${debversion}_amd64.deb"
root="build/deb/root"
stamp="$(git log -1 --format=%ct)"
rm -rf build/deb "$deb" "$deb.sha256"
lib="$root/usr/lib/tidewall"
doc="$root/usr/share/doc/tidewall"
mkdir -p "$lib" "$root/usr/games" "$root/usr/share/applications" "$doc/examples" "$root/DEBIAN"
install -m 0755 "$package/tidewall.x86_64" "$lib/tidewall.x86_64"
install -m 0644 "$package/tidewall.pck" "$lib/tidewall.pck"
install -m 0755 "$package/tidewall-server" "$lib/tidewall-server"
install -m 0755 packaging/deb/tidewall "$root/usr/games/tidewall"
install -m 0755 packaging/deb/tidewall-server "$root/usr/games/tidewall-server"
install -m 0644 packaging/deb/tidewall.desktop "$root/usr/share/applications/tidewall.desktop"
for side in 16 24 32 48 64 128 256 512; do
install -D -m 0644 "assets/icons/app/tidewall-$side.png" "$root/usr/share/icons/hicolor/${side}x${side}/apps/tidewall.png"
done
install -D -m 0644 assets/icons/app/tidewall.svg "$root/usr/share/icons/hicolor/scalable/apps/tidewall.svg"
mkdir -p "$root/usr/share/man/man6"
for page in tidewall tidewall-server; do
gzip -9n -c "packaging/deb/man/$page.6" >"$root/usr/share/man/man6/$page.6.gz"
chmod 0644 "$root/usr/share/man/man6/$page.6.gz"
done
install -m 0644 packaging/deb/copyright "$doc/copyright"
install -m 0644 packaging/dist/README.md "$doc/README.md"
install -m 0644 "$package/server.cfg" "$doc/examples/server.cfg"
gzip -9n -c "$package/PROVENANCE.md" >"$doc/PROVENANCE.md.gz"
gzip -9n -c "$package/ENGINE-LICENSES.txt" >"$doc/ENGINE-LICENSES.gz"
{
printf 'tidewall (%s) unstable; urgency=medium\n\n' "$debversion"
printf ' * Release package built from commit %s.\n\n' "$commit"
printf ' -- Tidewall developers <claude@eom.dev> %s\n' "$(LC_ALL=C date -u -R -d "@$stamp")"
} | gzip -9n >"$doc/changelog.Debian.gz"
chmod 0644 "$doc"/*.gz
size="$(du -sk --apparent-size --exclude=DEBIAN "$root" | cut -f1)"
sed -e "s/@VERSION@/$debversion/" -e "s/@SIZE@/$size/" packaging/deb/control >"$root/DEBIAN/control"
(cd "$root" && find usr -type f -print0 | LC_ALL=C sort -z | xargs -0 md5sum) >"$root/DEBIAN/md5sums"
chmod 0644 "$root/DEBIAN/control" "$root/DEBIAN/md5sums"
find "$root" -type d -exec chmod 0755 {} +
find "$root" -exec touch --no-dereference -d "@$stamp" {} +
SOURCE_DATE_EPOCH="$stamp" dpkg-deb --root-owner-group -Zxz --build "$root" "$deb" >/dev/null
(cd build/dist && sha256sum "$(basename "$deb")" >"$(basename "$deb").sha256")
rm -rf build/deb
echo "deb: $deb ($(du -h "$deb" | cut -f1)), commit $commit"
dpkg-deb --info "$deb" | sed -n 's/^ \(Package\|Version\|Installed-Size\|Depends\):/ \1:/p'