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