summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-05-05 19:59:20 +0200
committerMichał Górny <mgorny@gentoo.org>2021-05-12 11:54:44 +0200
commit7c5a4f2407501fb9cc39b97c9822140b478b74cf (patch)
tree416514fcfa358ce90422b04404af3d8299e96acb /eclass
parentapp-editors/mousepad: Bump to 0.5.5 (diff)
downloadgentoo-7c5a4f2407501fb9cc39b97c9822140b478b74cf.tar.gz
gentoo-7c5a4f2407501fb9cc39b97c9822140b478b74cf.tar.bz2
gentoo-7c5a4f2407501fb9cc39b97c9822140b478b74cf.zip
python-utils-r1.eclass: Grab paths from sysconfig module
Grab site-packages and includedir paths from sysconfig rather than distutils.sysconfig, as the latter module is deprecated. The new method results in the same paths for all supported implementations, as confirmed by the tests. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/python-utils-r1.eclass7
1 files changed, 2 insertions, 5 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 60526b1f6b14..0082a231f0a0 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -318,16 +318,13 @@ _python_export() {
;;
PYTHON_SITEDIR)
[[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it"
- # sysconfig can't be used because:
- # 1) pypy doesn't give site-packages but stdlib
- # 2) jython gives paths with wrong case
- PYTHON_SITEDIR=$("${PYTHON}" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())') || die
+ PYTHON_SITEDIR=$("${PYTHON}" -c 'import sysconfig; print(sysconfig.get_path("purelib"))') || die
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}" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())') || die
+ PYTHON_INCLUDEDIR=$("${PYTHON}" -c 'import sysconfig; print(sysconfig.get_path("platinclude"))') || die
export PYTHON_INCLUDEDIR
debug-print "${FUNCNAME}: PYTHON_INCLUDEDIR = ${PYTHON_INCLUDEDIR}"