scripts: add python toolchain

This commit is contained in:
Jernej Skrabec 2024-08-23 16:27:25 +02:00
parent 85524a792d
commit e9f9e78201

View File

@ -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