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, 14 May 2021 22:00:25
Message-Id: 1621029529.131e0ae143b245a9d8f07577b90ac370ed4db9b7.mgorny@gentoo
1 commit: 131e0ae143b245a9d8f07577b90ac370ed4db9b7
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 14 21:02:04 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri May 14 21:58:49 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=131e0ae1
7
8 dev-python/pypy3: Bump to 7.3.5rc2
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy3/Manifest | 2 +
13 dev-python/pypy3/pypy3-7.3.5_rc2.ebuild | 176 ++++++++++++++++++++++++++++++++
14 2 files changed, 178 insertions(+)
15
16 diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
17 index b8212230b57..068a860157b 100644
18 --- a/dev-python/pypy3/Manifest
19 +++ b/dev-python/pypy3/Manifest
20 @@ -1,5 +1,7 @@
21 DIST pypy3.7-gentoo-patches-7.3.3_p3.tar.xz 17356 BLAKE2B 3418e4d600cdff96c228890dbfe0c63927ff4971be72eb951fb5fbc6ae803f4d26490f4a444dc788b165fa69ec77526413417ec5a697906a3089122f78351a8b SHA512 738d14e5ca693738150a3b9c1152a9b7a9c38dc77540fc7dd14f6d3a556a4b8716785f8f858ddd6b75545dadc623f0fccc57c84a869064ac423bee3acb1dceb6
22 DIST pypy3.7-gentoo-patches-7.3.4.tar.xz 8464 BLAKE2B 6d458a41e87eabeb2920b28752fe5cc49bbfc9c5f03d2fc1321362fbd02e9dfb3b41c99cb765b7f2644b9c49c5c60f879ad1c60a66bc991462edb50215b1802d SHA512 1282cf2fa9054209ceb5a91e0b4adcd86de33a326230fabe154b572d5e798d81e93d136e815f1c2816fbfdd5071fcfc175585d4fa5ae93145938bb4cf1d2baa7
23 DIST pypy3.7-gentoo-patches-7.3.4_p1.tar.xz 8868 BLAKE2B 5f897f920079dc86d6300ecaf6c9a43c30173b99e90d585151d3efec8718109e9165947ce772f48b6b15ff5c22c3f04f27aec088b34fd2c5c387f0b59728b333 SHA512 aa59f8eaecb1115fe391fe27ecd2c38a6c4213ea6e6de4954bd8a420ce5eb224c225b0ef1df19aef029546b05fa517a4965c9c24d98bc1be46c7eb024415a348
24 +DIST pypy3.7-gentoo-patches-7.3.5rc2.tar.xz 5300 BLAKE2B b538f31f94746c6f17eff85fd33da8b6675bb341a606cbfa28e244cebd1b6d22e7414acdf4eaea56a0f2d43ba69447efc805c46df3b279727dd472c74a5b5931 SHA512 ae0b2ff1d8187f79f7db71732966b06de023fb4e8011c180c86e78de2daafc3533be6340d3458c7a58a09a9923bc1e8792a4894382aa44eb6135170ae65d3324
25 DIST pypy3.7-v7.3.3-src.tar.bz2 24633503 BLAKE2B 0fb9fbb8866cf661c5b1d8d029fb2bc50737fae097875d0dac86c9ec21dc907093173b350a4f89d2c5a1fbed4c92ca4919f047536b828d4ee35583d615e7ddce SHA512 c98955e72dc0bd0452e4e16e0fe0ab318a34d6d57217ea33349e98ed047597ba97be7d15b41edd4dc85028fcca0a6257a4bb98fe96ce876e41a04df012261f4a
26 DIST pypy3.7-v7.3.4-src.tar.bz2 25344083 BLAKE2B e88dd0cfcc6123dbf894f603162ebe43675c96b992d15c29e14a611a166b8da8d1d2f3298e65e5794b295215440cb88f31d252fcdaef1a0dab52777c24212a49 SHA512 c570d34f284f41dcd8dd909216c69831dd83b8501423c7635a4fe506fb16fd3705cf87975a664735e52d0b805a0432267d611a993437d17aac3defe4b9ea4401
27 +DIST pypy3.7-v7.3.5rc2-src.tar.bz2 25255366 BLAKE2B 1fdcbed72953f03e049ef3f92b66fa63ad30bb409880bcf5986eba891cf2b05b847f9aa10d9e0f35b8e61c850d24d6cfe835d97f531189a6dcc98e0bf9b0d733 SHA512 626419c0bc99e04636be27b6b6f8452cd1c1cd2cb5c3593cf5044b7aea668f2da528b1b0d4fd853f79a1e2f9cd75fcd0f0e22efb913f1df44e6465aa13b98961
28
29 diff --git a/dev-python/pypy3/pypy3-7.3.5_rc2.ebuild b/dev-python/pypy3/pypy3-7.3.5_rc2.ebuild
30 new file mode 100644
31 index 00000000000..d75647a2e56
32 --- /dev/null
33 +++ b/dev-python/pypy3/pypy3-7.3.5_rc2.ebuild
34 @@ -0,0 +1,176 @@
35 +# Copyright 1999-2021 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +PYTHON_COMPAT=( python2_7 )
41 +inherit pax-utils python-any-r1 toolchain-funcs
42 +
43 +PYPY_PV=${PV%_p*}
44 +MY_P=pypy3.7-v${PYPY_PV/_}
45 +PATCHSET="pypy3.7-gentoo-patches-${PV/_}"
46 +
47 +DESCRIPTION="A fast, compliant alternative implementation of the Python (3.7) language"
48 +HOMEPAGE="https://www.pypy.org/"
49 +SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2
50 + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz"
51 +S="${WORKDIR}/${MY_P}-src"
52 +
53 +LICENSE="MIT"
54 +# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
55 +# also check pypy/interpreter/pycode.py -> pypy_incremental_magic
56 +SLOT="0/pypy37-pp73"
57 +KEYWORDS=""
58 +IUSE="bzip2 gdbm +jit ncurses sqlite test tk"
59 +# pypy3.7 is in alpha state and a lot of tests are failing
60 +RESTRICT="test"
61 +
62 +RDEPEND="
63 + || (
64 + >=dev-python/pypy3-exe-${PYPY_PV}:${PYPY_PV}[bzip2?,ncurses?]
65 + >=dev-python/pypy3-exe-bin-${PYPY_PV}:${PYPY_PV}
66 + )
67 + dev-libs/openssl:0=
68 + gdbm? ( sys-libs/gdbm:0= )
69 + sqlite? ( dev-db/sqlite:3= )
70 + tk? (
71 + dev-lang/tk:0=
72 + dev-tcltk/tix:0=
73 + )
74 + !<dev-python/pypy3-bin-7.3.0:0"
75 +DEPEND="${RDEPEND}
76 + test? (
77 + ${PYTHON_DEPS}
78 + !!dev-python/pytest-forked
79 + )"
80 +
81 +pkg_setup() {
82 + use test && python-any-r1_pkg_setup
83 +}
84 +
85 +src_prepare() {
86 + local PATCHES=(
87 + "${WORKDIR}/${PATCHSET}"
88 + )
89 + default
90 +
91 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
92 + -i lib-python/3/distutils/command/install.py || 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 +}