summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-05-08 12:15:35 +0200
committerMichał Górny <mgorny@gentoo.org>2022-05-09 22:31:45 +0200
commit53fc3b443284eb94b3bfb4266ee0efb890441dbd (patch)
tree1d179e57acf29a868146c764824ae2b4b31b4a67 /eclass
parentapp-office/libreoffice: ... uncomment patch (diff)
downloadgentoo-53fc3b443284eb94b3bfb4266ee0efb890441dbd.tar.gz
gentoo-53fc3b443284eb94b3bfb4266ee0efb890441dbd.tar.bz2
gentoo-53fc3b443284eb94b3bfb4266ee0efb890441dbd.zip
python-utils-r1.eclass: Add support for python3.11
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/python-utils-r1.eclass10
-rwxr-xr-xeclass/tests/python-utils-r1.sh14
2 files changed, 20 insertions, 4 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 7b1bd012a37e..2b22b0539ecb 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -43,7 +43,7 @@ inherit multiprocessing toolchain-funcs
# All supported Python implementations, most preferred last.
_PYTHON_ALL_IMPLS=(
pypy3
- python3_{8..10}
+ python3_{8..11}
)
readonly _PYTHON_ALL_IMPLS
@@ -83,7 +83,7 @@ _python_verify_patterns() {
local impl pattern
for pattern; do
case ${pattern} in
- -[23]|3.[89]|3.10)
+ -[23]|3.[89]|3.1[01])
continue
;;
esac
@@ -132,7 +132,7 @@ _python_set_impls() {
# please keep them in sync with _PYTHON_ALL_IMPLS
# and _PYTHON_HISTORICAL_IMPLS
case ${i} in
- pypy3|python2_7|python3_[89]|python3_10)
+ pypy3|python2_7|python3_[89]|python3_1[01])
;;
jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-6]|python3_[1-7])
obsolete+=( "${i}" )
@@ -245,7 +245,7 @@ _python_impl_matches() {
[[ ${impl} == python${pattern/./_} || ${impl} == pypy3 ]] &&
return 0
;;
- 3.8|3.10)
+ 3.8|3.1[01])
[[ ${impl} == python${pattern/./_} ]] && return 0
;;
*)
@@ -461,6 +461,8 @@ _python_export() {
PYTHON_PKG_DEP=">=dev-lang/python-3.9.9-r1:3.9";;
python3.10)
PYTHON_PKG_DEP=">=dev-lang/python-3.10.0_p1-r1:3.10";;
+ python3.11)
+ PYTHON_PKG_DEP=">=dev-lang/python-3.11.0_beta1:3.11";;
python*)
PYTHON_PKG_DEP="dev-lang/python:${impl#python}";;
pypy)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 9c41798c4727..e0fc0aab3c03 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -147,6 +147,20 @@ fi
test_var PYTHON_PKG_DEP python3_10 '*dev-lang/python*:3.10'
test_var PYTHON_SCRIPTDIR python3_10 /usr/lib/python-exec/python3.10
+test_var EPYTHON python3_11 python3.11
+test_var PYTHON python3_11 /usr/bin/python3.11
+if [[ -x /usr/bin/python3.11 ]]; then
+ abiflags=$(/usr/bin/python3.11 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
+ test_var PYTHON_SITEDIR python3_11 "/usr/lib/python3.11/site-packages"
+ test_var PYTHON_INCLUDEDIR python3_11 "/usr/include/python3.11${abiflags}"
+ test_var PYTHON_LIBPATH python3_11 "/usr/lib*/libpython3.11${abiflags}$(get_libname)"
+ test_var PYTHON_CONFIG python3_11 "/usr/bin/python3.11${abiflags}-config"
+ test_var PYTHON_CFLAGS python3_11 "*-I/usr/include/python3.11*"
+ test_var PYTHON_LIBS python3_11 "*-lpython3.11*"
+fi
+test_var PYTHON_PKG_DEP python3_11 '*dev-lang/python*:3.11'
+test_var PYTHON_SCRIPTDIR python3_11 /usr/lib/python-exec/python3.11
+
test_var EPYTHON pypy3 pypy3
test_var PYTHON pypy3 /usr/bin/pypy3
if [[ -x /usr/bin/pypy3 ]]; then