#!/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 [-- ] # # 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 "" [-- ""]} 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"