Files
voculinux/packaging/void/build.sh
T
soubarnak 1d8b07727e feat(void): add xbps template for python3-pywhispercpp
Spec #16 ticket #26: Void template for the whisper.cpp Python binding,
built from the pinned 1.5.0 sdist with the Vulkan backend (default-on
option), shared libraries, and portable CPU flags. Includes the podman
build/smoke harness, pinned base-image pins, and offline policy tests.

Refs: #26
2026-11-06 00:04:47 +05:30

52 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
# Host-side harness for packaging/void: runs the container flow (see
# container-main.sh and container-build.sh) in the pinned Void glibc
# container via podman, never Docker.
#
# Usage: packaging/void/build.sh <pkgname> [-- <xbps-src args...>]
#
# packaging/void/build.sh python3-pywhispercpp
# packaging/void/build.sh python3-pywhispercpp -- -o ~vulkan pkg
#
# Anything after -- is passed to `xbps-src` before the package name (use it
# for -o ~vulkan CPU-only rebuilds). The package build itself fetches
# nothing from the network beyond the template's declared distfiles:
# xbps-src verifies distfile checksums before unpacking.
set -eu
CDPATH=""
HERE=$(dirname -- "$0")
HERE=$(cd -- "$HERE" && pwd)
REPO_ROOT=$(cd -- "$HERE/../.." && pwd)
PKGNAME=${1:?usage: build.sh "<pkgname>" [-- "<xbps-src args>"]}
shift
if [ "${1:-}" = "--" ]; then
shift
fi
XBPS_ARGS=${*:-pkg}
BASE_IMAGE=$(awk '$1 == "base-image" {print $3}' "$HERE/tool_checksums.txt")
VOID_COMMIT=$(awk '$1 == "void-packages" {print $3}' "$HERE/tool_checksums.txt")
[ -n "$BASE_IMAGE" ] && [ -n "$VOID_COMMIT" ] || {
echo "build.sh: pins missing from tool_checksums.txt" >&2
exit 1
}
case "$XBPS_ARGS" in
*~vulkan*) EXPECT_VULKAN=0 ;;
*) EXPECT_VULKAN=1 ;;
esac
echo "Pulling pinned base image: $BASE_IMAGE"
podman pull "$BASE_IMAGE"
podman run --rm \
-v "$REPO_ROOT/packaging/void/srcpkgs:/overlay:ro" \
-v "$HERE/container-main.sh:/mnt/container-main.sh:ro" \
-v "$HERE/container-build.sh:/mnt/container-build.sh:ro" \
-e "VOID_COMMIT=$VOID_COMMIT" \
-e "PKGNAME=$PKGNAME" \
-e "XBPS_ARGS=$XBPS_ARGS" \
-e "EXPECT_VULKAN=$EXPECT_VULKAN" \
"$BASE_IMAGE" /bin/sh /mnt/container-main.sh
echo "OK: $PKGNAME built and imported cleanly"