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: Sun, 22 Nov 2020 11:51:06
Message-Id: 1606045850.b1d34446aa661e43f1f0bcca671043f2c6e9d07f.mgorny@gentoo
1 commit: b1d34446aa661e43f1f0bcca671043f2c6e9d07f
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 22 08:27:25 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 22 11:50:50 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1d34446
7
8 dev-python/pypy: Bump to 7.3.3 (final)
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.3.ebuild | 176 ++++++++++++++++++++++++++++++++++++++
14 2 files changed, 177 insertions(+)
15
16 diff --git a/dev-python/pypy/Manifest b/dev-python/pypy/Manifest
17 index 72d575304bd..8e407250474 100644
18 --- a/dev-python/pypy/Manifest
19 +++ b/dev-python/pypy/Manifest
20 @@ -1,5 +1,6 @@
21 DIST pypy2.7-v7.3.1-src.tar.bz2 21053306 BLAKE2B 071d59b7978c98e9ed9243d9a64d93d21b524351cb9a45e0f7d48828f919c84585a1164e7c38739fdd8828ab4b1eedade96dff7d64d0d9cbfe00c74d88d532bb SHA512 1bec44fa0fc4b1186e25f69303f9e332df32184be990d86fba41c40152664a93bd65eabf4dded133371271402cea9b150b60c13bce89d1004b276f0908c0b8f1
22 DIST pypy2.7-v7.3.2-src.tar.bz2 21142873 BLAKE2B e6bcd2dc28ef740962d053753ccd172e3895fc83fe23a319c003248e0986f9805839daddd13a0f480f1e9ee813979742699cb0bc8c42b6b05c193fedf67aea4f SHA512 b40d93d615a27e3a035007307a8ab2b49ff90f3047af914b268a80feb8219d372eca14c04a8b0dea91efb992653457b7c6d088c784de32c414cc48879f2d15fc
23 +DIST pypy2.7-v7.3.3-src.tar.bz2 20881821 BLAKE2B ce1ecdd1fffe40574c7662da6038b84d2bca47ab168939ef0c12be2c6348317f17a94a3026e7fa53c71601edc153aefd98f770bd148e7af07ca751c0a5fc1252 SHA512 c2b6c44fdcac5f9445fab01572f859228fc286891fd09a4ddb95d283683d805276c853ec8e61fcd04cb9ee811d0e959d19bb03fdd7442c044f28a773633122e7
24 DIST pypy2.7-v7.3.3rc1-src.tar.bz2 20933100 BLAKE2B afbf3c15924e6a215b6323fe97e9782912f09ba1e1db6652b37897ead07deaaa97f591a91f3695e958e8e2dee2626bbda94c4043c025b3f52a12279dc66e483c SHA512 0ddbdcf7ef825888ff748ebdd84cb501653e3a4a0e506e35810f9693b5d3b388c2f636396616f0c8fcc96dc806fa02d74830c1f37ca11fdcfdfd32c3bcd1fdd0
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.3.ebuild b/dev-python/pypy/pypy-7.3.3.ebuild
29 new file mode 100644
30 index 00000000000..dfe53d9ae35
31 --- /dev/null
32 +++ b/dev-python/pypy/pypy-7.3.3.ebuild
33 @@ -0,0 +1,176 @@
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://buildbot.pypy.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 ~arm64 ~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 + eapply "${FILESDIR}/7.3.3-distutils-cxx.patch"
77 +
78 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
79 + -i lib-python/2.7/distutils/command/install.py || die
80 +
81 + # apply CPython stdlib patches
82 + pushd lib-python/2.7 > /dev/null || die
83 + # TODO: cpy turkish locale patch now fixes C code
84 + # probably needs better port to pypy, if it is broken there
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 + local -x COLUMNS=80
150 +
151 + local ignored_tests=(
152 + # network
153 + --ignore=lib-python/2.7/test/test_urllibnet.py
154 + --ignore=lib-python/2.7/test/test_urllib2net.py
155 + # lots of free space
156 + --ignore=lib-python/2.7/test/test_zipfile64.py
157 + )
158 +
159 + ./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
160 + "${ignored_tests[@]}" lib-python || die
161 +}
162 +
163 +src_install() {
164 + local dest=/usr/lib/pypy2.7
165 + einfo "Installing PyPy ..."
166 + dosym pypy-c-${PV} "${dest}/pypy-c"
167 + insinto "${dest}"
168 + # preserve mtimes to avoid obsoleting caches
169 + insopts -p
170 + doins -r include lib_pypy lib-python
171 +
172 + # replace copied headers with symlinks
173 + for x in "${BROOT}"/usr/lib/pypy2.7/include/${PV}/*; do
174 + dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
175 + done
176 +
177 + dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
178 + dodoc README.rst
179 +
180 + if ! use gdbm; then
181 + rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
182 + "${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
183 + fi
184 + if ! use sqlite; then
185 + rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
186 + "${ED}${dest}"/lib_pypy/_sqlite3.py \
187 + "${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
188 + fi
189 + if ! use tk; then
190 + rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
191 + "${ED}${dest}"/lib_pypy/_tkinter \
192 + "${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
193 + fi
194 +
195 + local -x EPYTHON=pypy
196 + local -x PYTHON=${ED}${dest}/pypy-c-${PV}
197 + # temporarily copy to build tree to facilitate module builds
198 + cp -p "${BROOT}${dest}/pypy-c-${PV}" "${PYTHON}" || die
199 +
200 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
201 + python_moduleinto /usr/lib/pypy2.7/site-packages
202 + python_domodule epython.py
203 +
204 + einfo "Byte-compiling Python standard library..."
205 + python_optimize "${ED}${dest}"
206 +
207 + # remove to avoid collisions
208 + rm "${PYTHON}" || die
209 +}