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