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/
Date: Wed, 16 Sep 2020 22:30:28
Message-Id: 1600295418.e7320566d1b6014a58d58348659b6ddf80dada45.mgorny@gentoo
1 commit: e7320566d1b6014a58d58348659b6ddf80dada45
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 16 17:24:29 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=e7320566
7
8 dev-python/pypy3: Bump to 7.3.2_rc2
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy3/Manifest | 1 +
13 dev-python/pypy3/pypy3-7.3.2_rc2.ebuild | 202 ++++++++++++++++++++++++++++++++
14 2 files changed, 203 insertions(+)
15
16 diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
17 index 4d82772ad7b..579344895a3 100644
18 --- a/dev-python/pypy3/Manifest
19 +++ b/dev-python/pypy3/Manifest
20 @@ -1,4 +1,5 @@
21 DIST pypy3.6-v7.3.0-src.tar.bz2 21937786 BLAKE2B c53ac32a9cca1c4624160eae9f11b5705a59613f1e5100fbb0ee86118de5a7845b8fa5087165d7f5a077d20337dfca14a1c7eadbe768995e20e249ec271ac10d SHA512 313a4254262dd8d8b995a50bddbc360cfb67add0818e51a3e9ce25bda6a9b639e9fea8efe7da6adda76dff0a86a364544a13faa516e51b9ea6c25ec99223b435
22 DIST pypy3.6-v7.3.1-src.tar.bz2 22712809 BLAKE2B 4250b3fe98c611b9635319c106b80e88ab469eab5f883babb738e175e7b7adc22c85f8ef3fdce1cdc127b521beef8d6c7862e188d8c8889c39f90136d6bbe374 SHA512 f8e32aae7f01225e0e4d6763eaac40fc02dffc3d0b6a30f22d422147f9be4f3290ea78160a912ffae311dea3d503eb31a7a4f3999d3b541fbccd93d1cef4ca56
23 DIST pypy3.6-v7.3.2rc1-src.tar.bz2 22730858 BLAKE2B 41a0702d0077c0f546998b858bc8b76226fe8903f4819497aa284231edcb32bc8b047b0a2a35bacfb18ea11fb85de98b95998276c22a3f0dc716b16871b35a3a SHA512 1a6f93f7e767b0db5c40c1e06cadd781c6ddfb02ec86aa61a37f649fe1aa5cd71f7857052e5b48092e3bf8b5cbef6d6401097bf4c4e80c62f7dbdffcd20b70c0
24 +DIST pypy3.6-v7.3.2rc2-src.tar.bz2 22750248 BLAKE2B 6a8a3c4306cb5c796ee89f3d9ece61f5d669515ae9edf4961f43c7779123554cda0f3b433f8264d3d08e531ef5fe660b494135321a11f441ae1de97ce0abb332 SHA512 a89184314d04bad646cf2e2151e2d5f27ca23a68f25e22b5c2e4f07745671e70c71d869be1c61248ee839632f7151b597fe79eb5af814967a1ae97f2c2cdb8ee
25 DIST pypy3.7-v7.3.2rc1-src.tar.bz2 24805791 BLAKE2B 7b16ba9f0b33d572facdf009701712fe1b2c1eb5a4187c3a9197973ef4da140c7704b3409c7c336e1027f89df340fcefc9e52c6ccac75b251aa79d67c98e49c4 SHA512 d2a5c02a541c0ae79cf8c8e1a38299351f9dd81d1a17724d9fe346d8eb4311e2566a319cf1b8a90d393bffdc11657f6fa2f6475441634e57701b00e74899baa0
26
27 diff --git a/dev-python/pypy3/pypy3-7.3.2_rc2.ebuild b/dev-python/pypy3/pypy3-7.3.2_rc2.ebuild
28 new file mode 100644
29 index 00000000000..45d2ebfd217
30 --- /dev/null
31 +++ b/dev-python/pypy3/pypy3-7.3.2_rc2.ebuild
32 @@ -0,0 +1,202 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +PYTHON_COMPAT=( python2_7 )
39 +inherit pax-utils python-any-r1 toolchain-funcs
40 +
41 +MY_P=pypy3.6-v${PV/_/}
42 +
43 +DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
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 +# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
50 +SLOT="0/pypy36-pp73"
51 +KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
52 +IUSE="bzip2 gdbm +jit libressl ncurses sqlite test tk"
53 +RESTRICT="!test? ( test )"
54 +
55 +RDEPEND="
56 + || (
57 + dev-python/pypy3-exe:${PV}[bzip2?,ncurses?]
58 + dev-python/pypy3-exe-bin:${PV}
59 + )
60 + !libressl? ( dev-libs/openssl:0= )
61 + libressl? ( dev-libs/libressl:0= )
62 + gdbm? ( sys-libs/gdbm:0= )
63 + sqlite? ( dev-db/sqlite:3= )
64 + tk? (
65 + dev-lang/tk:0=
66 + dev-tcltk/tix:0=
67 + )
68 + !<dev-python/pypy3-bin-7.3.0:0"
69 +DEPEND="${RDEPEND}
70 + test? (
71 + ${PYTHON_DEPS}
72 + !!dev-python/pytest-forked
73 + )"
74 +
75 +pkg_setup() {
76 + use test && python-any-r1_pkg_setup
77 +}
78 +
79 +src_prepare() {
80 + eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
81 + eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
82 + eapply "${FILESDIR}"/7.2.0-distutils-cxx.patch
83 +
84 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
85 + -i lib-python/3/distutils/command/install.py || die
86 +
87 + # apply CPython stdlib patches
88 + pushd lib-python/3 > /dev/null || die
89 + eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
90 + popd > /dev/null || die
91 +
92 + # see http://buildbot.pypy.org/summary?branch=py3.6&builder=pypy-c-jit-linux-x86-64
93 + sed -i -e 's:test_jumpy:_&:' \
94 + lib-python/3/test/test_dis.py || die
95 + sed -i -e 's:test_get_and_set_scheduler_and_param:_&:' \
96 + lib-python/3/test/test_posix.py || die
97 + sed -i -e 's:test_auto_history:_&:' \
98 + -e 's:test_history_size:_&:' \
99 + lib-python/3/test/test_readline.py || die
100 + sed -i -e 's:test_eval_bytes_invalid_escape:_&:' \
101 + -e 's:test_eval_str_invalid_escape:_&:' \
102 + lib-python/3/test/test_string_literals.py || die
103 + sed -i -e 's:test_jump_out_of_async_for_block:_&:' \
104 + -e 's:test_jump_over_async_for_block_before_else:_&:' \
105 + -e 's:test_no_jump_.*wards_into_async_for_block:_&:' \
106 + -e 's:test_no_jump_into_async_for_block_before_else:_&:' \
107 + -e 's:test_no_jump_from_yield:_&:' \
108 + lib-python/3/test/test_sys_settrace.py || die
109 + sed -i -e 's:test_circular_imports:_&:' \
110 + lib-python/3/test/test_threaded_import.py || die
111 +
112 + # the first one's broken by sandbox, the second by our env
113 + sed -i -e 's:test_empty_env:_&:' \
114 + -e 's:test_executable(:_&:' \
115 + -e 's:test_executable_without_cwd:_&:' \
116 + lib-python/3/test/test_subprocess.py || die
117 +
118 + # XXX
119 + sed -i -e 's:test_locale:_&:' \
120 + lib-python/3/test/test_format.py || die
121 + sed -i -e 's:test_decompressor_bug_28275:_&:' \
122 + lib-python/3/test/test_lzma.py || die
123 +
124 + eapply_user
125 +}
126 +
127 +src_configure() {
128 + tc-export CC
129 +}
130 +
131 +src_compile() {
132 + # copy over to make sys.prefix happy
133 + cp -p "${BROOT}"/usr/lib/pypy3.6/pypy3-c-${PV} pypy3-c || die
134 + cp -p "${BROOT}"/usr/lib/pypy3.6/include/${PV}/* include/ || die
135 + # (not installed by pypy)
136 + rm pypy/module/cpyext/include/_numpypy/numpy/README || die
137 + mv pypy/module/cpyext/include/* include/ || die
138 + mv pypy/module/cpyext/parse/*.h include/ || die
139 + pax-mark m pypy3-c
140 +
141 + einfo "Generating caches and CFFI modules ..."
142 +
143 + # Generate Grammar and PatternGrammar pickles.
144 + ./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
145 + || die "Generation of Grammar and PatternGrammar pickles failed"
146 +
147 + # Generate cffi modules
148 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
149 +#cffi_build_scripts = {
150 +# "_blake2": "_blake2/_blake2_build.py",
151 +# "_ssl": "_ssl_build.py",
152 +# "sqlite3": "_sqlite3_build.py",
153 +# "audioop": "_audioop_build.py",
154 +# "tk": "_tkinter/tklib_build.py",
155 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
156 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
157 +# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
158 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
159 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
160 +# "lzma": "_lzma_build.py",
161 +# "_decimal": "_decimal_build.py",
162 +# "_sha3": "_sha3/_sha3_build.py",
163 + cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
164 + audioop syslog pwdgrp resource lzma decimal )
165 + use gdbm && cffi_targets+=( gdbm )
166 + use ncurses && cffi_targets+=( curses )
167 + use sqlite && cffi_targets+=( sqlite3 )
168 + use tk && cffi_targets+=( tkinter/tklib )
169 +
170 + local t
171 + # all modules except tkinter output to .
172 + # tkinter outputs to the correct dir ...
173 + cd lib_pypy || die
174 + for t in "${cffi_targets[@]}"; do
175 + # tkinter doesn't work via -m
176 + ../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
177 + done
178 +
179 + # Cleanup temporary objects
180 + find -name "_cffi_*.[co]" -delete || die
181 + find -type d -empty -delete || die
182 +}
183 +
184 +src_test() {
185 + # (unset)
186 + local -x PYTHONDONTWRITEBYTECODE=
187 + local -x COLUMNS=80
188 +
189 + # Test runner requires Python 2 too. However, it spawns PyPy3
190 + # internally so that we end up testing the correct interpreter.
191 + "${EPYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
192 +}
193 +
194 +src_install() {
195 + local dest=/usr/lib/pypy3.6
196 + einfo "Installing PyPy ..."
197 + dosym pypy3-c-${PV} "${dest}/pypy3-c"
198 + insinto "${dest}"
199 + # preserve mtimes to avoid obsoleting caches
200 + insopts -p
201 + doins -r include lib_pypy lib-python
202 +
203 + # replace copied headers with symlinks
204 + for x in "${BROOT}"/usr/lib/pypy3.6/include/${PV}/*; do
205 + dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
206 + done
207 +
208 + dosym ../lib/pypy3.6/pypy3-c /usr/bin/pypy3
209 + dodoc README.rst
210 +
211 + if ! use gdbm; then
212 + rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
213 + fi
214 + if ! use sqlite; then
215 + rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
216 + "${ED}${dest}"/lib_pypy/_sqlite3* \
217 + "${ED}${dest}"/lib-python/*3/test/test_sqlite.py || die
218 + fi
219 + if ! use tk; then
220 + rm -r "${ED}${dest}"/lib-python/*3/{idlelib,tkinter} \
221 + "${ED}${dest}"/lib_pypy/_tkinter \
222 + "${ED}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
223 + fi
224 +
225 + local -x EPYTHON=pypy3
226 + local -x PYTHON=${ED}${dest}/pypy3-c
227 +
228 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
229 + python_moduleinto /usr/lib/pypy3.6/site-packages
230 + python_domodule epython.py
231 +
232 + einfo "Byte-compiling Python standard library..."
233 + python_optimize "${ED}${dest}"
234 +}