Make the debian13 install prefix configurable

Replace the hard-coded /usr/local with a PREFIX build argument (default
/usr/local) and add a MULTIARCH argument for the Debian multiarch library
directory. The toolchain only searches /usr/local by default, so export
PATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, LIBRARY_PATH, PKG_CONFIG_PATH,
CMAKE_PREFIX_PATH and CMAKE_INSTALL_PREFIX for other prefixes. build.sh
passes PREFIX and derives MULTIARCH from uname -m.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
GuofangandClaude Sonnet 5.5 committed 2026-10-27 16:39:15 +08:00
1 parent 8f24cf0e17
commit f18e95dace
2 files changed
+45 -25

No files matched your search

+5 -2
View File
@@ -3,6 +3,7 @@
set -eu
IMAGE_NAME="${IMAGE_NAME:-debian13-source-stack}"
PREFIX="${PREFIX:-/usr/local}"
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
SOURCES_DIR="${SOURCES_DIR:-$SCRIPT_DIR/../sources}"
FETCH_SCRIPT="$SCRIPT_DIR/../fetch-sources.sh"
@@ -14,5 +15,7 @@ fi
SOURCES_DIR="$SOURCES_DIR" "$FETCH_SCRIPT"
echo "Building image $IMAGE_NAME with podman ..."
exec podman build --build-context sources="$SOURCES_DIR" --tag "$IMAGE_NAME" "$SCRIPT_DIR"
echo "Building image $IMAGE_NAME with podman (prefix $PREFIX) ..."
exec podman build --build-context sources="$SOURCES_DIR" \
--build-arg PREFIX="$PREFIX" --build-arg MULTIARCH="$(uname -m)-linux-gnu" \
--tag "$IMAGE_NAME" "$SCRIPT_DIR"