Add jpkg package CI

ober

5e4d52b9751e925d56b68cf06ddc45d295f38f15

diff --git a/.build.yml b/.build.yml
index ca289f3..e454081 100644
--- a/.build.yml
+++ b/.build.yml
@@ -28,6 +28,7 @@ artifacts:
   # Saved + downloadable from the build job page. Path is relative to ~ (home);
   # the repo is cloned to ~/jerboa-browser and build-tarball.sh writes here.
   - jerboa-browser/qt-webengine/build/jerboa-browser-0.0.1-linux-x86_64.tar.gz
+  - jerboa-browser/jerboa-browser-0.1.0.jpkg
   # Offline Qt snapshot PNGs from the test-gui task (the harness output).
   - jerboa-browser/gui-snapshots.tar.gz
 tasks:
@@ -41,15 +42,24 @@ tasks:
       sudo make install
       scheme --version
   - jerbuild: |
-      # The build switched to a jerbuild-based flow (jerboa-browser commit
-      # 1eda9c4) but CI was never updated to provide jerbuild. Its source lives
-      # in the jerboa repo (jerbuild.ss); build it with the Chez installed above
-      # and put it on PATH so `make binary` / `make test-*` can find it.
+      # Build the multicall Jerboa tool image and install jerbuild/jpkg
+      # symlinks onto PATH so binary builds and package checks use the same
+      # standalone toolchain users install.
       cd jerboa
-      SCHEME="$(command -v scheme)" sh support/build-jerbuild.sh
-      sudo install -m 0755 jerbuild /usr/local/bin/jerbuild
+      make SCHEME="$(command -v scheme)" jerboa
+      sudo install -m 0755 dist/jerboa /usr/local/bin/jerboa
+      sudo ln -sf jerboa /usr/local/bin/jerbuild
+      sudo ln -sf jerboa /usr/local/bin/jpkg
       jerbuild --version
       jerbuild --jerboa-home >/dev/null   # extract the bundled stdlib into the cache
+  - package: |
+      cd jerboa-browser
+      jerboa pkg verify
+      jerboa pkg policy
+      jerboa pkg build
+      jerboa pkg pack --output "$PWD/jerboa-browser-0.1.0.jpkg"
+      jerboa pkg verify "$PWD/jerboa-browser-0.1.0.jpkg"
+      jerboa pkg verify --reproduce
   - build: |
       cd jerboa-browser
       qmake6 --version || true
diff --git a/Makefile b/Makefile
index 0d9b70e..dd90b95 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ JERBOA_YUBIKEY_DIR := vendor/jerboa-yubikey
 JERBOA_YUBIKEY_LIB := $(JERBOA_YUBIKEY_DIR)/lib
 JEXEC       := $(JERBUILD) exec --libdirs $(CURDIR)/$(JERBOA_YUBIKEY_LIB):$(CURDIR)/scheme:$(CURDIR)/vendor/jerboa-fuse/lib:$(JH)/lib
 JERBUILD_ERROR := "ERROR: jerbuild not found on PATH (or '$(JERBUILD) --jerboa-home' failed). Install jerbuild, or set JERBUILD=/path/to/jerbuild."
+BIN_DIR ?= $(HOME)/.local/bin
 
 CC ?= cc
 CARGO ?= cargo
@@ -64,7 +65,7 @@ lib/libyubikey_native.$(SOEXT): vendor-yubikey
 
 yubikey-native: lib/libyubikey_native.$(SOEXT)
 
-.PHONY: all build binary run test test-keymap test-minibuffer test-commands test-keys test-nav test-hint test-pass test-polish test-securestore test-adblock test-gui test-buffers repl clean help check-jerbuild check-docker static-qt docker-static-qt vault-secret rotate-vault-secret vendor-yubikey yubikey-native
+.PHONY: all build binary install run test test-keymap test-minibuffer test-commands test-keys test-nav test-hint test-pass test-polish test-securestore test-adblock test-gui test-buffers repl clean help check-jerbuild check-docker static-qt docker-static-qt vault-secret rotate-vault-secret vendor-yubikey yubikey-native
 .DEFAULT_GOAL := help
 
 all: binary
@@ -86,6 +87,11 @@ build: binary
 run: binary
 	./jerboa-browser $(ARGS)
 
+install: binary
+	mkdir -p $(BIN_DIR)
+	install -m 0755 jerboa-browser $(BIN_DIR)/jerboa-browser
+	@echo "Installed jerboa-browser to $(BIN_DIR)/jerboa-browser"
+
 # The crypto-using interpreter suites load (std crypto native-rust), so stage the
 # Rust crypto lib (rule above) as a prerequisite of each.
 test-securestore test-commands test-keys test-nav test-hint test-pass test-polish test-adblock: lib/libjerboa_native.$(SOEXT) vendor-yubikey
@@ -227,6 +233,7 @@ help:
 	@echo "jerboa-browser — programmable Qt WebEngine pane from the Jerboa REPL"
 	@echo ""
 	@echo "  make binary   build the self-contained native ./jerboa-browser"
+	@echo "  make install  build + install to $(BIN_DIR)/jerboa-browser"
 	@echo "  make static-qt build the bundled Linux Qt/WebEngine tarball via Docker"
 	@echo "  make vault-secret create the local build vault secret, if missing"
 	@echo "  make rotate-vault-secret replace the local build vault secret"
diff --git a/jpkg.policy.sexp b/jpkg.policy.sexp
new file mode 100644
index 0000000..7d85b4a
--- /dev/null
+++ b/jpkg.policy.sexp
@@ -0,0 +1,3 @@
+(policy
+  (mode dev)
+  (allow (native-build) (build-network) (test-network) (ffi)))
diff --git a/jpkg.sexp b/jpkg.sexp
new file mode 100644
index 0000000..5f10ee9
--- /dev/null
+++ b/jpkg.sexp
@@ -0,0 +1,14 @@
+(package
+  (name "@lisp/jerboa-browser")
+  (version "0.1.0")
+  (description "Programmable Qt WebEngine browser controlled from Jerboa")
+  (license "UNLICENSED")
+  (source "https://git.sr.ht/~lisp/jerboa-browser")
+  (jerboa ">=0.2.0")
+  (modules ((root "scheme")))
+  (dependencies ())
+  (dev-dependencies ())
+  (capabilities ((native-code reason: "Qt WebEngine, adblock, FUSE, YubiKey, and crypto native shims")
+                 (network build: #t test: #t)
+                 (ffi libraries: ("jerboa_browser" "jerboa_native" "jerboa_fuse_mount" "yubikey_native" "Qt6WebEngineCore"))
+                 (executables ("jerboa-browser")))))