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