python-utils-r1.eclass: Enable python3_9
authorMichał Górny <mgorny@gentoo.org>
Mon, 25 May 2020 06:04:34 +0000 (08:04 +0200)
committerMichał Górny <mgorny@gentoo.org>
Mon, 25 May 2020 06:07:18 +0000 (08:07 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
eclass/python-utils-r1.eclass
eclass/tests/python-utils-r1.sh

index 4af710da363b2ecd191fdc858ee703f390d82499..1067d2367aba574adcd82608b3f67b7de2d58511 100644 (file)
@@ -41,7 +41,7 @@ inherit toolchain-funcs
 _PYTHON_ALL_IMPLS=(
        pypy3
        python2_7
-       python3_6 python3_7 python3_8
+       python3_6 python3_7 python3_8 python3_9
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -77,7 +77,7 @@ _python_impl_supported() {
        # keep in sync with _PYTHON_ALL_IMPLS!
        # (not using that list because inline patterns shall be faster)
        case "${impl}" in
-               python2_7|python3_[678]|pypy3)
+               python2_7|python3_[6789]|pypy3)
                        return 0
                        ;;
                jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[56]|python3_[12345])
index 192c1183e8008350380d6b4f1bdd8b4b888f8db8..86b87ec173d447d1e357b0f83da2ad4c613b3208 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -115,6 +115,20 @@ fi
 test_var PYTHON_PKG_DEP python3_8 '*dev-lang/python*:3.8'
 test_var PYTHON_SCRIPTDIR python3_8 /usr/lib/python-exec/python3.8
 
+test_var EPYTHON python3_9 python3.9
+test_var PYTHON python3_9 /usr/bin/python3.9
+if [[ -x /usr/bin/python3.9 ]]; then
+       abiflags=$(/usr/bin/python3.9 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
+       test_var PYTHON_SITEDIR python3_9 "/usr/lib/python3.9/site-packages"
+       test_var PYTHON_INCLUDEDIR python3_9 "/usr/include/python3.9${abiflags}"
+       test_var PYTHON_LIBPATH python3_9 "/usr/lib*/libpython3.9${abiflags}$(get_libname)"
+       test_var PYTHON_CONFIG python3_9 "/usr/bin/python3.9${abiflags}-config"
+       test_var PYTHON_CFLAGS python3_9 "*-I/usr/include/python3.9*"
+       test_var PYTHON_LIBS python3_9 "*-lpython3.9*"
+fi
+test_var PYTHON_PKG_DEP python3_9 '*dev-lang/python*:3.9'
+test_var PYTHON_SCRIPTDIR python3_9 /usr/lib/python-exec/python3.9
+
 test_var EPYTHON pypy3 pypy3
 test_var PYTHON pypy3 /usr/bin/pypy3
 if [[ -x /usr/bin/pypy3 ]]; then