diff --git a/CLAUDE.md b/CLAUDE.md index aaf165b..d536102 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -50,6 +50,9 @@ continuity. | `make bench` | H1: the server's p50/p99/max tick with 24 bots on three seeds, and the client's draw calls, triangles, objects and memory at six moments of a match (about 3 min, needs Docker). Fails on anything over the budgets in docs/ARCHITECTURE.md. Report in `build/bench/report.txt`. `BENCH_SEEDS`, `BENCH_TICKS`, `BENCH_CLIENT=0` scale it. | | `make dist` | R1: exports the game with the official Godot templates (checked against `tools/engine.sha512`, installed into `.godot-home/`) to `build/dist/tidewall--linux-x86_64.tar.gz` with a `.sha256`. One binary and one pack: `tidewall.x86_64` is the game, `tidewall-server` runs it headless as the server. The version is `application/config/version` in project.godot; the commit goes in as `build_commit.txt` (`BuildInfo`). | | `make dist-check` | R1: builds the package, unpacks it outside the repo with HOME and XDG dirs in a temp dir, and runs `SMOKE_DIST= tools/smoke.sh`, a whole bot match, and the exported game joining the exported server (about 2 min). | +| `make deb` | R2: builds `build/dist/tidewall_-1_amd64.deb` from the `make dist` package with `dpkg-deb`: launchers in `/usr/games`, the game in `/usr/lib/tidewall`, a desktop entry, hicolor icons, and copyright with the engine's licences. Never install it on the host. | +| `make deb-check` | R2: builds the .deb and checks it in a throwaway `tidewall-deb-check-*` Debian 13 container: installs with only its Depends, `desktop-file-validate`, the server and the game headless as a user, lintian for information, and a purge that leaves nothing behind (about 3 min). | +| `make app-icon` | R2: renders `assets/icons/app/tidewall.svg` (written by hand) to `tidewall-.png`. Commit what changes. | | `make soak-selfcheck` | About a minute: tampers with one client's world and checks the soak's comparison catches it and only it. | | `make server-package-check` | Builds the server image with `packaging/docker/compose.yaml`, waits for it to be healthy, checks it is non-root and read-only, joins it with a headless client and stops it with SIGTERM (N7, about 1.5 min). Needs Docker. See `packaging/README.md`. | | `make models` | Rebuilds every item model (`assets/models/items/*.obj`, with grip data in `.json`) and icon (`assets/icons/items/*.png`) from `tools/models/items.py` in headless Blender on the CPU. Materials are named after `Palette` colours; `ItemModels` paints them. | diff --git a/Makefile b/Makefile index 6b35dfe..dd1ba8a 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Tidewall build entry points. Everything runs headless with the repo-local engine. GODOT := tools/godot.sh -.PHONY: bench dist dist-check build-captures poi-captures art figure figure-captures sea-captures models item-captures audio audio-check check import parse test test-selfcheck smoke capture-test terrain-capture binaries verify-engine bot-matches match match-captures client-check client-captures hud-captures style-captures menu-captures chart-captures discovery-check fuzz soak soak-selfcheck server-package-check +.PHONY: app-icon deb deb-check bench dist dist-check build-captures poi-captures art figure figure-captures sea-captures models item-captures audio audio-check check import parse test test-selfcheck smoke capture-test terrain-capture binaries verify-engine bot-matches match match-captures client-check client-captures hud-captures style-captures menu-captures chart-captures discovery-check fuzz soak soak-selfcheck server-package-check ## A8: regenerates every sound in assets/audio/ from tools/audio/ (about 6 s). audio: import @@ -56,6 +56,19 @@ dist: import dist-check: import @tools/dist_check.sh +## R2: renders assets/icons/app/tidewall.svg to the PNG sizes desktops use. +app-icon: + @$(GODOT) --script res://tools/app_icon.gd + +## R2: builds build/dist/tidewall_-1_amd64.deb from the release package. +deb: import + @tools/deb.sh + +## R2: builds the .deb and checks it in a throwaway Debian 13 container: install, +## desktop entry, the server and the game headless, lintian, purge (about 3 minutes). +deb-check: import + @tools/deb_check.sh + ## Everything that must pass before a push. check: verify-engine binaries parse test test-selfcheck smoke diff --git a/assets/PROVENANCE.md b/assets/PROVENANCE.md index 6a73a30..cc8507f 100644 --- a/assets/PROVENANCE.md +++ b/assets/PROVENANCE.md @@ -38,3 +38,13 @@ OBJ, not glTF: the Debian Blender's glTF exporter needs numpy, which the build machine doesn't have. Blender isn't part of `make check`, so these files are checked by `test/client/test_item_models.gd` (every item has a model, icon and grip, painted from the Palette) rather than regenerated byte for byte. + +## Application icon (`assets/icons/app/`, R2) + +| Files | Generator | How | +|---|---|---| +| `tidewall.svg` | Written by hand for Tidewall | A stepped stone tide wall with an oilskin pennant, holding back a curling sea, framed like a woodcut badge. Every colour is a `Palette` colour (named in the file's comment). | +| `tidewall-16.png` to `tidewall-512.png` | `tools/app_icon.gd` (`make app-icon`) | The SVG rasterised by the engine's own SVG loader at each size. | + +The release package carries `tidewall-256.png` as `tidewall.png`; the `.deb` installs +every size and the SVG into the hicolor icon theme. diff --git a/assets/icons/app/tidewall-128.png b/assets/icons/app/tidewall-128.png new file mode 100644 index 0000000..31dd88a Binary files /dev/null and b/assets/icons/app/tidewall-128.png differ diff --git a/assets/icons/app/tidewall-128.png.import b/assets/icons/app/tidewall-128.png.import new file mode 100644 index 0000000..e718ef5 --- /dev/null +++ b/assets/icons/app/tidewall-128.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://n5qf01ngh276" +path="res://.godot/imported/tidewall-128.png-7271ad57a733a9257cd4c716cf7de6c5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/app/tidewall-128.png" +dest_files=["res://.godot/imported/tidewall-128.png-7271ad57a733a9257cd4c716cf7de6c5.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/icons/app/tidewall-16.png b/assets/icons/app/tidewall-16.png new file mode 100644 index 0000000..893e64e Binary files /dev/null and b/assets/icons/app/tidewall-16.png differ diff --git a/assets/icons/app/tidewall-16.png.import b/assets/icons/app/tidewall-16.png.import new file mode 100644 index 0000000..7bc17ea --- /dev/null +++ b/assets/icons/app/tidewall-16.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bcetxhegf4kau" +path="res://.godot/imported/tidewall-16.png-b5edc053655606f79593b243d4fc625d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/app/tidewall-16.png" +dest_files=["res://.godot/imported/tidewall-16.png-b5edc053655606f79593b243d4fc625d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/icons/app/tidewall-24.png b/assets/icons/app/tidewall-24.png new file mode 100644 index 0000000..8727c28 Binary files /dev/null and b/assets/icons/app/tidewall-24.png differ diff --git a/assets/icons/app/tidewall-24.png.import b/assets/icons/app/tidewall-24.png.import new file mode 100644 index 0000000..08ae085 --- /dev/null +++ b/assets/icons/app/tidewall-24.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bwypm6m3ghkr2" +path="res://.godot/imported/tidewall-24.png-004cc012c2f2e8dc90b47511270ee4ca.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/app/tidewall-24.png" +dest_files=["res://.godot/imported/tidewall-24.png-004cc012c2f2e8dc90b47511270ee4ca.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/icons/app/tidewall-256.png b/assets/icons/app/tidewall-256.png new file mode 100644 index 0000000..2c5af9d Binary files /dev/null and b/assets/icons/app/tidewall-256.png differ diff --git a/assets/icons/app/tidewall-256.png.import b/assets/icons/app/tidewall-256.png.import new file mode 100644 index 0000000..d0f9cac --- /dev/null +++ b/assets/icons/app/tidewall-256.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dnsb4e164d2x3" +path="res://.godot/imported/tidewall-256.png-ac665539673427fe14d4c6e2655a86f6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/app/tidewall-256.png" +dest_files=["res://.godot/imported/tidewall-256.png-ac665539673427fe14d4c6e2655a86f6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/icons/app/tidewall-32.png b/assets/icons/app/tidewall-32.png new file mode 100644 index 0000000..16023c5 Binary files /dev/null and b/assets/icons/app/tidewall-32.png differ diff --git a/assets/icons/app/tidewall-32.png.import b/assets/icons/app/tidewall-32.png.import new file mode 100644 index 0000000..b25a87a --- /dev/null +++ b/assets/icons/app/tidewall-32.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://gh3kugv3x8jb" +path="res://.godot/imported/tidewall-32.png-59157aa1b0335b4e19d312820a2b5c36.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/app/tidewall-32.png" +dest_files=["res://.godot/imported/tidewall-32.png-59157aa1b0335b4e19d312820a2b5c36.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/icons/app/tidewall-48.png b/assets/icons/app/tidewall-48.png new file mode 100644 index 0000000..48c4652 Binary files /dev/null and b/assets/icons/app/tidewall-48.png differ diff --git a/assets/icons/app/tidewall-48.png.import b/assets/icons/app/tidewall-48.png.import new file mode 100644 index 0000000..e15046d --- /dev/null +++ b/assets/icons/app/tidewall-48.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b3esdhvy4gjyy" +path="res://.godot/imported/tidewall-48.png-ea4e3c67152321864ee3f1ac6a924361.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/app/tidewall-48.png" +dest_files=["res://.godot/imported/tidewall-48.png-ea4e3c67152321864ee3f1ac6a924361.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/icons/app/tidewall-512.png b/assets/icons/app/tidewall-512.png new file mode 100644 index 0000000..dc3e008 Binary files /dev/null and b/assets/icons/app/tidewall-512.png differ diff --git a/assets/icons/app/tidewall-512.png.import b/assets/icons/app/tidewall-512.png.import new file mode 100644 index 0000000..823b833 --- /dev/null +++ b/assets/icons/app/tidewall-512.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://boqmnny3uc7tf" +path="res://.godot/imported/tidewall-512.png-ee9b3b6f005880c9f00054b0a9f090a3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/app/tidewall-512.png" +dest_files=["res://.godot/imported/tidewall-512.png-ee9b3b6f005880c9f00054b0a9f090a3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/icons/app/tidewall-64.png b/assets/icons/app/tidewall-64.png new file mode 100644 index 0000000..f3c7880 Binary files /dev/null and b/assets/icons/app/tidewall-64.png differ diff --git a/assets/icons/app/tidewall-64.png.import b/assets/icons/app/tidewall-64.png.import new file mode 100644 index 0000000..950793c --- /dev/null +++ b/assets/icons/app/tidewall-64.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dbbsm3t37qsn6" +path="res://.godot/imported/tidewall-64.png-27dd7b63c2ed7f401d1123a90d8a5153.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/app/tidewall-64.png" +dest_files=["res://.godot/imported/tidewall-64.png-27dd7b63c2ed7f401d1123a90d8a5153.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/icons/app/tidewall.svg b/assets/icons/app/tidewall.svg new file mode 100644 index 0000000..a41f309 --- /dev/null +++ b/assets/icons/app/tidewall.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/app/tidewall.svg.import b/assets/icons/app/tidewall.svg.import new file mode 100644 index 0000000..1b78683 --- /dev/null +++ b/assets/icons/app/tidewall.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://jqyksjo5pwth" +path="res://.godot/imported/tidewall.svg-f46f79795fcb455630d7dc7bbb0c32dd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/app/tidewall.svg" +dest_files=["res://.godot/imported/tidewall.svg-f46f79795fcb455630d7dc7bbb0c32dd.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/packaging/deb/control b/packaging/deb/control new file mode 100644 index 0000000..2801866 --- /dev/null +++ b/packaging/deb/control @@ -0,0 +1,18 @@ +Package: tidewall +Version: @VERSION@ +Architecture: amd64 +Maintainer: Tidewall developers +Installed-Size: @SIZE@ +Depends: libc6 (>= 2.28) +Recommends: libvulkan1 | libgl1, libx11-6, libxcursor1, libxinerama1, libxrandr2, libxi6, libxext6, libasound2t64 | libpulse0, libfontconfig1, libdbus-1-3 +Section: games +Priority: optional +Homepage: https://gitea.eom.dev/claude/tidewall +Description: build-and-survive battle royale on a drowning island + Tidewall is a free and open-source third-person battle royale. The sea + rises in phases and swallows the low ground, so the last dry land keeps + getting higher and smaller. Gather salvage, build breakwaters and ramps, + and be the last one standing. + . + This package has the game, offline practice against bots, LAN and + internet play, and a headless dedicated server (tidewall-server). diff --git a/packaging/deb/copyright b/packaging/deb/copyright new file mode 100644 index 0000000..ee4b283 --- /dev/null +++ b/packaging/deb/copyright @@ -0,0 +1,57 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Tidewall +Upstream-Contact: https://gitea.eom.dev/claude/tidewall/issues +Source: https://gitea.eom.dev/claude/tidewall + +Files: * +Copyright: 2026 Tidewall contributors +License: GPL-3+ and CC-BY-SA-4.0 +Comment: The code is GPL-3.0-or-later. The game's models, textures, icons and + sounds, all generated by scripts in the source repository (see + /usr/share/doc/tidewall/PROVENANCE.md.gz), are CC BY-SA 4.0. They are packed + together in /usr/lib/tidewall/tidewall.pck. + +Files: usr/lib/tidewall/tidewall.x86_64 +Copyright: 2014-present Godot Engine contributors + 2007-2014 Juan Linietsky, Ariel Manzur +License: Expat +Comment: The official Godot Engine 4.7.2 release export template, unmodified. + The notices and licences of the third-party code built into it are in + /usr/share/doc/tidewall/ENGINE-LICENSES.gz. + +License: GPL-3+ + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + . + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. + . + On Debian systems, the complete text of the GNU General Public License + version 3 can be found in /usr/share/common-licenses/GPL-3. + +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. + +License: CC-BY-SA-4.0 + Creative Commons Attribution-ShareAlike 4.0 International. The licence's + full text is at https://creativecommons.org/licenses/by-sa/4.0/legalcode diff --git a/packaging/deb/man/tidewall-server.6 b/packaging/deb/man/tidewall-server.6 new file mode 100644 index 0000000..6281b86 --- /dev/null +++ b/packaging/deb/man/tidewall-server.6 @@ -0,0 +1,43 @@ +.TH TIDEWALL\-SERVER 6 "2026-11-14" "Tidewall" "Games" +.SH NAME +tidewall\-server \- headless dedicated server for Tidewall +.SH SYNOPSIS +.B tidewall\-server +.RB [ \-\-config=\fIfile\fP ] +.RI [ options ] +.SH DESCRIPTION +.B tidewall\-server +runs the game without a window, as a server people join over UDP. SIGTERM or +Ctrl+C stops it cleanly: everyone connected is told it is shutting down. Logs +are JSON lines on standard output. Exit status: 0 clean, 1 script error, +2 bad command line. +.SH OPTIONS +.TP +.BI \-\-config= file +Read options from a file, one per line without the leading dashes; see +/usr/share/doc/tidewall/examples/server.cfg. +.TP +.B \-\-listen +Take players over the network. +.TP +.BI \-\-port= n +UDP port (default 24650). LAN discovery answers on the port plus one. +.TP +.BI \-\-bots= n +Fill each match's empty places with bots. +.TP +.BI \-\-name= name +The name shown in server lists. +.TP +.BI \-\-list= host[:port] +Register with a list server. +.TP +.BI \-\-health\-port= n +Answer GET /health over HTTP on this TCP port, on loopback. +.SH ENVIRONMENT +.TP +.B TIDEWALL_STATE +A writable directory for the engine's files and the stop file (default +~/.local/state/tidewall\-server). +.SH SEE ALSO +.BR tidewall (6) diff --git a/packaging/deb/man/tidewall.6 b/packaging/deb/man/tidewall.6 new file mode 100644 index 0000000..1227a3b --- /dev/null +++ b/packaging/deb/man/tidewall.6 @@ -0,0 +1,40 @@ +.TH TIDEWALL 6 "2026-11-14" "Tidewall" "Games" +.SH NAME +tidewall \- build-and-survive battle royale on a drowning island +.SH SYNOPSIS +.B tidewall +.RB [ \-\-rendering\-driver +.IR driver ] +.RB [ \-\- +.IR "game options" ] +.SH DESCRIPTION +.B tidewall +starts the game on its main menu: practice offline against bots, find a +server on the local network, or join one by address. The sea rises in phases +and swallows the low ground; gather salvage, build, and be the last one +standing. +.PP +Options before +.B \-\- +go to the Godot engine; options after it go to the game. +.SH OPTIONS +.TP +.BI \-\-rendering\-driver " opengl3" +Use OpenGL instead of Vulkan, for hardware without a Vulkan driver. +.TP +.BI \-\-connect= host[:port] +Join a server directly (the port defaults to 24650). +.TP +.BI \-\-name= name +The name to play under. +.TP +.B \-\-offline +Start a practice match against bots at once. +.SH FILES +.TP +.I ~/.local/share/godot/app_userdata/Tidewall/ +Settings and key bindings. +.SH SEE ALSO +.BR tidewall\-server (6) +.PP +/usr/share/doc/tidewall/README.md diff --git a/packaging/deb/tidewall b/packaging/deb/tidewall new file mode 100644 index 0000000..c38e3bc --- /dev/null +++ b/packaging/deb/tidewall @@ -0,0 +1,3 @@ +#!/bin/sh +# Tidewall, installed from the Debian package. Options go to the game. +exec /usr/lib/tidewall/tidewall.x86_64 "$@" diff --git a/packaging/deb/tidewall-server b/packaging/deb/tidewall-server new file mode 100644 index 0000000..5358f70 --- /dev/null +++ b/packaging/deb/tidewall-server @@ -0,0 +1,5 @@ +#!/bin/sh +# A Tidewall dedicated server, installed from the Debian package. See +# /usr/share/doc/tidewall/examples/server.cfg and `man`-free help in +# /usr/share/doc/tidewall/README.md. Options go to the server. +exec /usr/lib/tidewall/tidewall-server "$@" diff --git a/packaging/deb/tidewall.desktop b/packaging/deb/tidewall.desktop new file mode 100644 index 0000000..eb327a5 --- /dev/null +++ b/packaging/deb/tidewall.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Application +Name=Tidewall +GenericName=Battle royale +Comment=Build and survive on an island the sea is swallowing +Exec=tidewall +Icon=tidewall +Terminal=false +Categories=Game;ActionGame; +Keywords=battle royale;build;survive;sea;island; +PrefersNonDefaultGPU=true diff --git a/packaging/dist/README.md b/packaging/dist/README.md index a4dfdc0..a3b1f40 100644 --- a/packaging/dist/README.md +++ b/packaging/dist/README.md @@ -5,7 +5,16 @@ swallows the low ground, so the last dry land keeps getting higher and smaller. ## Play - ./tidewall.x86_64 + ./tidewall + +`tidewall` starts the game from this folder whatever directory you are in, and works +through a symlink too (for example `ln -s "$PWD/tidewall" ~/.local/bin/tidewall`). +To add Tidewall to your desktop's application menu, for you alone: + + ./install-desktop-entry.sh + +Run it again if you move the folder, and `./install-desktop-entry.sh --remove` to take +the entry away. On Debian or Ubuntu, the `.deb` package does all of this system-wide. The game opens on its main menu: practice against bots offline, or join a server on your network or by address. It needs a Vulkan-capable GPU and driver (Forward+). On @@ -26,16 +35,22 @@ the server cleanly. Logs are JSON lines on standard output. | File | | |---|---| +| `tidewall` | Starts the game | +| `install-desktop-entry.sh` | Adds the game to your application menu | | `tidewall.x86_64` | The Godot 4.7.2 engine (official release template) | | `tidewall.pck` | The game | | `tidewall-server` | Runs the same game headless as a dedicated server | | `server.cfg` | Example server configuration | | `VERSION` | Version, commit and engine | +| `tidewall.png` | The application icon | | `PROVENANCE.md` | How every model, texture and sound was made | +| `ENGINE-LICENSES.txt` | The Godot engine's licence and the notices of the code built into it | ## Licence Code: GPL-3.0-or-later (`LICENSE`). Art and audio, all generated by scripts in the -source repository: CC BY-SA 4.0 (`LICENSE-ASSETS`). The Godot engine is MIT-licensed. +source repository: CC BY-SA 4.0 (`LICENSE-ASSETS`). The Godot engine is MIT-licensed; +its licence and the notices of the third-party code built into it are in +`ENGINE-LICENSES.txt`. Source: https://gitea.eom.dev/claude/tidewall diff --git a/packaging/dist/install-desktop-entry.sh b/packaging/dist/install-desktop-entry.sh new file mode 100755 index 0000000..bc97c0d --- /dev/null +++ b/packaging/dist/install-desktop-entry.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env sh +# Adds Tidewall from this folder to your desktop's application menu, for you alone: +# a desktop entry in ~/.local/share/applications and the icon in +# ~/.local/share/icons. Nothing outside your home is touched. +# +# ./install-desktop-entry.sh add it (again, if the folder moved) +# ./install-desktop-entry.sh --remove take it away +set -eu + +here="$(dirname "$(readlink -f "$0")")" +data="${XDG_DATA_HOME:-$HOME/.local/share}" +entry="$data/applications/tidewall.desktop" +icon="$data/icons/hicolor/256x256/apps/tidewall.png" + +if [ "${1:-}" = "--remove" ]; then + rm -f "$entry" "$icon" + echo "Removed the Tidewall menu entry." + exit 0 +fi +if [ "$#" -gt 0 ]; then + echo "usage: $0 [--remove]" >&2 + exit 2 +fi +case "$here" in + *'"'* | *'\'* | *'`'* | *'$'* | *'%'*) + echo "This folder's path has a character a desktop entry can't hold; move it and try again." >&2 + exit 1 + ;; +esac + +mkdir -p "$(dirname "$entry")" "$(dirname "$icon")" +cp "$here/tidewall.png" "$icon" +cat >"$entry" < void: func _ready() -> void: + if not SoundBank.has_output(): + audible = false get_tree().node_added.connect(_hook_later) diff --git a/src/audio/music_director.gd b/src/audio/music_director.gd index 761e8d5..44c1643 100644 --- a/src/audio/music_director.gd +++ b/src/audio/music_director.gd @@ -29,6 +29,8 @@ var _sync: AudioStreamSynchronized func _ready() -> void: + if not SoundBank.has_output(): + audible = false SoundBank.ensure_bus(SoundBank.MUSIC_BUS) _sync = AudioStreamSynchronized.new() _sync.stream_count = LAYERS.size() diff --git a/src/audio/sound_bank.gd b/src/audio/sound_bank.gd index 6423798..3ea6ee7 100644 --- a/src/audio/sound_bank.gd +++ b/src/audio/sound_bank.gd @@ -14,6 +14,14 @@ static var _cache: Dictionary = {} ## The stream for a sound by name, or null if there's no such file. +## False when the engine has no real audio output: headless runs, or a machine with no +## sound device, where Godot falls back to its Dummy driver. Nothing should play then, +## since nothing can be heard, and a loop left playing into the Dummy driver can outlive +## the program's last frame and be reported as a leak at exit (R2). +static func has_output() -> bool: + return AudioServer.get_driver_name() != "Dummy" + + static func stream(sound: String) -> AudioStream: if _cache.has(sound): return _cache[sound] diff --git a/src/audio/sound_director.gd b/src/audio/sound_director.gd index d374e11..e19198d 100644 --- a/src/audio/sound_director.gd +++ b/src/audio/sound_director.gd @@ -74,6 +74,8 @@ var _ambience: Dictionary = {} func _ready() -> void: + if not SoundBank.has_output(): + audible = false SoundBank.ensure_bus(SoundBank.EFFECTS_BUS) for index: int in VOICES_3D: var voice: AudioStreamPlayer3D = AudioStreamPlayer3D.new() @@ -96,6 +98,18 @@ func _ready() -> void: _ambience[loop] = bed +## Stops every voice and bed before the nodes go, so the audio server lets go of their +## playbacks; a loop still playing when the program quits is otherwise reported as a +## leak at exit (R2). +func _exit_tree() -> void: + for voice: AudioStreamPlayer3D in _voices_3d: + voice.stop() + for flat: AudioStreamPlayer in _voices_2d: + flat.stop() + for loop: String in _ambience: + (_ambience[loop] as AudioStreamPlayer).stop() + + ## One frame. `own_id` is the client's own player or 0; `listener` is where the camera is. func update(game: ClientGame, own_id: int, listener: Vector3, delta: float) -> void: cues.clear() diff --git a/test/audio/test_sound_director.gd b/test/audio/test_sound_director.gd index b70aba4..a7f7afa 100644 --- a/test/audio/test_sound_director.gd +++ b/test/audio/test_sound_director.gd @@ -16,6 +16,9 @@ func before_each() -> void: tree = Engine.get_main_loop() as SceneTree director = SoundDirector.new() tree.root.add_child(director) + # Headless, the director plays nothing (SoundBank.has_output()); these tests check + # what it plays and where, so they ask it to play into the Dummy driver anyway. + director.audible = true game = ClientGame.new() world = Simulation.new(5, SimGround.flat(0.0)) world.sea_level = -5.0 diff --git a/test/project/test_app_icon.gd b/test/project/test_app_icon.gd new file mode 100644 index 0000000..33dca1a --- /dev/null +++ b/test/project/test_app_icon.gd @@ -0,0 +1,40 @@ +extends TestCase + +## R2: the application icon. The PNGs are renders of the hand-written SVG, in Palette +## colours, and the project uses one as its window icon. + +const APP_ICON: GDScript = preload("res://tools/app_icon.gd") + + +func test_every_size_is_the_svg_rendered_at_that_size() -> void: + var svg: String = FileAccess.get_file_as_string(APP_ICON.SOURCE) + assert_true(svg.begins_with(" void: + var svg: String = FileAccess.get_file_as_string(APP_ICON.SOURCE) + var allowed: Dictionary = {} + for colour: Color in [Palette.INK, Palette.CANVAS, Palette.DRESSED_STONE, Palette.SEA_PAINT, Palette.SEA_DEEP, Palette.SALT, Palette.OILSKIN, Palette.OCHRE_RED]: + allowed["#" + colour.to_html(false).to_lower()] = true + var found: RegEx = RegEx.create_from_string("#[0-9a-fA-F]{6}") + var used: int = 0 + for match: RegExMatch in found.search_all(svg): + used += 1 + assert_true(allowed.has(match.get_string().to_lower()), "%s is not a palette colour" % match.get_string()) + assert_true(used >= 6) + + +func test_the_project_uses_it_as_its_icon() -> void: + var icon: String = String(ProjectSettings.get_setting("application/config/icon", "")) + assert_true(icon.begins_with("res://assets/icons/app/"), "application/config/icon is '%s'" % icon) + assert_true(ResourceLoader.exists(icon)) diff --git a/test/project/test_app_icon.gd.uid b/test/project/test_app_icon.gd.uid new file mode 100644 index 0000000..3adf869 --- /dev/null +++ b/test/project/test_app_icon.gd.uid @@ -0,0 +1 @@ +uid://ddioojm5kfw65 diff --git a/tools/app_icon.gd b/tools/app_icon.gd new file mode 100644 index 0000000..f7352c8 --- /dev/null +++ b/tools/app_icon.gd @@ -0,0 +1,48 @@ +## R2: renders the application icon, assets/icons/app/tidewall.svg (written by hand), +## to the PNG sizes desktops ask for: assets/icons/app/tidewall-.png. Deterministic, +## so `make app-icon` after editing the SVG and commit what changes. +## +## tools/godot.sh --script res://tools/app_icon.gd [-- --out=DIR] +extends SceneTree + +const SOURCE: String = "res://assets/icons/app/tidewall.svg" +const SIZES: Array[int] = [16, 24, 32, 48, 64, 128, 256, 512] +## The SVG's own width and height. +const SVG_SIDE: float = 256.0 + + +func _init() -> void: + var out: String = "res://assets/icons/app" + for arg: String in OS.get_cmdline_user_args(): + if arg.begins_with("--out="): + out = arg.get_slice("=", 1) + var svg: String = FileAccess.get_file_as_string(SOURCE) + if svg.is_empty(): + push_error("app_icon: can't read %s" % SOURCE) + quit(1) + return + DirAccess.make_dir_recursive_absolute(out) + for side: int in SIZES: + var image: Image = render(svg, side) + if image == null: + quit(1) + return + var path: String = "%s/tidewall-%d.png" % [out, side] + if image.save_png(path) != OK: + push_error("app_icon: can't write %s" % path) + quit(1) + return + print("app_icon: %s" % path) + quit(0) + + +## The icon at `side` pixels square, or null. +static func render(svg: String, side: int) -> Image: + var image: Image = Image.new() + if image.load_svg_from_string(svg, side / SVG_SIDE) != OK: + push_error("app_icon: the SVG doesn't load") + return null + if image.get_width() != side or image.get_height() != side: + image.resize(side, side, Image.INTERPOLATE_LANCZOS) + image.convert(Image.FORMAT_RGBA8) + return image diff --git a/tools/app_icon.gd.uid b/tools/app_icon.gd.uid new file mode 100644 index 0000000..5fdfbbb --- /dev/null +++ b/tools/app_icon.gd.uid @@ -0,0 +1 @@ +uid://bcg1243rv4dl5 diff --git a/tools/deb.sh b/tools/deb.sh new file mode 100755 index 0000000..0377ece --- /dev/null +++ b/tools/deb.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash +# R2: builds build/dist/tidewall_-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 %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' diff --git a/tools/deb_check.sh b/tools/deb_check.sh new file mode 100755 index 0000000..8c47d8f --- /dev/null +++ b/tools/deb_check.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# R2: builds the .deb (tools/deb.sh) and checks it in a throwaway Debian 13 container, +# never on this machine: +# - it installs with apt, with only its Depends (no recommended graphics libraries); +# - the desktop entry passes desktop-file-validate and its icons are in place; +# - the dedicated server runs a bot match headless as an ordinary user, from PATH; +# - the game itself starts headless, plays an offline match for a few seconds and +# reports that it played; +# - lintian, for information (its findings are printed, see docs/DEVLOG.md); +# - it purges cleanly: no file it installed is left behind. +# +# tools/deb_check.sh about 3 minutes, needs Docker and Debian's mirrors +set -uo pipefail + +repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$repo" + +tools/deb.sh || { echo "deb-check FAIL: tools/deb.sh failed"; exit 1; } +deb="$(ls -t build/dist/tidewall_*_amd64.deb | head -n 1)" +name="tidewall-deb-check-$$" +cleanup() { docker rm -f "$name" >/dev/null 2>&1 || true; } +trap cleanup EXIT + +docker run --rm --name "$name" --memory=3g --cpus=4 \ + -v "$repo/$deb:/check/tidewall.deb:ro" debian:13 bash -c ' +set -uo pipefail +status=0 +fail() { echo "deb-check FAIL: $*"; status=1; } +export DEBIAN_FRONTEND=noninteractive +apt-get update -qq >/dev/null || { echo "deb-check FAIL: apt-get update"; exit 1; } +apt-get install -y -qq --no-install-recommends desktop-file-utils lintian >/dev/null 2>&1 || { echo "deb-check FAIL: tools"; exit 1; } + +echo "deb-check: install" +apt-get install -y -qq --no-install-recommends /check/tidewall.deb >/tmp/install.log 2>&1 || { tail -n 20 /tmp/install.log; echo "deb-check FAIL: install"; exit 1; } +dpkg -s tidewall | sed -n "s/^\(Status\|Version\): / \1: /p" +dpkg -L tidewall | sort >/tmp/files + +echo "deb-check: desktop entry and icons" +desktop-file-validate /usr/share/applications/tidewall.desktop && echo " desktop-file-validate: ok" || fail "desktop-file-validate" +for side in 16 32 48 64 128 256; do + [ -s "/usr/share/icons/hicolor/${side}x${side}/apps/tidewall.png" ] || fail "no ${side}px icon" +done +[ -s /usr/share/icons/hicolor/scalable/apps/tidewall.svg ] || fail "no scalable icon" +[ -s /usr/share/doc/tidewall/copyright ] || fail "no copyright file" +zcat /usr/share/doc/tidewall/ENGINE-LICENSES.gz >/tmp/engine-licenses +grep -q "Permission is hereby granted" /tmp/engine-licenses || fail "no engine licence" +man_ok=1 +for page in tidewall tidewall-server; do [ -s "/usr/share/man/man6/$page.6.gz" ] || man_ok=0; done +[ "$man_ok" -eq 1 ] || fail "manual pages missing" + +useradd -m player +# A login shell, as the desktop has: its PATH has /usr/games, root'"'"'s does not. +exec_name="$(sed -n "s/^Exec=//p" /usr/share/applications/tidewall.desktop)" +su - player -c "command -v $exec_name" >/dev/null || fail "the entry runs $exec_name, which is not on a user'"'"'s PATH" +echo "deb-check: the server, headless, as a user" +su - player -c "tidewall-server --seed=2 --bots=24 --ticks=900 --unthrottled" >/tmp/server.log 2>&1 +code=$? +[ "$code" -eq 0 ] || { tail -n 5 /tmp/server.log; fail "the server exited $code"; } +grep -q "\"event\":\"start\"" /tmp/server.log || fail "the server never started" +grep -q "\"errors\":0,\"event\":\"stop\"" /tmp/server.log || fail "the server logged errors" +grep -m1 "\"event\":\"stop\"" /tmp/server.log | cut -c1-160 | sed "s/^/ /" + +echo "deb-check: the game, headless, an offline match" +su - player -c "tidewall --headless -- --offline --autoplay --client-seconds=15" >/tmp/game.log 2>&1 +code=$? +report="$(grep -m1 "\"event\":\"client\"" /tmp/game.log || true)" +echo " ${report:0:200}" +[ "$code" -eq 0 ] || { tail -n 5 /tmp/game.log; fail "the game exited $code"; } +[ -n "$report" ] || fail "the game printed no report" +if grep -qE "^(ERROR|SCRIPT ERROR|WARNING: .*leaked)" /tmp/game.log; then grep -m3 -E "^(ERROR|SCRIPT ERROR|WARNING)" /tmp/game.log | sed "s/^/ /"; fail "the game logged errors"; fi +ls -d /home/player/.local/share/godot/app_userdata/Tidewall >/dev/null 2>&1 && echo " user data in ~/.local/share/godot/app_userdata/Tidewall" + +echo "deb-check: lintian (for information)" +lintian --tag-display-limit 0 /check/tidewall.deb 2>&1 | sed "s/^/ /" || true + +echo "deb-check: purge" +apt-get purge -y -qq tidewall >/tmp/purge.log 2>&1 || fail "purge" +dpkg -s tidewall >/dev/null 2>&1 && fail "still installed after purge" +left=0 +while read -r path; do + case "$path" in /.|/|/usr|/usr/share/man|/usr/share/man/man6|/usr/games|/usr/lib|/usr/share|/usr/share/*/|/usr/share/applications|/usr/share/doc|/usr/share/icons|/usr/share/icons/hicolor|/usr/share/icons/hicolor/*/apps|/usr/share/icons/hicolor/*) [ -d "$path" ] && continue ;; esac + if [ -e "$path" ]; then echo " left behind: $path"; left=1; fi +done /dev/null 2>&1 +grep -q "Permission is hereby granted" "$package/ENGINE-LICENSES.txt" || { echo "dist FAIL: no engine licence text" >&2; exit 1; } +chmod 0644 "$package/ENGINE-LICENSES.txt" printf 'Tidewall %s\ncommit %s\nengine Godot %s\n' "$version" "$commit" "$(cat tools/engine.version)" >"$package/VERSION" # Reproducible-ish archive: fixed owner, sorted names, mtimes from the commit. diff --git a/tools/dist_check.sh b/tools/dist_check.sh index a46f56e..d2f8436 100755 --- a/tools/dist_check.sh +++ b/tools/dist_check.sh @@ -37,7 +37,7 @@ package="$work/$name" export HOME="$work/home" XDG_DATA_HOME="$work/home/data" XDG_CONFIG_HOME="$work/home/config" XDG_CACHE_HOME="$work/home/cache" XDG_STATE_HOME="$work/home/state" mkdir -p "$HOME" -expected="LICENSE LICENSE-ASSETS PROVENANCE.md README.md VERSION server.cfg tidewall-server tidewall.pck tidewall.x86_64" +expected="ENGINE-LICENSES.txt LICENSE LICENSE-ASSETS PROVENANCE.md README.md VERSION install-desktop-entry.sh server.cfg tidewall tidewall-server tidewall.pck tidewall.png tidewall.x86_64" actual="$(cd "$package" && ls -A | LC_ALL=C sort | tr '\n' ' ' | sed 's/ $//')" [[ "$actual" == "$expected" ]] || fail "the package holds '$actual', expected '$expected'" version="$(sed -n 's/^Tidewall //p' "$package/VERSION")" @@ -89,6 +89,30 @@ playing="$(sed -n 's/.*"frames_playing":\([0-9]*\).*/\1/p' <<<"$report")" grep -q '"event":"player_joined".*"name":"Mara"' "$server_log" || fail "the server never saw the game join" grep -q '"errors":0,"event":"stop"' "$server_log" || fail "the server logged errors" echo " game: joined, in the match for ${playing:-0} frames" + +echo "dist-check: the launcher from another directory, and the menu entry" >&2 +mkdir -p "$work/elsewhere" +ln -s "$package/tidewall" "$work/elsewhere/tidewall-link" +launch_log="$work/launch.log" +(cd / && timeout --signal=KILL 120 nice -n 15 "$work/elsewhere/tidewall-link" --headless -- --offline --autoplay --client-seconds=8 >"$launch_log" 2>&1) +launch_code=$? +[[ "$launch_code" -eq 0 ]] || fail "the launcher, through a symlink from /, exited $launch_code" +grep -q '"event":"client"' "$launch_log" || fail "the launcher's game said nothing" +if grep -qE '^(ERROR|SCRIPT ERROR|WARNING: .*leaked)' "$launch_log"; then + grep -m3 -E '^(ERROR|SCRIPT ERROR|WARNING)' "$launch_log" | sed 's/^/ /' + fail "the launcher's game logged errors" +fi +menu="$work/menu" +XDG_DATA_HOME="$menu" "$package/install-desktop-entry.sh" >/dev/null || fail "install-desktop-entry.sh failed" +entry="$menu/applications/tidewall.desktop" +[[ -s "$entry" && -s "$menu/icons/hicolor/256x256/apps/tidewall.png" ]] || fail "no menu entry or icon after install-desktop-entry.sh" +grep -qx "Exec=\"$package/tidewall\"" "$entry" || fail "the menu entry doesn't run this folder's launcher" +if command -v desktop-file-validate >/dev/null; then + desktop-file-validate "$entry" || fail "the menu entry doesn't validate" +fi +XDG_DATA_HOME="$menu" "$package/install-desktop-entry.sh" --remove >/dev/null +[[ ! -e "$entry" ]] || fail "--remove left the menu entry" +echo " launcher: played offline through a symlink from /; menu entry added, validated and removed" if [[ -n "$(ls -A "$HOME/data" 2>/dev/null | grep -v '^godot$')" ]]; then fail "the package wrote outside the engine's user data: $(ls -A "$HOME/data")" fi diff --git a/tools/engine_licenses.gd b/tools/engine_licenses.gd new file mode 100644 index 0000000..1e94561 --- /dev/null +++ b/tools/engine_licenses.gd @@ -0,0 +1,68 @@ +## R2: writes the Godot engine's own licence and the notices of the third-party code +## built into it, as the engine reports them (Engine.get_license_text(), +## get_copyright_info(), get_license_info()). The MIT licence and the others need these +## notices to travel with the binary, so the release package and the .deb ship this file. +## +## tools/godot.sh --script res://tools/engine_licenses.gd -- --out=PATH +extends SceneTree + + +func _init() -> void: + var out: String = "" + for arg: String in OS.get_cmdline_user_args(): + if arg.begins_with("--out="): + out = arg.get_slice("=", 1) + if out.is_empty(): + printerr("engine_licenses: --out=PATH is required") + quit(2) + return + var file: FileAccess = FileAccess.open(out, FileAccess.WRITE) + if file == null: + printerr("engine_licenses: can't write %s" % out) + quit(1) + return + file.store_string(text()) + file.close() + quit(0) + + +static func text() -> String: + var version: Dictionary = Engine.get_version_info() + var lines: PackedStringArray = PackedStringArray() + lines.append("Tidewall runs on the Godot Engine %s (https://godotengine.org)." % version["string"]) + lines.append("The engine's licence, and the copyright notices and licences of the") + lines.append("third-party code built into it, as the engine itself reports them.") + lines.append("") + lines.append("=" .repeat(78)) + lines.append("Godot Engine") + lines.append("=" .repeat(78)) + lines.append("") + lines.append(Engine.get_license_text().strip_edges()) + lines.append("") + lines.append("=" .repeat(78)) + lines.append("Components") + lines.append("=" .repeat(78)) + for component: Dictionary in Engine.get_copyright_info(): + lines.append("") + lines.append("%s" % component["name"]) + for part: Dictionary in component["parts"]: + lines.append(" Files: %s" % ", ".join(PackedStringArray(part["files"]))) + for holder: String in part["copyright"]: + lines.append(" Copyright: %s" % holder) + lines.append(" License: %s" % part["license"]) + lines.append("") + lines.append("=" .repeat(78)) + lines.append("Licence texts") + lines.append("=" .repeat(78)) + var licenses: Dictionary = Engine.get_license_info() + var names: Array = licenses.keys() + names.sort() + for name: String in names: + lines.append("") + lines.append("-" .repeat(78)) + lines.append(name) + lines.append("-" .repeat(78)) + lines.append("") + lines.append(String(licenses[name]).strip_edges()) + lines.append("") + return "\n".join(lines) diff --git a/tools/engine_licenses.gd.uid b/tools/engine_licenses.gd.uid new file mode 100644 index 0000000..26abb4c --- /dev/null +++ b/tools/engine_licenses.gd.uid @@ -0,0 +1 @@ +uid://b8awmp8fo2ha3