18 Commits

Author SHA1 Message Date
9ee9ddaa29 Update changelog for 0.6.0-1~4.gbpd36981 release 2025-11-20 08:55:15 -06:00
d36981fc0f Rename binary package to not collide with native
I haven't really thought about what I'm going to do to bring the WASM
and native builds back together...
2025-11-19 15:22:44 -06:00
7a5313c766 Use 'www-data' user & group for webserver 2025-11-19 15:12:36 -06:00
09cc2116b7 Update changelog for 0.6.0-1~3.gbp7c5d9c release 2025-11-19 13:21:15 -06:00
7c5d9c6af0 Switch arch from "any" to "all" 2025-11-19 13:20:15 -06:00
98212aa6bc Add a runtime dependency on Python3 (http.server) 2025-11-19 13:19:54 -06:00
e6379af883 Rename service unit file to match package name
So that debhelper automatically installs it for me, instead of adding my
own install target.
2025-11-19 13:11:44 -06:00
a5734b0174 Patch Makefile to have a var for web root 2025-11-19 13:09:51 -06:00
c8cf70bd52 Override d/rules install to pass web root along 2025-11-19 13:08:51 -06:00
9dbd3d953e Add a Systemd service unit file for the server 2025-11-19 12:54:44 -06:00
41ca417386 Drop unneeded build-dep 2025-11-19 12:34:19 -06:00
6e2482f68c Update changelog for new snapshot 2025-11-19 12:25:16 -06:00
f383836c24 Fix branch name in d/gbp.conf 2025-11-19 12:24:45 -06:00
de58cd8d7c Mangle the rules file, trying to get WASM build 2025-11-19 10:18:15 -06:00
3d9dc77837 Build-Depend on rust-llvm to get default linker
Cargo is trying to use rust-lld by default. Instead of patching the
config file to use "lld", name the dependency in the dependencies list.
2025-11-19 10:14:20 -06:00
f7a49a2760 Revert "Build for WASM32 and use the LLD linker"
This reverts commit 3cabfa46c3.

I don't need to patch the linker, I need to take a dependency on the one
it's trying to use.
2025-11-19 10:13:07 -06:00
3cabfa46c3 Build for WASM32 and use the LLD linker 2025-11-18 14:13:18 -06:00
bb99cc8042 Add build dependency on the LLD linker
Rust defaults to `rust-lld`, which is somehow different from the no-
prefix "lld". I can add a patch to .cargo/config.toml to override the
linker selection.
2025-11-18 14:10:24 -06:00
7 changed files with 109 additions and 18 deletions

14
debian/boids-webserver.service vendored Normal file
View File

@@ -0,0 +1,14 @@
[Unit]
Description=A website hosting a WASM build of Boids
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/env python3 -m http.server -d /usr/share/boids 8000
Restart=never
User=www-data
Group=www-data
WorkingDirectory=/usr/share/boids
[Install]
WantedBy=multi-user.target

24
debian/changelog vendored
View File

@@ -1,6 +1,6 @@
another-boids-in-rust (0.6.0-1~1.gbp57907c) UNRELEASED; urgency=medium another-boids-in-rust (0.6.0-1~4.gbpd36981) UNRELEASED; urgency=medium
** SNAPSHOT build @57907c105ab79d6b10bcb730d9cbcab8e693f150 ** ** SNAPSHOT build @d36981fc0f93d12421972c17e444a18f9ad540db **
* Fix: Missing destination in Docker copy instr. * Fix: Missing destination in Docker copy instr.
* Add a Makefile to make web builds more ergonomic * Add a Makefile to make web builds more ergonomic
@@ -41,8 +41,26 @@ another-boids-in-rust (0.6.0-1~1.gbp57907c) UNRELEASED; urgency=medium
* Pin transitive dep ruzstd=0.8.1 * Pin transitive dep ruzstd=0.8.1
* Lock the new dependencies and vendor them * Lock the new dependencies and vendor them
* Re-diff patch queue * Re-diff patch queue
* Update changelog for 0.6.0-1~1.gbp57907c release
* Add build dependency on the LLD linker
* Build for WASM32 and use the LLD linker
* Revert "Build for WASM32 and use the LLD linker"
* Build-Depend on rust-llvm to get default linker
* Mangle the rules file, trying to get WASM build
* Fix branch name in d/gbp.conf
* Update changelog for new snapshot
* Drop unneeded build-dep
* Add a Systemd service unit file for the server
* Override d/rules install to pass web root along
* Patch Makefile to have a var for web root
* Rename service unit file to match package name
* Add a runtime dependency on Python3 (http.server)
* Switch arch from "any" to "all"
* Update changelog for 0.6.0-1~3.gbp7c5d9c release
* Use 'www-data' user & group for webserver
* Rename binary package to not collide with native
-- Robert Garrett <robertgarrett404@gmail.com> Tue, 18 Nov 2025 13:32:25 -0600 -- Robert Garrett <robertgarrett404@gmail.com> Thu, 20 Nov 2025 08:55:14 -0600
another-boids-in-rust (0.3.0-1.1) unstable; urgency=medium another-boids-in-rust (0.3.0-1.1) unstable; urgency=medium

6
debian/control vendored
View File

