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: Wed, 06 Oct 2021 18:18:02
Message-Id: 1633544269.721e5845d1d2ef4da34dc0de2d9fae63cba41118.mgorny@gentoo
1 commit: 721e5845d1d2ef4da34dc0de2d9fae63cba41118
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 6 15:34:06 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 6 18:17:49 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=721e5845
7
8 dev-python/pypy-exe: Bump to 7.3.6_rc2
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.6_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 42d3b0aa0a8..2623c1e4154 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.5.tar.xz 6928 BLAKE2B 41aff14411882e60102866a41de6a2c13983d5489c9ed928e2823714883b5cca289c093426fdec35b6df8d17de7a96528d799e10412a0f2f02563e152acf24ea SHA512 f12c1a414cf40e86e9d2a7d1cdfaaacc1045f8043da479b5270ef983ffcf01418a70bbd21ae740abf544091cdc5026bffe467d631242d5e9e0863a64fa8d026b
22 DIST pypy2.7-gentoo-patches-7.3.6rc1.tar.xz 7904 BLAKE2B 3a5b8efaa67d5a1b4f65a56c6256a3b1efa765079e0fb2c2d380b325175f2e8f3a7d7c4886f734374b6069b3ebf3ac63483f90ada0ece72ff5d8e5c82940c875 SHA512 820d6155e3451b22076719eb3ffc29fab74965761faeade52013d3928fd63cd00b8c5d045f0da0bc1f303a9d2998cd210cd6bec05b2ca01c8b281a61c9a4a73c
23 +DIST pypy2.7-gentoo-patches-7.3.6rc2.tar.xz 7900 BLAKE2B 66861532418a35f0f926fdd85dbf701ed06f6edef0dd82313302f899bd7c0049572ae069bafe1b927053f342f965341b28eeef913e9342af3c592721fd2c8fb5 SHA512 f727d73fa51737685eff9ea933c7bb3684a942abddd891e7c4d90f3185556954aefb0a04f543578c79f2fe2fea275b98e6e7857ac5d7c8774f9fd6ff893fa3e9
24 DIST pypy2.7-v7.3.5-src.tar.bz2 21572184 BLAKE2B 388b8623c2c5de839dea0e60acc5e11a6a774b4a6cdc051691053a97fe13ec12c6735a4be64015653ef420c0d8af2c79d8faa90a7dfc3042e29f35f4e1ded6c3 SHA512 a30c666c29eec7cca7e2e52f26480958b5885cd59c6b2e3d3c0d8c1cc55c298e878fc95f88e38a4297bb3d7d1cc1f77470de958e5acfd317e1fc8bdd5d013dcb
25 DIST pypy2.7-v7.3.6rc1-src.tar.bz2 21617621 BLAKE2B 659dd16920b157dae94c5d1f7a9346c7b933ec8c6a3019e36aaa6911bd01d5c9d064a75baa3d8f3df423db4d5a1de5d4f3c8fb63c8d5188d23401b07cc7611be SHA512 f8b949488c3af8acc5533d92238b7bca9ce59c24e93413e0db88094eaf58af5f92a9c9a941f3b7184d2761af2c2c4775891353df053a0762519606a4ce7ca544
26 +DIST pypy2.7-v7.3.6rc2-src.tar.bz2 21621430 BLAKE2B 2e8f5c41b4c79bd47a43c5ad38a4478ee6e7df7a20929e9be1315534a3b55c28d29bde5b46ff728aeba5cc05a0ed332045a4c114864d8b34746341a0023d1984 SHA512 e6354261f949cd042ba63988dff6a52dbc15c9a86be098b014c146218eaca9caffd76697134a5d4e4a18319b45229dfa73a617588f914dbee649b11197f296a0
27
28 diff --git a/dev-python/pypy-exe/pypy-exe-7.3.6_rc2.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.6_rc2.ebuild
29 new file mode 100644
30 index 00000000000..8678327f131
31 --- /dev/null
32 +++ b/dev-python/pypy-exe/pypy-exe-7.3.6_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 +}