Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy-exe/
Date: Mon, 28 Sep 2020 09:08:31
Message-Id: 1601284104.8ed3be6de5ac0784775ed652587c93de957cddf0.mgorny@gentoo
1 commit: 8ed3be6de5ac0784775ed652587c93de957cddf0
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 28 07:22:14 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 28 09:08:24 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ed3be6d
7
8 dev-python/pypy-exe: Fix CPython bootstrap
9
10 Reuse the pycparser copy bundled with cffi to avoid depending
11 on external pycparser package, and therefore fix the build when it is
12 not available anymore.
13
14 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
15
16 dev-python/pypy-exe/pypy-exe-7.3.2.ebuild | 15 ++++++++++-----
17 1 file changed, 10 insertions(+), 5 deletions(-)
18
19 diff --git a/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild
20 index 73059311188..961ae14ae10 100644
21 --- a/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild
22 +++ b/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild
23 @@ -31,10 +31,7 @@ BDEPEND="
24 !low-memory? (
25 || (
26 dev-python/pypy
27 - (
28 - dev-lang/python:2.7
29 - dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
30 - )
31 + dev-lang/python:2.7
32 )
33 )"
34
35 @@ -140,8 +137,16 @@ src_configure() {
36 "${EPYTHON}" --jit loop_longevity=300 )
37 fi
38
39 + if [[ ${EPYTHON} != pypy ]]; then
40 + # reuse bundled pycparser to avoid external dep
41 + mkdir -p "${T}"/pymod/cffi || die
42 + : > "${T}"/pymod/cffi/__init__.py || die
43 + cp -r lib_pypy/cffi/_pycparser "${T}"/pymod/cffi/ || die
44 + local -x PYTHONPATH=${T}/pymod:${PYTHONPATH}
45 + fi
46 +
47 # translate into the C sources
48 - # we're going to make them ourselves since otherwise pypy does not
49 + # we're going to build them ourselves since otherwise pypy does not
50 # free up the unneeded memory before spawning the compiler
51 set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
52 echo -e "\033[1m${@}\033[0m"