From 9b921f0a27acb73f29835bcf94b91bbdef87e9de Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 14 Dec 2022 15:30:24 +0000 Subject: gentoo auto-resync : 14:12:2022 - 15:30:24 --- eclass/python-utils-r1.eclass | 80 ++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 54 deletions(-) (limited to 'eclass/python-utils-r1.eclass') diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index c0099fa756ad..d7b3df6105ab 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -133,9 +133,9 @@ _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_1[01]) + pypy3|python3_[89]|python3_1[01]) ;; - jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-6]|python3_[1-7]) + jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-7]|python3_[1-7]) obsolete+=( "${i}" ) ;; *) @@ -172,13 +172,7 @@ _python_set_impls() { done if [[ ! ${supp[@]} ]]; then - # special-case python2_7 for python-any-r1 - if [[ ${_PYTHON_ALLOW_PY27} ]] && has python2_7 "${PYTHON_COMPAT[@]}" - then - supp+=( python2_7 ) - else - die "No supported implementation in PYTHON_COMPAT." - fi + die "No supported implementation in PYTHON_COMPAT." fi if [[ ${_PYTHON_SUPPORTED_IMPLS[@]} ]]; then @@ -412,10 +406,6 @@ _python_export() { local val case "${impl}" in - python2*|python3.6|python3.7*) - # python* up to 3.7 - val=$($(tc-getPKG_CONFIG) --libs ${impl/n/n-}) || die - ;; python*) # python3.8+ val=$($(tc-getPKG_CONFIG) --libs ${impl/n/n-}-embed) || die @@ -454,22 +444,16 @@ _python_export() { PYTHON_PKG_DEP) local d case ${impl} in - python2.7) - PYTHON_PKG_DEP='>=dev-lang/python-2.7.10_p16:2.7';; python3.8) - PYTHON_PKG_DEP=">=dev-lang/python-3.8.15_p3:3.8";; + PYTHON_PKG_DEP=">=dev-lang/python-3.8.16:3.8";; python3.9) - PYTHON_PKG_DEP=">=dev-lang/python-3.9.15_p3:3.9";; + PYTHON_PKG_DEP=">=dev-lang/python-3.9.16:3.9";; python3.10) - PYTHON_PKG_DEP=">=dev-lang/python-3.10.8_p3:3.10";; + PYTHON_PKG_DEP=">=dev-lang/python-3.10.9:3.10";; python3.11) - PYTHON_PKG_DEP=">=dev-lang/python-3.11.0_p2:3.11";; - python*) - PYTHON_PKG_DEP="dev-lang/python:${impl#python}";; - pypy) - PYTHON_PKG_DEP='>=dev-python/pypy-7.3.9-r2:0=';; + PYTHON_PKG_DEP=">=dev-lang/python-3.11.1:3.11";; pypy3) - PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.9_p9:0=';; + PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.10-r1:0=';; *) die "Invalid implementation: ${impl}" esac @@ -643,22 +627,22 @@ python_optimize() { einfo "Optimize Python modules for ${instpath}" case "${EPYTHON}" in - python2.7|python3.[34]) - "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" - "${PYTHON}" -OO -m compileall -q -f -d "${instpath}" "${d}" - ;; - python3.[5678]|pypy3) + python3.8) # both levels of optimization are separate since 3.5 "${PYTHON}" -m compileall -j "${jobs}" -q -f -d "${instpath}" "${d}" "${PYTHON}" -O -m compileall -j "${jobs}" -q -f -d "${instpath}" "${d}" "${PYTHON}" -OO -m compileall -j "${jobs}" -q -f -d "${instpath}" "${d}" ;; - python*) + python*|pypy3) + # Python 3.9+ "${PYTHON}" -m compileall -j "${jobs}" -o 0 -o 1 -o 2 --hardlink-dupes -q -f -d "${instpath}" "${d}" ;; - *) + pypy) "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" ;; + *) + die "${FUNCNAME}: unexpected EPYTHON=${EPYTHON}" + ;; esac done } @@ -955,15 +939,6 @@ _python_wrapper_setup() { local EPYTHON PYTHON _python_export "${impl}" EPYTHON PYTHON - local pyver pyother - if [[ ${EPYTHON} != python2* ]]; then - pyver=3 - pyother=2 - else - pyver=2 - pyother=3 - fi - # Python interpreter # note: we don't use symlinks because python likes to do some # symlink reading magic that breaks stuff @@ -972,10 +947,10 @@ _python_wrapper_setup() { #!/bin/sh exec "${PYTHON}" "\${@}" _EOF_ - cp "${workdir}/bin/python" "${workdir}/bin/python${pyver}" || die - chmod +x "${workdir}/bin/python" "${workdir}/bin/python${pyver}" || die + cp "${workdir}/bin/python" "${workdir}/bin/python3" || die + chmod +x "${workdir}/bin/python" "${workdir}/bin/python3" || die - local nonsupp=( "python${pyother}" "python${pyother}-config" ) + local nonsupp=( python2 python2-config ) # CPython-specific if [[ ${EPYTHON} == python* ]]; then @@ -984,24 +959,22 @@ _python_wrapper_setup() { exec "${PYTHON}-config" "\${@}" _EOF_ cp "${workdir}/bin/python-config" \ - "${workdir}/bin/python${pyver}-config" || die + "${workdir}/bin/python3-config" || die chmod +x "${workdir}/bin/python-config" \ - "${workdir}/bin/python${pyver}-config" || die + "${workdir}/bin/python3-config" || die # Python 2.6+. ln -s "${PYTHON/python/2to3-}" "${workdir}"/bin/2to3 || die # Python 2.7+. ln -s "${EPREFIX}"/usr/$(get_libdir)/pkgconfig/${EPYTHON/n/n-}.pc \ - "${workdir}"/pkgconfig/python${pyver}.pc || die + "${workdir}"/pkgconfig/python3.pc || die # Python 3.8+. - if [[ ${EPYTHON} != python[23].[67] ]]; then - ln -s "${EPREFIX}"/usr/$(get_libdir)/pkgconfig/${EPYTHON/n/n-}-embed.pc \ - "${workdir}"/pkgconfig/python${pyver}-embed.pc || die - fi + ln -s "${EPREFIX}"/usr/$(get_libdir)/pkgconfig/${EPYTHON/n/n-}-embed.pc \ + "${workdir}"/pkgconfig/python3-embed.pc || die else - nonsupp+=( 2to3 python-config "python${pyver}-config" ) + nonsupp+=( 2to3 python-config python3-config ) fi local x @@ -1098,11 +1071,10 @@ python_fix_shebang() { "${EPYTHON}") match=1 ;; - python|python[23]) + python|python3) match=1 - [[ ${in_path##*/} == python2 ]] && error=1 ;; - python[23].[0-9]|python3.[1-9][0-9]|pypy|pypy3|jython[23].[0-9]) + python2|python[23].[0-9]|python3.[1-9][0-9]|pypy|pypy3|jython[23].[0-9]) # Explicit mismatch. match=1 error=1 -- cgit v1.2.3