@@ -9,16 +9,18 @@ Build-Depends:
pkg-config, pkg-config,
libasound2-dev, libasound2-dev,
libudev-dev, libudev-dev,
rust-llvm,
Homepage: https://git.gelvin.dev/robert/boids Homepage: https://git.gelvin.dev/robert/boids
Vcs-Git: https://git.gelvin.dev/robert/boids Vcs-Git: https://git.gelvin.dev/robert/boids
Vcs-Browser: https://git.gelvin.dev/robert/boids Vcs-Browser: https://git.gelvin.dev/robert/boids
Rules-Requires-Root: no Rules-Requires-Root: no
Package: another-boids-in-rust Package: boids-webserver
Architecture: any Architecture: all
Depends: Depends:
${misc:Depends}, ${misc:Depends},
${shlibs:Depends}, ${shlibs:Depends},
python3,
Description: Another Boids implementation in Rust. Description: Another Boids implementation in Rust.
Boids is a flocking algorithm. This one is built in Rust using the Bevy game Boids is a flocking algorithm. This one is built in Rust using the Bevy game
engine. engine.

2
debian/gbp.conf vendored
View File

@@ -2,5 +2,5 @@
compression = xz compression = xz
compression-level = 9 compression-level = 9
upstream-tag = v%(version)s+vendor upstream-tag = v%(version)s+vendor
debian-branch = deb/trixie debian-branch = deb/trixie-web

View File

@@ -0,0 +1,35 @@
From: Robert Garrett <robertgarrett404@gmail.com>
Date: Wed, 19 Nov 2025 12:49:33 -0600
Subject: Patch Makefile to have a var for web root
---
Makefile | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 742d029..8935b7e 100644
--- a/Makefile
+++ b/Makefile
@@ -7,8 +7,9 @@
CARGO_TARGET := wasm32-unknown-unknown
CARGO_PROFILE := wasm-release
-# Override DESTDIR to set a custom install path (such as your web root)
+# Actually, this is so Debian can install the program into it's "build home"
DESTDIR ?= .
+WEBROOT ?= boids # THIS is the web root
SRC_DIR = ./src
SRCS := $(wildcard $(SRC_DIR)/**)
@@ -67,7 +68,7 @@ full-clean: clean
# Installation goal. It's meant to be a helper utility for moving the built
# output into the web root. Only supports the "bundle-able" mode.
install: web
- install -dm0755 $(DESTDIR)
- install -m0644 out/boids.js $(DESTDIR)/
- install -m0644 out/boids_bg.wasm.gz $(DESTDIR)/
- install -m0644 out/boids.html $(DESTDIR)/
+ install -dm0755 $(DESTDIR)/$(WEBROOT)
+ install -m0644 out/boids.js $(DESTDIR)/$(WEBROOT)/
+ install -m0644 out/boids_bg.wasm.gz $(DESTDIR)/$(WEBROOT)/
+ install -m0644 out/boids.html $(DESTDIR)/$(WEBROOT)/

View File

@@ -1,3 +1,4 @@
0001-Alter-blake3-to-emit-Built-Using-info.patch 0001-Alter-blake3-to-emit-Built-Using-info.patch
0002-Use-pure-Rust-implementation-of-Blake3-parts.patch 0002-Use-pure-Rust-implementation-of-Blake3-parts.patch
0003-Use-mini-as-release-profile.patch 0003-Use-mini-as-release-profile.patch
0004-Patch-Makefile-to-have-a-var-for-web-root.patch

45
debian/rules vendored
View File

@@ -1,27 +1,48 @@
#!/usr/bin/make -f #!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all DH_VERBOSE = 1
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk # export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/rustc/architecture.mk # DPKG_EXPORT_BUILDFLAGS = 1
export DEB_HOST_RUST_TYPE
export PATH:=/usr/share/cargo/bin:$(PATH) # Remove because they're for normal builds, not "cross" builds, or what ever
export CARGO=/usr/share/cargo/bin/cargo # WASM is considered to be. Sort-of a cross-compile, but it isn't self hosting,
# so I'm not sure what to call it.
# include /usr/share/dpkg/default.mk
# include /usr/share/rustc/architecture.mk
# finds package info and puts it in vars like DEB_VERSION_UPSTREAM
include /usr/share/dpkg/pkg-info.mk
export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
CARGO=/usr/share/cargo/bin/cargo
export CARGO_HOME=$(CURDIR)/debian/cargo_home export CARGO_HOME=$(CURDIR)/debian/cargo_home
export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM) export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
WEBROOT=/usr/share/boids/
export WEBROOT
%: %:
dh $@ --buildsystem=cargo dh $@
execute_after_dh_auto_clean: execute_after_dh_auto_clean:
$(CARGO) clean # $(CARGO) clean
rm -rf $(CARGO_HOME) rm -rf $(CARGO_HOME)
rm -rf $(CARGO_REGISTRY) rm -rf $(CARGO_REGISTRY)
rm -f debian/cargo-checksum.json rm -f debian/cargo-checksum.json
execute_before_dh_auto_configure: override_dh_auto_configure:
$(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system $(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system
rm -f Cargo.lock
touch debian/cargo-checksum.json touch debian/cargo-checksum.json
# patch cargo_home config to use lld with wasm, otherwise the build fails
echo "\n[target.wasm32-unknown-unknown]" >> debian/cargo_home/config.toml
cat debian/cargo_home/config.toml | sed "s/linker=[^']\+/linker=rust-lld/" | grep "^rustflags = " >> debian/cargo_home/config.toml
dh_auto_configure
override_dh_auto_test:
# No tests. Can't execute a WASM binary
echo "Skipping tests, can't run WASM files"
override_dh_auto_install:
dh_auto_install WEBROOT=$(WEBROOT)