Files
source-stack/debian13/build.sh
T
GuofangandClaude Sonnet 5.5 f18e95dace 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>
2026-10-27 16:39:15 +08:00

22 lines
649 B
Bash
Executable File

#!/bin/sh
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"
if ! command -v podman >/dev/null 2>&1; then
echo "Error: Podman is required." >&2
exit 1
fi
SOURCES_DIR="$SOURCES_DIR" "$FETCH_SCRIPT"
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"