dev-python/pypy-exe: Fix using pypy for build
authorMichał Górny <mgorny@gentoo.org>
Wed, 1 Jan 2020 15:00:32 +0000 (16:00 +0100)
committerMichał Górny <mgorny@gentoo.org>
Wed, 1 Jan 2020 16:04:11 +0000 (17:04 +0100)
Now that pypy target is removed, we can't use it via eclass.  Make
the ebuild call it directly instead.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/pypy-exe/pypy-exe-7.3.0.ebuild

index c8701c10e59c09b18926e14d855ad088aface1ee..0b1e0997bb9166b119687dbefb938534e2928239 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-PYTHON_COMPAT=( python2_7 pypy )
+PYTHON_COMPAT=( python2_7 )
 inherit check-reqs pax-utils python-any-r1 toolchain-funcs
 
 MY_P=pypy2.7-v${PV/_/}
@@ -26,7 +26,8 @@ RDEPEND=">=sys-libs/zlib-1.1.3:0=
        !dev-python/pypy-exe-bin:${PV}"
 # don't enforce the dep on pypy with USE=low-memory since it's going
 # to cause either collisions or circular dep on itself
-DEPEND="${RDEPEND}
+DEPEND="${RDEPEND}"
+BDEPEND="
        !low-memory? (
                || (
                        dev-python/pypy
@@ -39,7 +40,9 @@ DEPEND="${RDEPEND}
 
 check_env() {
        if use low-memory; then
-               if ! python_is_installed pypy; then
+               if ! has_version -b dev-python/pypy &&
+                               ! has_version -b dev-python/pypy-bin
+               then
                        eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
                        eerror "being installed. Please install it using e.g.:"
                        eerror
@@ -67,18 +70,21 @@ pkg_setup() {
        if [[ ${MERGE_TYPE} != binary ]]; then
                check_env
 
-               if python_is_installed pypy; then
-                       if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] || use low-memory; then
+               if has_version -b dev-python/pypy ||
+                               has_version -b dev-python/pypy-bin
+               then
+                       if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] ||
+                                       use low-memory
+                       then
                                einfo "Using already-installed PyPy to perform the translation."
-                               local EPYTHON=pypy
+                               EPYTHON=pypy
                        else
                                einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
                                einfo "recommends using PyPy for that. If you wish to do so, please unset"
                                einfo "the EPYTHON variable."
+                               python-any-r1_pkg_setup
                        fi
                fi
-
-               python-any-r1_pkg_setup
        fi
 }
 
@@ -130,10 +136,10 @@ src_configure() {
                )
        done
 
-       local interp=( "${PYTHON}" )
+       local interp=( "${EPYTHON}" )
        if use low-memory; then
                interp=( env PYPY_GC_MAX_DELTA=200MB
-                       "${PYTHON}" --jit loop_longevity=300 )
+                       "${EPYTHON}" --jit loop_longevity=300 )
        fi
 
        # translate into the C sources