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: Fri, 14 May 2021 22:00:24
Message-Id: 1621029522.7d89537244f346afe01e587857dda925428a1708.mgorny@gentoo
1 commit: 7d89537244f346afe01e587857dda925428a1708
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 14 18:13:28 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri May 14 21:58:42 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d895372
7
8 dev-python/pypy-exe: Bump to 7.3.5rc2
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy-exe/Manifest | 2 +
13 dev-python/pypy-exe/pypy-exe-7.3.5_rc2.ebuild | 178 ++++++++++++++++++++++++++
14 2 files changed, 180 insertions(+)
15
16 diff --git a/dev-python/pypy-exe/Manifest b/dev-python/pypy-exe/Manifest
17 index 35edec23e66..a0b16773ffb 100644
18 --- a/dev-python/pypy-exe/Manifest
19 +++ b/dev-python/pypy-exe/Manifest
20 @@ -1,4 +1,6 @@
21 DIST pypy2.7-gentoo-patches-7.3.3_p2.tar.xz 11184 BLAKE2B b2b9b94478609372d616c65a87cbb12a07e217928beef9fac26c428f81c662ef390db3fd85bf368ffcc8c6fa3802e506412b7bebd14bdc453009008bc3459d25 SHA512 9ab8ed99b42b36e9c212683ef93f7f1fb99caecf056293ab9a5734f8b52eedec192860702baa121630558530cb5c4652f8542300ecaaaa282377ea6456618b95
22 DIST pypy2.7-gentoo-patches-7.3.4.tar.xz 7844 BLAKE2B d06694fa085667e40ef8805c29f7ccf95b49f9de4e99e3ebfa3d69c4202a0ddcebb54c524d7d9f9ec67573a8d2ebe38fb7023d4d3ecef67afc907ecef5c16c02 SHA512 aa8ffefb5d30070ae86c1c14c55c277e39d3da66aea3a0951319158fb65e716e7fa7864e8bf5d26314d4b2a8030c766b63cad6a3663822d2875cd8cc1f3f2de5
23 +DIST pypy2.7-gentoo-patches-7.3.5rc2.tar.xz 5792 BLAKE2B 2380dc09be7e8dccfcc151e5c3cc5cc0aeb6a5a284b3b3fa8d12bdc0c6352d0da4fc3cb52762c1b5a38b97b3736147cb10986e0e6fdb622ff277445ba7228252 SHA512 1e269a02fc70b67fe44a8d57303a1565acbdb4b7f8065ec489b6bdd9275281e4b516fd1e01223e9635e4759a71c73be941f02e6bc561ab728d6a67e22bda47e3
24 DIST pypy2.7-v7.3.3-src.tar.bz2 20881821 BLAKE2B ce1ecdd1fffe40574c7662da6038b84d2bca47ab168939ef0c12be2c6348317f17a94a3026e7fa53c71601edc153aefd98f770bd148e7af07ca751c0a5fc1252 SHA512 c2b6c44fdcac5f9445fab01572f859228fc286891fd09a4ddb95d283683d805276c853ec8e61fcd04cb9ee811d0e959d19bb03fdd7442c044f28a773633122e7
25 DIST pypy2.7-v7.3.4-src.tar.bz2 21571561 BLAKE2B d0ac56fadec63fe7e65728c36c2aaf96fc5f54919dddbca9571a24c42a9e3e21f672f84555a18a384c4715f0489bd7aef009c0a47b635de88c472a93e2ae8d71 SHA512 4c18c2dbfbf0cc1034bea773828204df77aec7ef82119fb94e5cb762ce1783e00ad70e99d1432b4948dc132e726bdc6015f4a5bf10a5b10415bcfe99da2ecd17
26 +DIST pypy2.7-v7.3.5rc2-src.tar.bz2 21561927 BLAKE2B 1fd8aeba0698c95015716109d6a3aec74f95d1a4faea130ffe872b43d0ef8e1e8f8b742aeae6048ab596c5b78634e83c83c95ce3ed047d068dae7bddc02e1281 SHA512 d1d4b45c29c5e4c1735744b4aac46c87787bda7db496c8865e099e669f666f223ed9c014f3637065bb7762eda39a0116bab54078cf10ce8fbd8505d1ab952575
27
28 diff --git a/dev-python/pypy-exe/pypy-exe-7.3.5_rc2.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.5_rc2.ebuild
29 new file mode 100644
30 index 00000000000..8678327f131
31 --- /dev/null
32 +++ b/dev-python/pypy-exe/pypy-exe-7.3.5_rc2.ebuild
33 @@ -0,0 +1,178 @@
34 +# Copyright 1999-2021 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +PYTHON_COMPAT=( python2_7 )
40 +inherit check-reqs pax-utils python-any-r1 toolchain-funcs
41 +
42 +PYPY_PV=${PV%_p*}
43 +MY_P=pypy2.7-v${PYPY_PV/_}
44 +PATCHSET="pypy2.7-gentoo-patches-${PV/_}"
45 +
46 +DESCRIPTION="PyPy executable (build from source)"
47 +HOMEPAGE="https://www.pypy.org/"
48 +SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2
49 + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz"
50 +S="${WORKDIR}/${MY_P}-src"
51 +
52 +LICENSE="MIT"
53 +SLOT="${PYPY_PV}"
54 +KEYWORDS=""
55 +IUSE="bzip2 +jit low-memory ncurses cpu_flags_x86_sse2"
56 +
57 +RDEPEND=">=sys-libs/zlib-1.1.3:0=
58 + dev-libs/libffi:0=
59 + virtual/libintl:0=
60 + dev-libs/expat:0=
61 + bzip2? ( app-arch/bzip2:0= )
62 + ncurses? ( sys-libs/ncurses:0= )
63 + !dev-python/pypy-exe-bin:${PYPY_PV}"
64 +# don't enforce the dep on pypy with USE=low-memory since it's going
65 +# to cause either collisions or circular dep on itself
66 +DEPEND="${RDEPEND}"
67 +BDEPEND="
68 + !low-memory? (
69 + || (
70 + dev-python/pypy
71 + dev-lang/python:2.7
72 + )
73 + )"
74 +
75 +check_env() {
76 + if use low-memory; then
77 + if ! has_version -b dev-python/pypy &&
78 + ! has_version -b dev-python/pypy-bin
79 + then
80 + eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
81 + eerror "being installed. Please install it using e.g.:"
82 + eerror
83 + eerror " $ emerge -1v dev-python/pypy dev-python/pypy-exe-bin"
84 + eerror
85 + eerror "before attempting to build dev-python/pypy-exe[low-memory]."
86 + die "dev-python/pypy needs to be installed for USE=low-memory"
87 + fi
88 +
89 + CHECKREQS_MEMORY="1750M"
90 + use amd64 && CHECKREQS_MEMORY="3500M"
91 + else
92 + CHECKREQS_MEMORY="3G"
93 + use amd64 && CHECKREQS_MEMORY="6G"
94 + fi
95 +
96 + check-reqs_pkg_pretend
97 +}
98 +
99 +pkg_pretend() {
100 + [[ ${MERGE_TYPE} != binary ]] && check_env
101 +}
102 +
103 +pkg_setup() {
104 + if [[ ${MERGE_TYPE} != binary ]]; then
105 + check_env
106 +
107 + use low-memory && EPYTHON=
108 + if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] &&
109 + { has_version -b dev-python/pypy ||
110 + has_version -b dev-python/pypy-bin; }
111 + then
112 + einfo "Using already-installed PyPy to perform the translation."
113 + EPYTHON=pypy
114 + else
115 + einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
116 + einfo "recommends using PyPy for that. If you wish to do so, please unset"
117 + einfo "the EPYTHON variable."
118 + python-any-r1_pkg_setup
119 + fi
120 + fi
121 +}
122 +
123 +src_prepare() {
124 + local PATCHES=(
125 + "${WORKDIR}/${PATCHSET}"
126 + )
127 + default
128 +}
129 +
130 +src_configure() {
131 + tc-export CC
132 +
133 + local jit_backend
134 + if use jit; then
135 + jit_backend='--jit-backend='
136 +
137 + # We only need the explicit sse2 switch for x86.
138 + # On other arches we can rely on autodetection which uses
139 + # compiler macros. Plus, --jit-backend= doesn't accept all
140 + # the modern values...
141 +
142 + if use x86; then
143 + if use cpu_flags_x86_sse2; then
144 + jit_backend+=x86
145 + else
146 + jit_backend+=x86-without-sse2
147 + fi
148 + else
149 + jit_backend+=auto
150 + fi
151 + fi
152 +
153 + local args=(
154 + --no-shared
155 + $(usex jit -Ojit -O2)
156 +
157 + ${jit_backend}
158 +
159 + pypy/goal/targetpypystandalone
160 + )
161 +
162 + # Avoid linking against libraries disabled by use flags
163 + local opts=(
164 + bzip2:bz2
165 + ncurses:_minimal_curses
166 + )
167 +
168 + local opt
169 + for opt in "${opts[@]}"; do
170 + local flag=${opt%:*}
171 + local mod=${opt#*:}
172 +
173 + args+=(
174 + $(usex ${flag} --withmod --withoutmod)-${mod}
175 + )
176 + done
177 +
178 + local interp=( "${EPYTHON}" )
179 + if use low-memory; then
180 + interp=( env PYPY_GC_MAX_DELTA=200MB
181 + "${EPYTHON}" --jit loop_longevity=300 )
182 + fi
183 +
184 + if [[ ${EPYTHON} != pypy ]]; then
185 + # reuse bundled pycparser to avoid external dep
186 + mkdir -p "${T}"/pymod/cffi || die
187 + : > "${T}"/pymod/cffi/__init__.py || die
188 + cp -r lib_pypy/cffi/_pycparser "${T}"/pymod/cffi/ || die
189 + local -x PYTHONPATH=${T}/pymod:${PYTHONPATH}
190 + fi
191 +
192 + # translate into the C sources
193 + # we're going to build them ourselves since otherwise pypy does not
194 + # free up the unneeded memory before spawning the compiler
195 + set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
196 + echo -e "\033[1m${@}\033[0m"
197 + "${@}" || die "translation failed"
198 +}
199 +
200 +src_compile() {
201 + emake -C "${T}"/usession*-0/testing_1
202 +}
203 +
204 +src_install() {
205 + local dest=/usr/lib/pypy2.7
206 + exeinto "${dest}"
207 + newexe "${T}"/usession*-0/testing_1/pypy-c pypy-c-${PYPY_PV}
208 + insinto "${dest}"/include/${PYPY_PV}
209 + doins include/pypy_*
210 + pax-mark m "${ED}${dest}/pypy-c-${PYPY_PV}"
211 +}