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