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, 30 Jul 2021 18:14:36
Message-Id: 1627668851.921335b03c0927d97800d011cbc462a2eb484371.mgorny@gentoo
1 commit: 921335b03c0927d97800d011cbc462a2eb484371
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 30 11:54:27 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 30 18:14:11 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=921335b0
7
8 dev-python/pypy-exe: Bump to 7.3.5
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.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 7b09b3316a2..a6e03b1addd 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.4.tar.xz 7844 BLAKE2B d06694fa085667e40ef8805c29f7ccf95b49f9de4e99e3ebfa3d69c4202a0ddcebb54c524d7d9f9ec67573a8d2ebe38fb7023d4d3ecef67afc907ecef5c16c02 SHA512 aa8ffefb5d30070ae86c1c14c55c277e39d3da66aea3a0951319158fb65e716e7fa7864e8bf5d26314d4b2a8030c766b63cad6a3663822d2875cd8cc1f3f2de5
22 +DIST pypy2.7-gentoo-patches-7.3.5.tar.xz 6928 BLAKE2B 41aff14411882e60102866a41de6a2c13983d5489c9ed928e2823714883b5cca289c093426fdec35b6df8d17de7a96528d799e10412a0f2f02563e152acf24ea SHA512 f12c1a414cf40e86e9d2a7d1cdfaaacc1045f8043da479b5270ef983ffcf01418a70bbd21ae740abf544091cdc5026bffe467d631242d5e9e0863a64fa8d026b
23 DIST pypy2.7-gentoo-patches-7.3.5rc3.tar.xz 5796 BLAKE2B b1c0fb0a8d86d117a9d4102777605eedd026b614f4b66272b3fc5da246bbe5edf516e95a40471117b61078c18b9fc615e55e0992a5d0a1be7caf9026ee26b6be SHA512 8699813837dfa4560a6e73b96f770c5d5999ce008e17cf62a856a454cb0b63146787a54934874162c79345488959e0936b3bd03823bc9f8e276f80df1122f7a8
24 DIST pypy2.7-v7.3.4-src.tar.bz2 21571561 BLAKE2B d0ac56fadec63fe7e65728c36c2aaf96fc5f54919dddbca9571a24c42a9e3e21f672f84555a18a384c4715f0489bd7aef009c0a47b635de88c472a93e2ae8d71 SHA512 4c18c2dbfbf0cc1034bea773828204df77aec7ef82119fb94e5cb762ce1783e00ad70e99d1432b4948dc132e726bdc6015f4a5bf10a5b10415bcfe99da2ecd17
25 +DIST pypy2.7-v7.3.5-src.tar.bz2 21572184 BLAKE2B 388b8623c2c5de839dea0e60acc5e11a6a774b4a6cdc051691053a97fe13ec12c6735a4be64015653ef420c0d8af2c79d8faa90a7dfc3042e29f35f4e1ded6c3 SHA512 a30c666c29eec7cca7e2e52f26480958b5885cd59c6b2e3d3c0d8c1cc55c298e878fc95f88e38a4297bb3d7d1cc1f77470de958e5acfd317e1fc8bdd5d013dcb
26 DIST pypy2.7-v7.3.5rc3-src.tar.bz2 21563312 BLAKE2B e343dcd617026ea5f951f3d24deeb59736c9a6ecc91d1b9c1bd980b6f3c239a5bf0edb9b72a0847a6aeeaead8aca9ecf537af81c9fcf0a2f6647c99edc0d1735 SHA512 e080771ea10a30820f8844b3f512a7681f2e619e8a37fa8ac60198f3c8c3780a8e08aa63749be375c00cd547994f428df44e2cd9f61b272b215ded433374e0a1
27
28 diff --git a/dev-python/pypy-exe/pypy-exe-7.3.5.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.5.ebuild
29 new file mode 100644
30 index 00000000000..8678327f131
31 --- /dev/null
32 +++ b/dev-python/pypy-exe/pypy-exe-7.3.5.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 +}