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: Fri, 25 Sep 2020 12:13:50
Message-Id: 1601036011.c584d676c9834bc567c1452789235903b0988ec7.mgorny@gentoo
1 commit: c584d676c9834bc567c1452789235903b0988ec7
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 25 09:46:01 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 25 12:13:31 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c584d676
7
8 dev-python/pypy: Bump to 7.3.2 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.2.ebuild | 175 ++++++++++++++++++++++++++++++++++++++
14 2 files changed, 176 insertions(+)
15
16 diff --git a/dev-python/pypy/Manifest b/dev-python/pypy/Manifest
17 index 6c73fdd1956..092d1b35447 100644
18 --- a/dev-python/pypy/Manifest
19 +++ b/dev-python/pypy/Manifest
20 @@ -1,4 +1,5 @@
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.2rc2-src.tar.bz2 21145693 BLAKE2B e722111435f81d00ecb5cec83e78e17676a042703fe83c049456fa6e5debdb1c09cc3f1fd71bcd8a8469da373a7c8131c252b3f139959a442f4cfa2b7f202c6f SHA512 ba7cccdaff1616ad0090cb0942ad35eda025a758be4d6b4e978bce19fb8cb8840136297fb924127a7e99f02c09665bde7eaf714e1744b9b32612973355459ad4
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.ebuild b/dev-python/pypy/pypy-7.3.2.ebuild
28 new file mode 100644
29 index 00000000000..894219fffb4
30 --- /dev/null
31 +++ b/dev-python/pypy/pypy-7.3.2.ebuild
32 @@ -0,0 +1,175 @@
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://buildbot.pypy.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 + popd > /dev/null || die
86 +
87 + # this test relies on pypy-c hardcoding correct build time paths
88 + sed -i -e 's:test_executable_without_cwd:_&:' \
89 + lib-python/2.7/test/test_subprocess.py || die
90 + # requires Internet
91 + sed -i -e '/class NetworkedTests/i@××××××××.skip("Requires networking")' \
92 + lib-python/2.7/test/test_ssl.py || die
93 +
94 + eapply_user
95 +}
96 +
97 +src_compile() {
98 + # copy over to make sys.prefix happy
99 + cp -p "${BROOT}"/usr/lib/pypy2.7/pypy-c-${PV} pypy-c || die
100 + cp -p "${BROOT}"/usr/lib/pypy2.7/include/${PV}/* include/ || die
101 + # (not installed by pypy)
102 + rm pypy/module/cpyext/include/_numpypy/numpy/README || die
103 + mv pypy/module/cpyext/include/* include/ || die
104 + mv pypy/module/cpyext/parse/*.h include/ || die
105 + pax-mark m pypy-c
106 +
107 + einfo "Generating caches and CFFI modules ..."
108 +
109 + # Generate Grammar and PatternGrammar pickles.
110 + ./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
111 + || die "Generation of Grammar and PatternGrammar pickles failed"
112 +
113 + # Generate cffi modules
114 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
115 +#cffi_build_scripts = {
116 +# "_ssl": "_ssl_build.py",
117 +# "sqlite3": "_sqlite3_build.py",
118 +# "audioop": "_audioop_build.py",
119 +# "tk": "_tkinter/tklib_build.py",
120 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
121 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
122 +# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
123 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
124 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
125 + cffi_targets=( ssl audioop syslog pwdgrp resource )
126 + use gdbm && cffi_targets+=( gdbm )
127 + use ncurses && cffi_targets+=( curses )
128 + use sqlite && cffi_targets+=( sqlite3 )
129 + use tk && cffi_targets+=( tkinter/tklib )
130 +
131 + local t
132 + # all modules except tkinter output to .
133 + # tkinter outputs to the correct dir ...
134 + cd lib_pypy || die
135 + for t in "${cffi_targets[@]}"; do
136 + # tkinter doesn't work via -m
137 + ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
138 + done
139 +
140 + # Cleanup temporary objects
141 + find -name "_cffi_*.[co]" -delete || die
142 + find -type d -empty -delete || die
143 +}
144 +
145 +src_test() {
146 + # (unset)
147 + local -x PYTHONDONTWRITEBYTECODE=
148 +
149 + local ignored_tests=(
150 + # network
151 + --ignore=lib-python/2.7/test/test_urllibnet.py
152 + --ignore=lib-python/2.7/test/test_urllib2net.py
153 + # lots of free space
154 + --ignore=lib-python/2.7/test/test_zipfile64.py
155 + )
156 +
157 + ./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
158 + "${ignored_tests[@]}" lib-python || die
159 +}
160 +
161 +src_install() {
162 + local dest=/usr/lib/pypy2.7
163 + einfo "Installing PyPy ..."
164 + dosym pypy-c-${PV} "${dest}/pypy-c"
165 + insinto "${dest}"
166 + # preserve mtimes to avoid obsoleting caches
167 + insopts -p
168 + doins -r include lib_pypy lib-python
169 +
170 + # replace copied headers with symlinks
171 + for x in "${BROOT}"/usr/lib/pypy2.7/include/${PV}/*; do
172 + dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
173 + done
174 +
175 + dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
176 + dodoc README.rst
177 +
178 + if ! use gdbm; then
179 + rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
180 + "${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
181 + fi
182 + if ! use sqlite; then
183 + rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
184 + "${ED}${dest}"/lib_pypy/_sqlite3.py \
185 + "${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
186 + fi
187 + if ! use tk; then
188 + rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
189 + "${ED}${dest}"/lib_pypy/_tkinter \
190 + "${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
191 + fi
192 +
193 + local -x EPYTHON=pypy
194 + local -x PYTHON=${ED}${dest}/pypy-c-${PV}
195 + # temporarily copy to build tree to facilitate module builds
196 + cp -p "${BROOT}${dest}/pypy-c-${PV}" "${PYTHON}" || die
197 +
198 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
199 + python_moduleinto /usr/lib/pypy2.7/site-packages
200 + python_domodule epython.py
201 +
202 + einfo "Byte-compiling Python standard library..."
203 + python_optimize "${ED}${dest}"
204 +
205 + # remove to avoid collisions
206 + rm "${PYTHON}" || die
207 +}