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: Wed, 16 Sep 2020 22:30:30
Message-Id: 1600295418.25eb3219323d990b76be2dd703882a93e87f89ff.mgorny@gentoo
1 commit: 25eb3219323d990b76be2dd703882a93e87f89ff
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 16 19:42:40 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 16 22:30:18 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25eb3219
7
8 dev-python/pypy3-exe: Bump PyPy3.7 to 7.3.2_rc2
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy3-exe/Manifest | 1 +
13 .../pypy3-exe/pypy3-exe-7.3.2_rc2_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 579344895a3..45dd21d0c51 100644
18 --- a/dev-python/pypy3-exe/Manifest
19 +++ b/dev-python/pypy3-exe/Manifest
20 @@ -3,3 +3,4 @@ DIST pypy3.6-v7.3.1-src.tar.bz2 22712809 BLAKE2B 4250b3fe98c611b9635319c106b80e8
21 DIST pypy3.6-v7.3.2rc1-src.tar.bz2 22730858 BLAKE2B 41a0702d0077c0f546998b858bc8b76226fe8903f4819497aa284231edcb32bc8b047b0a2a35bacfb18ea11fb85de98b95998276c22a3f0dc716b16871b35a3a SHA512 1a6f93f7e767b0db5c40c1e06cadd781c6ddfb02ec86aa61a37f649fe1aa5cd71f7857052e5b48092e3bf8b5cbef6d6401097bf4c4e80c62f7dbdffcd20b70c0
22 DIST pypy3.6-v7.3.2rc2-src.tar.bz2 22750248 BLAKE2B 6a8a3c4306cb5c796ee89f3d9ece61f5d669515ae9edf4961f43c7779123554cda0f3b433f8264d3d08e531ef5fe660b494135321a11f441ae1de97ce0abb332 SHA512 a89184314d04bad646cf2e2151e2d5f27ca23a68f25e22b5c2e4f07745671e70c71d869be1c61248ee839632f7151b597fe79eb5af814967a1ae97f2c2cdb8ee
23 DIST pypy3.7-v7.3.2rc1-src.tar.bz2 24805791 BLAKE2B 7b16ba9f0b33d572facdf009701712fe1b2c1eb5a4187c3a9197973ef4da140c7704b3409c7c336e1027f89df340fcefc9e52c6ccac75b251aa79d67c98e49c4 SHA512 d2a5c02a541c0ae79cf8c8e1a38299351f9dd81d1a17724d9fe346d8eb4311e2566a319cf1b8a90d393bffdc11657f6fa2f6475441634e57701b00e74899baa0
24 +DIST pypy3.7-v7.3.2rc2-src.tar.bz2 25066853 BLAKE2B 286ec0909d4b9ba9039cd9ca234a90832e99369f5e7e36a486d219661631efac186e02146dd5bc5a51521fcfdd0047c3fa5a6dbffd20cebe8ff7c209d02fec53 SHA512 c8e5dc5ded2989aa3a6b635e040c23bb8e2812101ce22a104f251e0abaa3320b61f2f611ece58d6b8a8ae9f1cbc8ca22c920f3491dd5653bcb0e05264fd54a4f
25
26 diff --git a/dev-python/pypy3-exe/pypy3-exe-7.3.2_rc2_p37.ebuild b/dev-python/pypy3-exe/pypy3-exe-7.3.2_rc2_p37.ebuild
27 new file mode 100644
28 index 00000000000..8c73602fa5f
29 --- /dev/null
30 +++ b/dev-python/pypy3-exe/pypy3-exe-7.3.2_rc2_p37.ebuild
31 @@ -0,0 +1,152 @@
32 +# Copyright 1999-2020 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%_p37}
42 +MY_P=pypy3.7-v${PYPY_PV/_/}
43 +DESCRIPTION="PyPy3 executable (build from source)"
44 +HOMEPAGE="https://pypy.org/"
45 +SRC_URI="https://downloads.python.org/pypy/${MY_P}-src.tar.bz2"
46 +S="${WORKDIR}/${MY_P}-src"
47 +
48 +LICENSE="MIT"
49 +SLOT="${PV}"
50 +KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
51 +IUSE="bzip2 +jit low-memory ncurses cpu_flags_x86_sse2"
52 +
53 +RDEPEND=">=sys-libs/zlib-1.1.3:0=
54 + dev-libs/libffi:0=
55 + virtual/libintl:0=
56 + dev-libs/expat:0=
57 + bzip2? ( app-arch/bzip2:0= )
58 + ncurses? ( sys-libs/ncurses:0= )
59 + !dev-python/pypy3-exe-bin:${PV}"
60 +DEPEND="${RDEPEND}"
61 +BDEPEND="
62 + low-memory? ( dev-python/pypy )
63 + !low-memory? (
64 + || (
65 + dev-python/pypy
66 + (
67 + dev-lang/python:2.7
68 + dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
69 + )
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_configure() {
111 + tc-export CC
112 +
113 + local jit_backend
114 + if use jit; then
115 + jit_backend='--jit-backend='
116 +
117 + # We only need the explicit sse2 switch for x86.
118 + # On other arches we can rely on autodetection which uses
119 + # compiler macros. Plus, --jit-backend= doesn't accept all
120 + # the modern values...
121 +
122 + if use x86; then
123 + if use cpu_flags_x86_sse2; then
124 + jit_backend+=x86
125 + else
126 + jit_backend+=x86-without-sse2
127 + fi
128 + else
129 + jit_backend+=auto
130 + fi
131 + fi
132 +
133 + local args=(
134 + --no-shared
135 + $(usex jit -Ojit -O2)
136 +
137 + ${jit_backend}
138 +
139 + pypy/goal/targetpypystandalone
140 + )
141 +
142 + # Avoid linking against libraries disabled by use flags
143 + local opts=(
144 + bzip2:bz2
145 + ncurses:_minimal_curses
146 + )
147 +
148 + local opt
149 + for opt in "${opts[@]}"; do
150 + local flag=${opt%:*}
151 + local mod=${opt#*:}
152 +
153 + args+=(
154 + $(usex ${flag} --withmod --withoutmod)-${mod}
155 + )
156 + done
157 +
158 + local interp=( "${EPYTHON}" )
159 + if use low-memory; then
160 + interp=( env PYPY_GC_MAX_DELTA=200MB
161 + "${EPYTHON}" --jit loop_longevity=300 )
162 + fi
163 +
164 + # translate into the C sources
165 + # we're going to make them ourselves since otherwise pypy does not
166 + # free up the unneeded memory before spawning the compiler
167 + set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
168 + echo -e "\033[1m${@}\033[0m"
169 + "${@}" || die "translation failed"
170 +}
171 +
172 +src_compile() {
173 + emake -C "${T}"/usession*-0/testing_1
174 +}
175 +
176 +src_install() {
177 + local dest=/usr/lib/pypy3.7
178 + exeinto "${dest}"
179 + newexe "${T}"/usession*-0/testing_1/pypy3-c pypy3-c-${PYPY_PV}
180 + insinto "${dest}"/include/${PYPY_PV}
181 + doins include/pypy_*
182 + pax-mark m "${ED}${dest}/pypy3-c-${PYPY_PV}"
183 +}