summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2024-07-25 22:20:02 +0100
committerMichał Górny <mgorny@gentoo.org>2024-08-06 10:30:15 +0200
commit83739e9677a6835c9fa49c0c98e9d7bc1e331413 (patch)
tree4d1e05fa4231e47199dd0dc1baa8e265ac8ca191
parentpython-utils-r1.eclass: Add python_get_stdlib helper function (diff)
downloadgentoo-83739e9677a6835c9fa49c0c98e9d7bc1e331413.tar.gz
gentoo-83739e9677a6835c9fa49c0c98e9d7bc1e331413.tar.bz2
gentoo-83739e9677a6835c9fa49c0c98e9d7bc1e331413.zip
distutils-r1.eclass: Support cross-compiling with PyO3
Only one variable needs to be set. For details, see https://pyo3.rs/latest/building-and-distribution.html#cross-compiling. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/37708 Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--eclass/distutils-r1.eclass5
1 files changed, 5 insertions, 0 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 129ba21ab0d4..0f9dc8d14d5e 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1391,6 +1391,11 @@ distutils_pep517_install() {
;;
esac
+ # https://pyo3.rs/latest/building-and-distribution.html#cross-compiling
+ if tc-is-cross-compiler; then
+ local -x PYO3_CROSS_LIB_DIR=${SYSROOT}/$(python_get_stdlib)
+ fi
+
local build_backend=$(_distutils-r1_get_backend)
einfo " Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}"
cmd+=(