build: resolve SCHEME from $(JERBOA_HOME)/.chez/bin/scheme

ober

4cd9d8ff7b205b1564b911cc61087fd5b738b028

diff --git a/Makefile b/Makefile
index 2ca88f1..5f9afdf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 JERBOA_HOME ?= $(realpath $(CURDIR)/../jerboa)
-SCHEME ?= scheme
+SCHEME ?= $(JERBOA_HOME)/.chez/bin/scheme
 BIN_DIR := $(HOME)/.local/bin
 TEMPLATE_DIR := $(HOME)/.git-templates
 HOOK_DIR := $(TEMPLATE_DIR)/hooks
diff --git a/build-gitsafe-macos.sh b/build-gitsafe-macos.sh
index 9b94e5f..2c58b3f 100755
--- a/build-gitsafe-macos.sh
+++ b/build-gitsafe-macos.sh
@@ -26,6 +26,7 @@ else
     exit 1
 fi
 export JERBOA_HOME="${JERBOA_HOME:-$(dirname "$JERBOA_LIB")}"
+SCHEME="${SCHEME:-${JERBOA_HOME}/.chez/bin/scheme}"
 
 echo "==================================="
 echo "Building gitsafe-macos (static libs)"
@@ -40,13 +41,13 @@ if [ "$(uname -s)" != "Darwin" ]; then
 fi
 
 # Check Chez
-if ! command -v scheme &>/dev/null; then
-    echo "ERROR: scheme not found"
-    echo "Install: brew install chezscheme"
+if [ ! -x "$SCHEME" ]; then
+    echo "ERROR: scheme not found at $SCHEME"
+    echo "Run 'make chez' in ${JERBOA_HOME} (or set SCHEME=... to override)."
     exit 1
 fi
 
-echo "  scheme: $(command -v scheme) ($(scheme --version 2>&1))"
+echo "  scheme: $SCHEME ($("$SCHEME" --version 2>&1))"
 echo ""
 
 echo "[1/2] Validating macOS build environment..."
@@ -68,7 +69,7 @@ echo "  ncurses: ${NCURSES_A:-dynamic}"
 echo ""
 
 echo "[2/2] Running macOS build..."
-scheme -q --libdirs "${SCRIPT_DIR}:${JERBOA_LIB}" --script build-gitsafe-macos.ss
+"$SCHEME" -q --libdirs "${SCRIPT_DIR}:${JERBOA_LIB}" --script build-gitsafe-macos.ss
 
 # Verify
 if [ -f "gitsafe-macos" ]; then
diff --git a/build-gitsafe-musl.sh b/build-gitsafe-musl.sh
index 62d6528..59ec647 100755
--- a/build-gitsafe-musl.sh
+++ b/build-gitsafe-musl.sh
@@ -25,6 +25,12 @@ else
     exit 1
 fi
 export JERBOA_HOME="${JERBOA_HOME:-$(dirname "$JERBOA_LIB")}"
+SCHEME="${SCHEME:-${JERBOA_HOME}/.chez/bin/scheme}"
+if [ ! -x "$SCHEME" ]; then
+    echo "ERROR: scheme not found at $SCHEME" >&2
+    echo "Run 'make chez' in ${JERBOA_HOME} (or set SCHEME=... to override)." >&2
+    exit 1
+fi
 
 echo "==================================="
 echo "Building gitsafe-musl (static)"
@@ -45,7 +51,7 @@ echo "  musl-gcc: $(command -v musl-gcc)"
 echo ""
 
 echo "[2/2] Running musl build..."
-scheme -q --libdirs "${SCRIPT_DIR}:${JERBOA_LIB}" --script build-gitsafe-musl.ss
+"$SCHEME" -q --libdirs "${SCRIPT_DIR}:${JERBOA_LIB}" --script build-gitsafe-musl.ss
 
 # Verify
 if [ -f "gitsafe-musl" ]; then