Files
another-boids-in-rust/debian/patches/0004-Patch-Makefile-to-have-a-var-for-web-root.patch

36 lines
1.2 KiB
Diff

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)/