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