From e0b7d30fd437292c88141fb08d60681870b86c6e Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 8 May 2026 17:22:58 +0300 Subject: Squashed 'subprojects/pixpat/' content from commit d444626 git-subtree-dir: subprojects/pixpat git-subtree-split: d444626e6ba988ec6d487800721e447f94b1eaf5 --- pixpat-python/scripts/build_wheel.sh | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 pixpat-python/scripts/build_wheel.sh (limited to 'pixpat-python/scripts/build_wheel.sh') diff --git a/pixpat-python/scripts/build_wheel.sh b/pixpat-python/scripts/build_wheel.sh new file mode 100755 index 0000000..1eb2586 --- /dev/null +++ b/pixpat-python/scripts/build_wheel.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Build a pixpat wheel for the given target architecture. +# +# Usage: pixpat-python/scripts/build_wheel.sh +# +# Meson is invoked from setup.py during the wheel build; this script just +# selects the target arch and hands off to `python -m build`. The meson +# build dir lands at pixpat-python/build-/native/, so cross-compiling +# both arches in turn keeps each arch's compile incremental. +# +# Prerequisites: +# - meson, ninja in PATH (e.g. `pip install meson ninja`) +# - For aarch64: gcc-aarch64-linux-gnu, g++-aarch64-linux-gnu +# (sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu) +# - Python with `build` package: pip install build + +set -euo pipefail + +ARCH="${1:-}" +case "$ARCH" in + x86_64|aarch64) ;; + *) + echo "usage: $0 " >&2 + exit 1 + ;; +esac + +REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +cd "$REPO_ROOT" + +# --no-isolation: reuse the host environment so meson's per-arch build dir +# (pixpat-python/build-/native/) survives across invocations and stays +# incremental. Build isolation copies the source to a temp dir, so the meson +# build dir would be thrown away each run. +PIXPAT_TARGET_ARCH="$ARCH" python -m build --wheel --no-isolation + +echo +echo "Wheel(s) in dist/:" +ls -1 dist/*.whl -- cgit v1.2.3