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