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