summaryrefslogtreecommitdiff
path: root/subprojects/pixpat/pixpat-python/scripts/build_wheel.sh
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2026-05-08 17:22:58 +0300
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2026-05-08 17:22:58 +0300
commit4e2b291a4acdc2cbd39f005c88bda363bc06bd34 (patch)
treee90048d5973ad1164b109d575cf577af7daf50be /subprojects/pixpat/pixpat-python/scripts/build_wheel.sh
parent8f94b39040e79eccd9312ed1e467fe8ebfab8860 (diff)
parente0b7d30fd437292c88141fb08d60681870b86c6e (diff)
Merge commit 'e0b7d30fd437292c88141fb08d60681870b86c6e' as 'subprojects/pixpat'
Diffstat (limited to 'subprojects/pixpat/pixpat-python/scripts/build_wheel.sh')
-rwxr-xr-xsubprojects/pixpat/pixpat-python/scripts/build_wheel.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/subprojects/pixpat/pixpat-python/scripts/build_wheel.sh b/subprojects/pixpat/pixpat-python/scripts/build_wheel.sh
new file mode 100755
index 0000000..1eb2586
--- /dev/null
+++ b/subprojects/pixpat/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 <x86_64|aarch64>
+#
+# 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-<arch>/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 <x86_64|aarch64>" >&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-<arch>/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