commit:     e50526ec58f29917484489ec5e69be5fa9157dec
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 28 09:07:35 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Sep 28 09:08:25 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e50526ec

dev-python/pypy3-exe: Fix CPython bootstrap

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy3-exe/pypy3-exe-7.3.2.ebuild     | 15 ++++++++++-----
 dev-python/pypy3-exe/pypy3-exe-7.3.2_p37.ebuild | 15 ++++++++++-----
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/dev-python/pypy3-exe/pypy3-exe-7.3.2.ebuild 
b/dev-python/pypy3-exe/pypy3-exe-7.3.2.ebuild
index b8f0cf85d05..0e94bc1eae8 100644
--- a/dev-python/pypy3-exe/pypy3-exe-7.3.2.ebuild
+++ b/dev-python/pypy3-exe/pypy3-exe-7.3.2.ebuild
@@ -31,10 +31,7 @@ BDEPEND="
        !low-memory? (
                || (
                        dev-python/pypy
-                       (
-                               dev-lang/python:2.7
-                               
dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
-                       )
+                       dev-lang/python:2.7
                )
        )"
 
@@ -129,8 +126,16 @@ src_configure() {
                        "${EPYTHON}" --jit loop_longevity=300 )
        fi
 
+       if [[ ${EPYTHON} != pypy ]]; then
+               # reuse bundled pycparser to avoid external dep
+               mkdir -p "${T}"/pymod/cffi || die
+               : > "${T}"/pymod/cffi/__init__.py || die
+               cp -r lib_pypy/cffi/_pycparser "${T}"/pymod/cffi/ || die
+               local -x PYTHONPATH=${T}/pymod:${PYTHONPATH}
+       fi
+
        # translate into the C sources
-       # we're going to make them ourselves since otherwise pypy does not
+       # we're going to build them ourselves since otherwise pypy does not
        # free up the unneeded memory before spawning the compiler
        set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
        echo -e "\033[1m${@}\033[0m"

diff --git a/dev-python/pypy3-exe/pypy3-exe-7.3.2_p37.ebuild 
b/dev-python/pypy3-exe/pypy3-exe-7.3.2_p37.ebuild
index ab30f5451bf..652138b7c82 100644
--- a/dev-python/pypy3-exe/pypy3-exe-7.3.2_p37.ebuild
+++ b/dev-python/pypy3-exe/pypy3-exe-7.3.2_p37.ebuild
@@ -32,10 +32,7 @@ BDEPEND="
        !low-memory? (
                || (
                        dev-python/pypy
-                       (
-                               dev-lang/python:2.7
-                               
dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
-                       )
+                       dev-lang/python:2.7
                )
        )"
 
@@ -130,8 +127,16 @@ src_configure() {
                        "${EPYTHON}" --jit loop_longevity=300 )
        fi
 
+       if [[ ${EPYTHON} != pypy ]]; then
+               # reuse bundled pycparser to avoid external dep
+               mkdir -p "${T}"/pymod/cffi || die
+               : > "${T}"/pymod/cffi/__init__.py || die
+               cp -r lib_pypy/cffi/_pycparser "${T}"/pymod/cffi/ || die
+               local -x PYTHONPATH=${T}/pymod:${PYTHONPATH}
+       fi
+
        # translate into the C sources
-       # we're going to make them ourselves since otherwise pypy does not
+       # we're going to build them ourselves since otherwise pypy does not
        # free up the unneeded memory before spawning the compiler
        set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
        echo -e "\033[1m${@}\033[0m"

Reply via email to