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/
Date: Wed, 09 Sep 2020 07:18:13
Message-Id: 1599635880.a1dd6c2056915ae7a5391e4ea899f0e3adb4363a.mgorny@gentoo
1 commit: a1dd6c2056915ae7a5391e4ea899f0e3adb4363a
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 9 05:40:44 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 9 07:18:00 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1dd6c20
7
8 dev-python/pypy: Bump to 7.3.2_rc1
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy/Manifest | 2 +
13 dev-python/pypy/pypy-7.3.2_rc1.ebuild | 178 ++++++++++++++++++++++++++++++++++
14 2 files changed, 180 insertions(+)
15
16 diff --git a/dev-python/pypy/Manifest b/dev-python/pypy/Manifest
17 index 213a5503a61..7c19d41f9fe 100644
18 --- a/dev-python/pypy/Manifest
19 +++ b/dev-python/pypy/Manifest
20 @@ -1,3 +1,5 @@
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 DIST python-gentoo-patches-2.7.17-r1.tar.xz 14708 BLAKE2B f6e25236a471649de122d0f29506f7a4f34044a568ead47a68980411d9722b761fe1f9d653d5edccb6978b65c8c1eecbef55f403b94f32b37c0ad68e061505a8 SHA512 ecdde5e38c6fe5e69691fb3a68c8f4f43da7857d4abaff763d3cf6ad864ba43c769c03b186b60f2736a1ffb1e3e4c9982715d1b8a99ff3f5740096153bb8a90f
25 +DIST python-gentoo-patches-2.7.18-r1.tar.xz 15500 BLAKE2B 7008b29827dbbd80d4ab8f010ccf9efced99c6b4b9109e4430c0ba269ce53529cb6fedd832502c8d2d3aa21938749cc3591c2545b21c0a59a6e60f8598e84ccc SHA512 e656ab07281fd932b92165674619bbf55ecf410d2937ae4ae771d490b4532540498cc731d30d19c1e8aafd1f64df8a406bbfbb46ea985b3dcd8edb89a0b7f20f
26
27 diff --git a/dev-python/pypy/pypy-7.3.2_rc1.ebuild b/dev-python/pypy/pypy-7.3.2_rc1.ebuild
28 new file mode 100644
29 index 00000000000..7a8f746ecba
30 --- /dev/null
31 +++ b/dev-python/pypy/pypy-7.3.2_rc1.ebuild
32 @@ -0,0 +1,178 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +inherit pax-utils python-utils-r1
39 +
40 +MY_P=pypy2.7-v${PV/_/}
41 +# note: remember to update this to newest dev-lang/python:2.7 on bump
42 +PATCHSET="python-gentoo-patches-2.7.18-r1"
43 +
44 +DESCRIPTION="A fast, compliant alternative implementation of the Python language"
45 +HOMEPAGE="https://pypy.org/"
46 +SRC_URI="https://downloads.python.org/pypy/${MY_P}-src.tar.bz2
47 + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz"
48 +S="${WORKDIR}/${MY_P}-src"
49 +
50 +LICENSE="MIT"
51 +# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
52 +SLOT="0/73"
53 +KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
54 +IUSE="bzip2 gdbm +jit libressl ncurses sqlite tk"
55 +
56 +RDEPEND="
57 + || (
58 + dev-python/pypy-exe:${PV}[bzip2?,ncurses?]
59 + dev-python/pypy-exe-bin:${PV}
60 + )
61 + !libressl? ( dev-libs/openssl:0= )
62 + libressl? ( dev-libs/libressl:0= )
63 + gdbm? ( sys-libs/gdbm:0= )
64 + sqlite? ( dev-db/sqlite:3= )
65 + tk? (
66 + dev-lang/tk:0=
67 + dev-tcltk/tix:0=
68 + )
69 + !<dev-python/pypy-bin-7.3.0:0"
70 +DEPEND="${RDEPEND}"
71 +
72 +src_prepare() {
73 + eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
74 + eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
75 +
76 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
77 + -i lib-python/2.7/distutils/command/install.py || die
78 +
79 + # apply CPython stdlib patches
80 + pushd lib-python/2.7 > /dev/null || die
81 + # TODO: cpy turkish locale patch now fixes C code
82 + # probably needs better port to pypy, if it is broken there
83 + eapply "${FILESDIR}"/5.8.0_all_distutils_cxx.patch
84 + eapply -p2 "${WORKDIR}/${PATCHSET}"/0010-use_pyxml.patch
85 + eapply -p2 "${WORKDIR}/${PATCHSET}"/0017-bpo-39017-Avoid-infinite-loop-in-the-tarfile-module-.patch
86 + popd > /dev/null || die
87 +
88 + # this test relies on pypy-c hardcoding correct build time paths
89 + sed -i -e 's:test_executable_without_cwd:_&:' \
90 + lib-python/2.7/test/test_subprocess.py || die
91 + # broken upstream
92 + # see http://buildbot.pypy.org/summary?branch=%3Ctrunk%3E
93 + sed -i -e 's:test_alpn_protocols:_&:' \
94 + -e 's:test_default_ecdh_curve:_&:' \
95 + lib-python/2.7/test/test_ssl.py || die
96 + # requires Internet
97 + sed -i -e '/class NetworkedTests/i@××××××××.skip("Requires networking")' \
98 + lib-python/2.7/test/test_ssl.py || die
99 +
100 + eapply_user
101 +}
102 +
103 +src_compile() {
104 + # copy over to make sys.prefix happy
105 + cp -p "${BROOT}"/usr/lib/pypy2.7/pypy-c-${PV} pypy-c || die
106 + cp -p "${BROOT}"/usr/lib/pypy2.7/include/${PV}/* include/ || die
107 + # (not installed by pypy)
108 + rm pypy/module/cpyext/include/_numpypy/numpy/README || die
109 + mv pypy/module/cpyext/include/* include/ || die
110 + mv pypy/module/cpyext/parse/*.h include/ || die
111 + pax-mark m pypy-c
112 +
113 + einfo "Generating caches and CFFI modules ..."
114 +
115 + # Generate Grammar and PatternGrammar pickles.
116 + ./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
117 + || die "Generation of Grammar and PatternGrammar pickles failed"
118 +
119 + # Generate cffi modules
120 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
121 +#cffi_build_scripts = {
122 +# "_ssl": "_ssl_build.py",
123 +# "sqlite3": "_sqlite3_build.py",
124 +# "audioop": "_audioop_build.py",
125 +# "tk": "_tkinter/tklib_build.py",
126 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
127 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
128 +# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
129 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
130 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
131 + cffi_targets=( ssl audioop syslog pwdgrp resource )
132 + use gdbm && cffi_targets+=( gdbm )
133 + use ncurses && cffi_targets+=( curses )
134 + use sqlite && cffi_targets+=( sqlite3 )
135 + use tk && cffi_targets+=( tkinter/tklib )
136 +
137 + local t
138 + # all modules except tkinter output to .
139 + # tkinter outputs to the correct dir ...
140 + cd lib_pypy || die
141 + for t in "${cffi_targets[@]}"; do
142 + # tkinter doesn't work via -m
143 + ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
144 + done
145 +
146 + # Cleanup temporary objects
147 + find -name "_cffi_*.[co]" -delete || die
148 + find -type d -empty -delete || die
149 +}
150 +
151 +src_test() {
152 + # (unset)
153 + local -x PYTHONDONTWRITEBYTECODE=
154 +
155 + local ignored_tests=(
156 + # network
157 + --ignore=lib-python/2.7/test/test_urllibnet.py
158 + --ignore=lib-python/2.7/test/test_urllib2net.py
159 + # lots of free space
160 + --ignore=lib-python/2.7/test/test_zipfile64.py
161 + # no module named 'worker' -- a lot
162 + --ignore=lib-python/2.7/test/test_xpickle.py
163 + )
164 +
165 + ./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
166 + "${ignored_tests[@]}" lib-python || die
167 +}
168 +
169 +src_install() {
170 + local dest=/usr/lib/pypy2.7
171 + einfo "Installing PyPy ..."
172 + dosym pypy-c-${PV} "${dest}/pypy-c"
173 + insinto "${dest}"
174 + # preserve mtimes to avoid obsoleting caches
175 + insopts -p
176 + doins -r include lib_pypy lib-python
177 +
178 + # replace copied headers with symlinks
179 + for x in "${BROOT}"/usr/lib/pypy2.7/include/${PV}/*; do
180 + dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
181 + done
182 +
183 + dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
184 + dodoc README.rst
185 +
186 + if ! use gdbm; then
187 + rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
188 + "${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
189 + fi
190 + if ! use sqlite; then
191 + rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
192 + "${ED}${dest}"/lib_pypy/_sqlite3.py \
193 + "${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
194 + fi
195 + if ! use tk; then
196 + rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
197 + "${ED}${dest}"/lib_pypy/_tkinter \
198 + "${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
199 + fi
200 +
201 + local -x EPYTHON=pypy
202 + local -x PYTHON=${ED}${dest}/pypy-c
203 +
204 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
205 + python_moduleinto /usr/lib/pypy2.7/site-packages
206 + python_domodule epython.py
207 +
208 + einfo "Byte-compiling Python standard library..."
209 + python_optimize "${ED}${dest}"
210 +}