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