python: Add environment variables to build Rust extensions

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
Jeffery To
2023-09-13 12:15:18 +08:00
committed by Rosen Penev
parent f467f47f0c
commit 4d43be8549
2 changed files with 10 additions and 2 deletions

View File

@@ -44,7 +44,12 @@ PYTHON3_VARS = \
PYTHONDONTWRITEBYTECODE=1 \
_python_sysroot="$(STAGING_DIR)" \
_python_prefix="/usr" \
_python_exec_prefix="/usr"
_python_exec_prefix="/usr" \
CARGO_BUILD_TARGET="$(RUSTC_TARGET_ARCH)" \
CARGO_HOME="$(CARGO_HOME)" \
PATH="$(CARGO_HOME)/bin:$(PATH)" \
PYO3_CROSS_LIB_DIR="$(PYTHON3_LIB_DIR)" \
RUSTFLAGS="$(CARGO_RUSTFLAGS)"
# $(1) => directory of python script
# $(2) => python script and its arguments