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: Sun, 20 Feb 2022 12:28:07
Message-Id: 1645360076.587dafdd6fe6e71bc239388d7e7033698e4f9ed6.mgorny@gentoo
1 commit: 587dafdd6fe6e71bc239388d7e7033698e4f9ed6
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 20 11:19:22 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 20 12:27:56 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=587dafdd
7
8 dev-python/pypy-exe: Bump to 7.3.8
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.8.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 7c9c676fd5de..d02ba55f2a12 100644
18 --- a/dev-python/pypy-exe/Manifest
19 +++ b/dev-python/pypy-exe/Manifest
20 @@ -1,6 +1,8 @@
21 DIST pypy2.7-gentoo-patches-7.3.6.tar.xz 7904 BLAKE2B 6a809f8f1fd59c18627abaf81b47fa5948d39d5ece86fa416944c1c6585ec5d43b56f4228479a6afdca9788a0ecfdc83fceb4eeea25f289c1dc0b2dbda79b882 SHA512 01fe42cdf94b559ed787e253325f7df0add62e30e77c6b6e4c0301c81ff624a31167d95b39d24d72f28441468d571112f424957de38e7f26ecdbfe0f33617296
22 +DIST pypy2.7-gentoo-patches-7.3.8.tar.xz 7428 BLAKE2B 5362c34929e2053fc9a806e9894f35cce02ba1ebfad66cc64acc200ade4317934ee50dbc072194d19e201dea2a678abd609001ffe7e39bd6890a3b26c9d6d00e SHA512 6a7bfadac8f638e69419a6a1536af595a63bb2b4e3028da6423bd164d3df5399901b217468b1b374a5162ca8d2e5a61c4a19996f9e63109ed414a1aedcaac5d6
23 DIST pypy2.7-gentoo-patches-7.3.8rc1.tar.xz 7424 BLAKE2B 931fccd3415e0da7c0fa5a228fc1fec2006a9d12d3523222fc0618a901c161df9f149d09e354029b42ca2144bdeebbd228ec6025574d87d4b630fd0750bc4919 SHA512 c193610c46d4b02d1445073f12c3285ce053f5b860584b1c39bff48d5e800c609d40ff0eb91049cdf8f4bfdb4e7bb48d7059de98785e598349022602b97e5f2c
24 DIST pypy2.7-gentoo-patches-7.3.8rc2.tar.xz 7424 BLAKE2B 1d0e7e86cbc08ac3dc6f10fdb887bc4b634a9ac0aeeb39962b5cca85e05122c7dd8548848933d88f62508d3d2032f5f4abe1feea6cf06976659d142d451d0ffb SHA512 62d33bd700c28cd93617d69ccbbb3651fa794378583fdf584b2030f330b3a9bf55fba7d03539baacd9faac02e5d812b481c64b9c3f25cf304d780d162e8c3840
25 DIST pypy2.7-v7.3.6-src.tar.bz2 21621891 BLAKE2B a2d18ae9d455747484de491df228e7f26af46fc3bc1fd1c16ceba79eba5a3a3272d48312c9da112ae9310722b5af33098f28a7dc15d7ff4760886a8c974692a2 SHA512 df914f5e1a1f5ae5c1ea11cd8e29482309af4dce041cf2ae6d7b35a35717fec903be70f56e5f1ddbc9fd370cbe29f6896d25eb2cd10c493c352c80b279070ba3
26 +DIST pypy2.7-v7.3.8-src.tar.bz2 23279006 BLAKE2B 7b2f5bfaffb99d3444f355039f743a21016dea22cc78cd5feca05eb12ce0e5ed39dafd22a8726994d0aff789e68b506197680e7181087313d2c5cd17b674ae4d SHA512 6ff90fad998c25aec5823e61d65266c169e89cba2ee2e3b6d0864d34d69a6b9fe7ad4d591bc8b38a48c5c22ea3dd468d3188cd34e03746c258752eaa24ac3ae2
27 DIST pypy2.7-v7.3.8rc1-src.tar.bz2 23267987 BLAKE2B 035aef49ff0e8b1caed24e87712364ca350fe9f51247eaf732a32458a756264a867ad1270d4edc500daba8dcf70ca8882eb7f381135961f7f48d784ffe8bc6ee SHA512 88184be129ca3698db4e04ae6d241b7c748626870400a100ee2b8bba6ae3c0508071e435adb204bd6b34642ff3c8b0b71643446a3b443cc4467d68591fd53ceb
28 DIST pypy2.7-v7.3.8rc2-src.tar.bz2 23272804 BLAKE2B 5ff559f603f06a44a6149dd898df3351f2de4c42219dbcf6e811e1120079e8979a3edb3c76a01a30400684bb8088eb8e15c0408b6ea0d3762eff87eca41a0021 SHA512 ab85b219d43d556d84847af116d3012706264571d6ebdc0b1242195cdc906f9a9073ce5f42e9e5b4a9d1f974fe103b64190c7f3e5b53766443a4b9b938f55d1c
29
30 diff --git a/dev-python/pypy-exe/pypy-exe-7.3.8.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.8.ebuild
31 new file mode 100644
32 index 000000000000..e35d87754072
33 --- /dev/null
34 +++ b/dev-python/pypy-exe/pypy-exe-7.3.8.ebuild
35 @@ -0,0 +1,178 @@
36 +# Copyright 1999-2022 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=8
40 +
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=pypy2.7-v${PYPY_PV/_}
46 +PATCHSET="pypy2.7-gentoo-patches-${PV/_}"
47 +
48 +DESCRIPTION="PyPy 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/pypy-exe-bin:${PYPY_PV}"
66 +# don't enforce the dep on pypy with USE=low-memory since it's going
67 +# to cause either collisions or circular dep on itself
68 +DEPEND="${RDEPEND}"
69 +BDEPEND="
70 + !low-memory? (
71 + || (
72 + dev-python/pypy
73 + dev-lang/python:2.7
74 + )
75 + )"
76 +
77 +check_env() {
78 + if use low-memory; then
79 + if ! has_version -b dev-python/pypy &&
80 + ! has_version -b dev-python/pypy-bin
81 + then
82 + eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
83 + eerror "being installed. Please install it using e.g.:"
84 + eerror
85 + eerror " $ emerge -1v dev-python/pypy dev-python/pypy-exe-bin"
86 + eerror
87 + eerror "before attempting to build dev-python/pypy-exe[low-memory]."
88 + die "dev-python/pypy needs to be installed for USE=low-memory"
89 + fi
90 +
91 + CHECKREQS_MEMORY="1750M"
92 + use amd64 && CHECKREQS_MEMORY="3500M"
93 + else
94 + CHECKREQS_MEMORY="3G"
95 + use amd64 && CHECKREQS_MEMORY="6G"
96 + fi
97 +
98 + check-reqs_pkg_pretend
99 +}
100 +
101 +pkg_pretend() {
102 + [[ ${MERGE_TYPE} != binary ]] && check_env
103 +}
104 +
105 +pkg_setup() {
106 + if [[ ${MERGE_TYPE} != binary ]]; then
107 + check_env
108 +
109 + use low-memory && EPYTHON=
110 + if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] &&
111 + { has_version -b dev-python/pypy ||
112 + has_version -b dev-python/pypy-bin; }
113 + then
114 + einfo "Using already-installed PyPy to perform the translation."
115 + EPYTHON=pypy
116 + else
117 + einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
118 + einfo "recommends using PyPy for that. If you wish to do so, please unset"
119 + einfo "the EPYTHON variable."
120 + python-any-r1_pkg_setup
121 + fi
122 + fi
123 +}
124 +
125 +src_prepare() {
126 + local PATCHES=(
127 + "${WORKDIR}/${PATCHSET}"
128 + )
129 + default
130 +}
131 +
132 +src_configure() {
133 + tc-export CC
134 +
135 + local jit_backend
136 + if use jit; then
137 + jit_backend='--jit-backend='
138 +
139 + # We only need the explicit sse2 switch for x86.
140 + # On other arches we can rely on autodetection which uses
141 + # compiler macros. Plus, --jit-backend= doesn't accept all
142 + # the modern values...
143 +
144 + if use x86; then
145 + if use cpu_flags_x86_sse2; then
146 + jit_backend+=x86
147 + else
148 + jit_backend+=x86-without-sse2
149 + fi
150 + else
151 + jit_backend+=auto
152 + fi
153 + fi
154 +
155 + local args=(
156 + --no-shared
157 + $(usex jit -Ojit -O2)
158 +
159 + ${jit_backend}
160 +
161 + pypy/goal/targetpypystandalone
162 + )
163 +
164 + # Avoid linking against libraries disabled by use flags
165 + local opts=(
166 + bzip2:bz2
167 + ncurses:_minimal_curses
168 + )
169 +
170 + local opt
171 + for opt in "${opts[@]}"; do
172 + local flag=${opt%:*}
173 + local mod=${opt#*:}
174 +
175 + args+=(
176 + $(usex ${flag} --withmod --withoutmod)-${mod}
177 + )
178 + done
179 +
180 + local interp=( "${EPYTHON}" )
181 + if use low-memory; then
182 + interp=( env PYPY_GC_MAX_DELTA=200MB
183 + "${EPYTHON}" --jit loop_longevity=300 )
184 + fi
185 +
186 + if [[ ${EPYTHON} != pypy ]]; then
187 + # reuse bundled pycparser to avoid external dep
188 + mkdir -p "${T}"/pymod/cffi || die
189 + : > "${T}"/pymod/cffi/__init__.py || die
190 + cp -r lib_pypy/cffi/_pycparser "${T}"/pymod/cffi/ || die
191 + local -x PYTHONPATH=${T}/pymod:${PYTHONPATH}
192 + fi
193 +
194 + # translate into the C sources
195 + # we're going to build them ourselves since otherwise pypy does not
196 + # free up the unneeded memory before spawning the compiler
197 + set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
198 + echo -e "\033[1m${@}\033[0m"
199 + "${@}" || die "translation failed"
200 +}
201 +
202 +src_compile() {
203 + emake -C "${T}"/usession*-0/testing_1
204 +}
205 +
206 +src_install() {
207 + local dest=/usr/lib/pypy2.7
208 + exeinto "${dest}"
209 + newexe "${T}"/usession*-0/testing_1/pypy-c pypy-c-${PYPY_PV}
210 + insinto "${dest}"/include/${PYPY_PV}
211 + doins include/pypy_*
212 + pax-mark m "${ED}${dest}/pypy-c-${PYPY_PV}"
213 +}