From e9f9e782016fb0ca1f19ddcadeafc35bf6a438e2 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 23 Aug 2024 16:27:25 +0200 Subject: [PATCH] scripts: add python toolchain --- scripts/build | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/build b/scripts/build index aaa50da5bf..6d8e990316 100755 --- a/scripts/build +++ b/scripts/build @@ -119,7 +119,7 @@ if [ -z "${PKG_TOOLCHAIN}" -o "${PKG_TOOLCHAIN}" = "auto" ]; then fi _auto_toolchain=" (auto-detect)" fi -if ! listcontains "meson cmake cmake-make configure ninja make autotools manual python-flit" "${PKG_TOOLCHAIN}"; then +if ! listcontains "meson cmake cmake-make configure ninja make autotools manual python-flit python" "${PKG_TOOLCHAIN}"; then die "$(print_color "CLR_ERROR" "ERROR:") unknown toolchain ${PKG_TOOLCHAIN}" fi build_msg "CLR_TOOLCHAIN" "TOOLCHAIN" "${PKG_TOOLCHAIN}${_auto_toolchain}" @@ -425,6 +425,14 @@ else echo "Executing (host): python3 -m flit_core.wheel" DONT_BUILD_LEGACY_PYC=1 python3 -m flit_core.wheel ;; + "python:target") + echo "Executing (target): python3 -m build -n -w -x ${PKG_PYTHON_OPTS_TARGET}" | tr -s " " + python_target_env python3 -m build -n -w -x ${PKG_PYTHON_OPTS_TARGET} + ;; + "python:host") + echo "Executing (host): python3 -m build -n -w -x ${PKG_PYTHON_OPTS_HOST}" | tr -s " " + DONT_BUILD_LEGACY_PYC=1 python3 -m build -n -w -x ${PKG_PYTHON_OPTS_HOST} + ;; esac fi @@ -489,7 +497,10 @@ else "python-flit:target") die "$(print_color "CLR_ERROR" "ERROR:") toolchain python-flit should not be used for target!" ;; - "python-flit:host") + "python:target") + python3 -m installer --overwrite-existing dist/*.whl -d ${INSTALL} -p /usr + ;; + "python-flit:host" | "python:host") python3 -m installer --overwrite-existing dist/*.whl ;; esac