summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2023-08-25 22:15:06 +0100
committerJames Le Cuirot <chewi@gentoo.org>2023-09-12 08:45:32 +0100
commit8385562ce1a2ada550150ec14b20e4b14aadf840 (patch)
tree0f9118647331fe2ed88bf7d23c8ed61da30dd6b6 /eclass
parentsci-libs/coinor-utils: add 2.11.9 (diff)
downloadgentoo-8385562ce1a2ada550150ec14b20e4b14aadf840.tar.gz
gentoo-8385562ce1a2ada550150ec14b20e4b14aadf840.tar.bz2
gentoo-8385562ce1a2ada550150ec14b20e4b14aadf840.zip
python-utils-r1.eclass: Redo cross-prefix support using sysconfig
We recently supported cross-prefix by rewriting PYTHON_SITEDIR and PYTHON_INCLUDEDIR from BROOT to EPREFIX. We now know that you can get sysconfig to use EPREFIX in the first place, which is cleaner. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/python-utils-r1.eclass14
1 files changed, 6 insertions, 8 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index f9c6d161d3f3..bd30c1203180 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -346,24 +346,22 @@ _python_export() {
PYTHON_SITEDIR)
[[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it"
PYTHON_SITEDIR=$(
- "${PYTHON}" - <<-EOF || die
- import sysconfig
- print(sysconfig.get_path("purelib"))
+ "${PYTHON}" - "${EPREFIX}/usr" <<-EOF || die
+ import sys, sysconfig
+ print(sysconfig.get_path("purelib", vars={"base": sys.argv[1]}))
EOF
)
- PYTHON_SITEDIR=${EPREFIX}${PYTHON_SITEDIR#"${BROOT-${EPREFIX}}"}
export PYTHON_SITEDIR
debug-print "${FUNCNAME}: PYTHON_SITEDIR = ${PYTHON_SITEDIR}"
;;
PYTHON_INCLUDEDIR)
[[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it"
PYTHON_INCLUDEDIR=$(
- "${PYTHON}" - <<-EOF || die
- import sysconfig
- print(sysconfig.get_path("platinclude"))
+ "${PYTHON}" - "${ESYSROOT}/usr" <<-EOF || die
+ import sys, sysconfig
+ print(sysconfig.get_path("platinclude", vars={"installed_platbase": sys.argv[1]}))
EOF
)
- PYTHON_INCLUDEDIR=${ESYSROOT}${PYTHON_INCLUDEDIR#"${BROOT-${EPREFIX}}"}
export PYTHON_INCLUDEDIR
debug-print "${FUNCNAME}: PYTHON_INCLUDEDIR = ${PYTHON_INCLUDEDIR}"