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: Thu, 24 Nov 2022 19:49:12
Message-Id: 1669319346.5df64c3f0cfb987fe51e0c1124c5544262356b00.mgorny@gentoo
1 commit: 5df64c3f0cfb987fe51e0c1124c5544262356b00
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 24 18:51:04 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 24 19:49:06 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5df64c3f
7
8 dev-python/pypy-exe: Stop using python-any-r1 and clean up
9
10 Stop using python-any-r1.eclass to unblock the way towards removing
11 python2_7 support from it. Remove support for EPYTHON override, always
12 use dev-python/pypy if available. Warn about it being missing
13 in pkg_pretend() independently of USE flags.
14
15 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
16
17 dev-python/pypy-exe/pypy-exe-7.3.10_rc3.ebuild | 74 ++++++++++++--------------
18 1 file changed, 33 insertions(+), 41 deletions(-)
19
20 diff --git a/dev-python/pypy-exe/pypy-exe-7.3.10_rc3.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.10_rc3.ebuild
21 index e5db7a520127..f759cbcf5a4a 100644
22 --- a/dev-python/pypy-exe/pypy-exe-7.3.10_rc3.ebuild
23 +++ b/dev-python/pypy-exe/pypy-exe-7.3.10_rc3.ebuild
24 @@ -3,8 +3,7 @@
25
26 EAPI=8
27
28 -PYTHON_COMPAT=( python2_7 )
29 -inherit check-reqs pax-utils python-any-r1 toolchain-funcs
30 +inherit check-reqs pax-utils toolchain-funcs
31
32 PYPY_PV=${PV%_p*}
33 MY_P=pypy2.7-v${PYPY_PV/_}
34 @@ -23,20 +22,20 @@ SLOT="${PYPY_PV}"
35 KEYWORDS=""
36 IUSE="bzip2 +jit low-memory ncurses cpu_flags_x86_sse2"
37
38 -RDEPEND="
39 +DEPEND="
40 >=sys-libs/zlib-1.1.3:0=
41 dev-libs/libffi:0=
42 virtual/libintl:0=
43 dev-libs/expat:0=
44 bzip2? ( app-arch/bzip2:0= )
45 ncurses? ( sys-libs/ncurses:0= )
46 - !dev-python/pypy-exe-bin:${PYPY_PV}
47 "
48 -# don't enforce the dep on pypy with USE=low-memory since it's going
49 -# to cause either collisions or circular dep on itself
50 -DEPEND="
51 - ${RDEPEND}
52 +RDEPEND="
53 + ${DEPEND}
54 + !dev-python/pypy-exe-bin:${PYPY_PV}
55 "
56 +# don't enforce the dep on dev-python/pypy with USE=low-memory
57 +# since it's going to cause circular dep with unhelpful error message
58 BDEPEND="
59 !low-memory? (
60 || (
61 @@ -47,19 +46,23 @@ BDEPEND="
62 "
63
64 check_env() {
65 - if use low-memory; then
66 - if ! has_version -b dev-python/pypy &&
67 - ! has_version -b dev-python/pypy-bin
68 - then
69 - eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
70 - eerror "being installed. Please install it using e.g.:"
71 - eerror
72 - eerror " $ emerge -1v dev-python/pypy dev-python/pypy-exe-bin"
73 - eerror
74 - eerror "before attempting to build dev-python/pypy-exe[low-memory]."
75 + if ! has_version -b dev-python/pypy; then
76 + if use low-memory; then
77 + eerror "USE=low-memory requires (a prior version of) dev-python/pypy"
78 + eerror "installed."
79 + else
80 + ewarn "CPython 2.7 will be used to perform the translation. Upstream"
81 + ewarn "recommends using (a prior version of) dev-python/pypy instead."
82 + fi
83 + elog "You can install a prebuilt version of PyPy first using e.g.:"
84 + elog " $ emerge -1v dev-python/pypy dev-python/pypy-exe-bin"
85 +
86 + if use low-memory; then
87 die "dev-python/pypy needs to be installed for USE=low-memory"
88 fi
89 + fi
90
91 + if use low-memory; then
92 CHECKREQS_MEMORY="1750M"
93 use amd64 && CHECKREQS_MEMORY="3500M"
94 else
95 @@ -75,23 +78,7 @@ pkg_pretend() {
96 }
97
98 pkg_setup() {
99 - if [[ ${MERGE_TYPE} != binary ]]; then
100 - check_env
101 -
102 - use low-memory && EPYTHON=
103 - if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] &&
104 - { has_version -b dev-python/pypy ||
105 - has_version -b dev-python/pypy-bin; }
106 - then
107 - einfo "Using already-installed PyPy to perform the translation."
108 - EPYTHON=pypy
109 - else
110 - einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
111 - einfo "recommends using PyPy for that. If you wish to do so, please unset"
112 - einfo "the EPYTHON variable."
113 - python-any-r1_pkg_setup
114 - fi
115 - fi
116 + [[ ${MERGE_TYPE} != binary ]] && check_env
117 }
118
119 src_prepare() {
120 @@ -149,13 +136,18 @@ src_configure() {
121 )
122 done
123
124 - local interp=( "${EPYTHON}" )
125 - if use low-memory; then
126 - interp=( env PYPY_GC_MAX_DELTA=200MB
127 - "${EPYTHON}" --jit loop_longevity=300 )
128 - fi
129 + local interp
130 + if use low-memory || has_version -b dev-python/pypy; then
131 + einfo "Using already-installed PyPy to perform the translation."
132 + interp=( pypy )
133 + if use low-memory; then
134 + local -x PYPY_GC_MAX_DELTA=200MB
135 + interp+=( --jit loop_longevity=300 )
136 + fi
137 + else
138 + einfo "Using CPython 2.7 to perform the translation."
139 + interp=( python2.7 )
140
141 - if [[ ${EPYTHON} != pypy ]]; then
142 # reuse bundled pycparser to avoid external dep
143 mkdir -p "${T}"/pymod/cffi || die
144 : > "${T}"/pymod/cffi/__init__.py || die