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, 25 Sep 2020 12:13:51
Message-Id: 1601036015.f79d0f8f85d9fae4f62ac7f69d7567a1ea5f1b65.mgorny@gentoo
1 commit: f79d0f8f85d9fae4f62ac7f69d7567a1ea5f1b65
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 25 09:55:55 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 25 12:13:35 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f79d0f8f
7
8 dev-python/pypy3: Bump to 7.3.2 final (3.7)
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_p37.ebuild | 178 ++++++++++++++++++++++++++++++++
14 2 files changed, 179 insertions(+)
15
16 diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
17 index 6b5ec5d96b6..63923ccf593 100644
18 --- a/dev-python/pypy3/Manifest
19 +++ b/dev-python/pypy3/Manifest
20 @@ -1,4 +1,5 @@
21 DIST pypy3.6-v7.3.1-src.tar.bz2 22712809 BLAKE2B 4250b3fe98c611b9635319c106b80e88ab469eab5f883babb738e175e7b7adc22c85f8ef3fdce1cdc127b521beef8d6c7862e188d8c8889c39f90136d6bbe374 SHA512 f8e32aae7f01225e0e4d6763eaac40fc02dffc3d0b6a30f22d422147f9be4f3290ea78160a912ffae311dea3d503eb31a7a4f3999d3b541fbccd93d1cef4ca56
22 DIST pypy3.6-v7.3.2-src.tar.bz2 22736022 BLAKE2B e2338ac3f7af06b987c43e93eab9ff14d46262143472b0393b30b011fff67d33add45d8198cee7109354e09c52a2540938abeef364b0cf12f2891ca9c7aac2a4 SHA512 ed861a57d6edf1548c061d10295313a05d0ac54fe68a8755211ff76fa2dc78d7b1479c6152dc5d0d1cdce4e247c240c1a2edf59ec8a53d0004ec7713514c9c35
23 DIST pypy3.6-v7.3.2rc2-src.tar.bz2 22750248 BLAKE2B 6a8a3c4306cb5c796ee89f3d9ece61f5d669515ae9edf4961f43c7779123554cda0f3b433f8264d3d08e531ef5fe660b494135321a11f441ae1de97ce0abb332 SHA512 a89184314d04bad646cf2e2151e2d5f27ca23a68f25e22b5c2e4f07745671e70c71d869be1c61248ee839632f7151b597fe79eb5af814967a1ae97f2c2cdb8ee
24 +DIST pypy3.7-v7.3.2-src.tar.bz2 25060911 BLAKE2B 35ecfee4c64e13539827c65a61e0cd359de4046f77553629cdf63479327c6ad86afd1443caa7a911a6271f496f0f3caf1b919ce91de717d0a71d008927b7f77b SHA512 563a9cf63e818b95aeb14c25b55bb5fb0bf8283f0b9f2bdd9a8833989beb651681f53f52368fb9db2c75fb60be0456eec87d48b557740b57847c4104003cb288
25 DIST pypy3.7-v7.3.2rc2-src.tar.bz2 25066853 BLAKE2B 286ec0909d4b9ba9039cd9ca234a90832e99369f5e7e36a486d219661631efac186e02146dd5bc5a51521fcfdd0047c3fa5a6dbffd20cebe8ff7c209d02fec53 SHA512 c8e5dc5ded2989aa3a6b635e040c23bb8e2812101ce22a104f251e0abaa3320b61f2f611ece58d6b8a8ae9f1cbc8ca22c920f3491dd5653bcb0e05264fd54a4f
26
27 diff --git a/dev-python/pypy3/pypy3-7.3.2_p37.ebuild b/dev-python/pypy3/pypy3-7.3.2_p37.ebuild
28 new file mode 100644
29 index 00000000000..b64450341d4
30 --- /dev/null
31 +++ b/dev-python/pypy3/pypy3-7.3.2_p37.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 +PYTHON_COMPAT=( python2_7 )
39 +inherit pax-utils python-any-r1 toolchain-funcs
40 +
41 +PYPY_PV=${PV%_p37}
42 +MY_P=pypy3.7-v${PYPY_PV/_/}
43 +
44 +DESCRIPTION="A fast, compliant alternative implementation of the Python (3.7) language"
45 +HOMEPAGE="https://pypy.org/"
46 +SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2"
47 +S="${WORKDIR}/${MY_P}-src"
48 +
49 +LICENSE="MIT"
50 +# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
51 +SLOT="0/pypy37-pp73"
52 +KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
53 +IUSE="bzip2 gdbm +jit libressl ncurses sqlite test tk"
54 +# pypy3.7 is in alpha state and a lot of tests are failing
55 +RESTRICT="test"
56 +
57 +RDEPEND="
58 + || (
59 + dev-python/pypy3-exe:${PV}[bzip2?,ncurses?]
60 + dev-python/pypy3-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/pypy3-bin-7.3.0:0"
71 +DEPEND="${RDEPEND}
72 + test? (
73 + ${PYTHON_DEPS}
74 + !!dev-python/pytest-forked
75 + )"
76 +
77 +pkg_setup() {
78 + use test && python-any-r1_pkg_setup
79 +}
80 +
81 +src_prepare() {
82 + eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
83 + eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
84 + eapply "${FILESDIR}/7.3.2-py37-distutils-cxx.patch"
85 +
86 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
87 + -i lib-python/3/distutils/command/install.py || die
88 +
89 + # apply CPython stdlib patches
90 + pushd lib-python/3 > /dev/null || die
91 + eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
92 + popd > /dev/null || die
93 +
94 + eapply_user
95 +}
96 +
97 +src_configure() {
98 + tc-export CC
99 +}
100 +
101 +src_compile() {
102 + # copy over to make sys.prefix happy
103 + cp -p "${BROOT}"/usr/lib/pypy3.7/pypy3-c-${PYPY_PV} pypy3-c || die
104 + cp -p "${BROOT}"/usr/lib/pypy3.7/include/${PYPY_PV}/* include/ || die
105 + # (not installed by pypy)
106 + rm pypy/module/cpyext/include/_numpypy/numpy/README || die
107 + mv pypy/module/cpyext/include/* include/ || die
108 + mv pypy/module/cpyext/parse/*.h include/ || die
109 + pax-mark m pypy3-c
110 +
111 + einfo "Generating caches and CFFI modules ..."
112 +
113 + # Generate Grammar and PatternGrammar pickles.
114 + ./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
115 + || die "Generation of Grammar and PatternGrammar pickles failed"
116 +
117 + # Generate cffi modules
118 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
119 +#cffi_build_scripts = {
120 +# "_blake2": "_blake2/_blake2_build.py",
121 +# "_ssl": "_ssl_build.py",
122 +# "sqlite3": "_sqlite3_build.py",
123 +# "audioop": "_audioop_build.py",
124 +# "tk": "_tkinter/tklib_build.py",
125 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
126 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
127 +# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
128 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
129 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
130 +# "lzma": "_lzma_build.py",
131 +# "_decimal": "_decimal_build.py",
132 +# "_sha3": "_sha3/_sha3_build.py",
133 + cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
134 + audioop syslog pwdgrp resource lzma decimal )
135 + use gdbm && cffi_targets+=( gdbm )
136 + use ncurses && cffi_targets+=( curses )
137 + use sqlite && cffi_targets+=( sqlite3 )
138 + use tk && cffi_targets+=( tkinter/tklib )
139 +
140 + local t
141 + # all modules except tkinter output to .
142 + # tkinter outputs to the correct dir ...
143 + cd lib_pypy || die
144 + for t in "${cffi_targets[@]}"; do
145 + # tkinter doesn't work via -m
146 + ../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
147 + done
148 +
149 + # Cleanup temporary objects
150 + find -name "_cffi_*.[co]" -delete || die
151 + find -type d -empty -delete || die
152 +}
153 +
154 +src_test() {
155 + # (unset)
156 + local -x PYTHONDONTWRITEBYTECODE=
157 + local -x COLUMNS=80
158 +
159 + # Test runner requires Python 2 too. However, it spawns PyPy3
160 + # internally so that we end up testing the correct interpreter.
161 + # (--deselect for failing doctests)
162 + "${EPYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
163 +}
164 +
165 +src_install() {
166 + local dest=/usr/lib/pypy3.7
167 + einfo "Installing PyPy ..."
168 + dosym pypy3-c-${PYPY_PV} "${dest}/pypy3-c"
169 + insinto "${dest}"
170 + # preserve mtimes to avoid obsoleting caches
171 + insopts -p
172 + doins -r include lib_pypy lib-python
173 +
174 + # replace copied headers with symlinks
175 + for x in "${BROOT}"/usr/lib/pypy3.7/include/${PYPY_PV}/*; do
176 + dosym "${PYPY_PV}/${x##*/}" "${dest}/include/${x##*/}"
177 + done
178 +
179 + dosym ../lib/pypy3.7/pypy3-c /usr/bin/pypy3
180 + dodoc README.rst
181 +
182 + if ! use gdbm; then
183 + rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
184 + fi
185 + if ! use sqlite; then
186 + rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
187 + "${ED}${dest}"/lib_pypy/_sqlite3* \
188 + "${ED}${dest}"/lib-python/*3/test/test_sqlite.py || die
189 + fi
190 + if ! use tk; then
191 + rm -r "${ED}${dest}"/lib-python/*3/{idlelib,tkinter} \
192 + "${ED}${dest}"/lib_pypy/_tkinter \
193 + "${ED}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
194 + fi
195 +
196 + local -x EPYTHON=pypy3
197 + local -x PYTHON=${ED}${dest}/pypy3-c-${PYPY_PV}
198 + # temporarily copy to build tree to facilitate module builds
199 + cp -p "${BROOT}${dest}/pypy3-c-${PYPY_PV}" "${PYTHON}" || die
200 +
201 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
202 + python_moduleinto /usr/lib/pypy3.7/site-packages
203 + python_domodule epython.py
204 +
205 + einfo "Byte-compiling Python standard library..."
206 + python_optimize "${ED}${dest}"
207 +
208 + # remove to avoid collisions
209 + rm "${PYTHON}" || die
210 +}