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: Tue, 14 Sep 2021 16:22:44
Message-Id: 1631636556.cc1e883da981b985279a2fce797c29c84ea4a882.mgorny@gentoo
1 commit: cc1e883da981b985279a2fce797c29c84ea4a882
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 14 08:47:42 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 14 16:22:36 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc1e883d
7
8 dev-python/pypy3: Bump to 7.3.6_rc1
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.6_rc1.ebuild | 188 ++++++++++++++++++++++++++++++++
14 2 files changed, 190 insertions(+)
15
16 diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
17 index 21a7249038f..632dd870364 100644
18 --- a/dev-python/pypy3/Manifest
19 +++ b/dev-python/pypy3/Manifest
20 @@ -1,2 +1,4 @@
21 DIST pypy3.7-gentoo-patches-7.3.5_p1.tar.xz 9792 BLAKE2B c82869393c8a63462fa03c58822f95628093a64d2bb421aaa486ad8217d944ace641d9ea13f2b2a2c56ab16498824709fa35cf0a9704b728bac06646d8f2c15f SHA512 18643e28f137f62406ce4f2d448acb86329fd8566a31b90340c573e4205091ff5b15b77ac14796022968814f940cd9881fe4db9010609937b2a0a71d557531f2
22 DIST pypy3.7-v7.3.5-src.tar.bz2 25350766 BLAKE2B 34d5c83284271b184f71492dbd65b8760cc0fcdec71e41ef48b9561280dd67ef4c37fdd70759d0b95114d127446fc0ea5d04feb99022c1a725233862b2028834 SHA512 253d2efc81d55fb392ab810741e3a633f664e1908b2c26db7a8830c971655cca6be1b8d34581d13aa2d738a4a4c8ba23c2c90333b6e03d4608372e8013ea723b
23 +DIST pypy3.8-gentoo-patches-7.3.6rc1.tar.xz 4660 BLAKE2B 2a1fff331707a29dfb232ce4c2c6d3cada127b4452036172c3aac7579d89b8e0d4ea41300ffcadf0ec04b9cde32044371d55d225a477f2178dddb03642aa569b SHA512 bb781369d4e0dd387659fc474c7a23d8c54ab88477fdd007d3552c95e870a1896a0628dbba876e870956c5a1efeb52efbfd343a08f8a70a4515f41b1dc8ed60d
24 +DIST pypy3.8-v7.3.6rc1-src.tar.bz2 24320127 BLAKE2B 920738d1d9a346dca8e76602fc5a1502ff6f610897e1f5b841b5207a32f82c52770684ba4ea076209e18b664cb9ba5df555a21f838ae581b436cbff9e2adb506 SHA512 334baf973397f8068137382c29632afd1288b76b57f21047bef59397d2718d8c420ba68acc2f1082501aadf7fbf8ee6a9fa86405c2a54d720a9a02dd7a7371aa
25
26 diff --git a/dev-python/pypy3/pypy3-7.3.6_rc1.ebuild b/dev-python/pypy3/pypy3-7.3.6_rc1.ebuild
27 new file mode 100644
28 index 00000000000..2b583b3b853
29 --- /dev/null
30 +++ b/dev-python/pypy3/pypy3-7.3.6_rc1.ebuild
31 @@ -0,0 +1,188 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +PYTHON_COMPAT=( python2_7 )
38 +inherit pax-utils python-any-r1 toolchain-funcs
39 +
40 +PYPY_PV=${PV%_p*}
41 +MY_P=pypy3.8-v${PYPY_PV/_rc/rc}
42 +PATCHSET="pypy3.8-gentoo-patches-${PV/_rc/rc}"
43 +
44 +DESCRIPTION="A fast, compliant alternative implementation of the Python (3.8) language"
45 +HOMEPAGE="https://www.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 +# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
52 +# also check pypy/interpreter/pycode.py -> pypy_incremental_magic
53 +SLOT="0/pypy38-pp73"
54 +KEYWORDS=""
55 +IUSE="bzip2 gdbm +jit ncurses sqlite test tk"
56 +# pypy3.8 is in alpha state and many tests are failing
57 +RESTRICT="test"
58 +
59 +RDEPEND="
60 + || (
61 + >=dev-python/pypy3-exe-${PYPY_PV}:${PYPY_PV}[bzip2?,ncurses?]
62 + >=dev-python/pypy3-exe-bin-${PYPY_PV}:${PYPY_PV}
63 + )
64 + dev-libs/openssl:0=
65 + gdbm? ( sys-libs/gdbm:0= )
66 + sqlite? ( dev-db/sqlite:3= )
67 + tk? (
68 + dev-lang/tk:0=
69 + dev-tcltk/tix:0=
70 + )
71 + !<dev-python/pypy3-bin-7.3.0:0"
72 +DEPEND="${RDEPEND}
73 + test? (
74 + ${PYTHON_DEPS}
75 + !!dev-python/pytest-forked
76 + )"
77 +
78 +pkg_setup() {
79 + use test && python-any-r1_pkg_setup
80 +}
81 +
82 +src_prepare() {
83 + local PATCHES=(
84 + "${WORKDIR}/${PATCHSET}"
85 + )
86 + default
87 +
88 + eapply_user
89 +}
90 +
91 +src_configure() {
92 + tc-export CC
93 +}
94 +
95 +src_compile() {
96 + mkdir bin || die
97 + # switch to the layout expected for cffi module builds
98 + mkdir include/pypy3.8 || die
99 + cp include/*.h include/pypy3.8/ || die
100 + # copy over to make sys.prefix happy
101 + cp -p "${BROOT}"/usr/bin/pypy3-c-${PYPY_PV} pypy3-c || die
102 + cp -p "${BROOT}"/usr/include/pypy3.8/${PYPY_PV}/* include/pypy3.8/ || die
103 + # (not installed by pypy-exe)
104 + rm pypy/module/cpyext/include/_numpypy/numpy/README || die
105 + mv pypy/module/cpyext/include/* include/pypy3.8/ || die
106 + mv pypy/module/cpyext/parse/*.h include/pypy3.8/ || die
107 + pax-mark m pypy3-c
108 +
109 + # verify the subslot
110 + local soabi=$(./pypy3-c -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))')
111 + [[ ${soabi} == ${SLOT#*/} ]] || die "update subslot to ${soabi}"
112 +
113 + einfo "Generating caches and CFFI modules ..."
114 +
115 + # Generate Grammar and PatternGrammar pickles.
116 + ./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
117 + || die "Generation of Grammar and PatternGrammar pickles failed"
118 +
119 + # Generate cffi modules
120 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
121 + #cffi_build_scripts = collections.OrderedDict([
122 + # ("_ctypes._ctypes_cffi",
123 + # "_ctypes/_ctypes_build.py" if sys.platform == 'darwin' else None),
124 + # ("_blake2", "_blake2/_blake2_build.py"),
125 + # ("_ssl", "_ssl_build.py"),
126 + # ("sqlite3", "_sqlite3_build.py"),
127 + # ("audioop", "_audioop_build.py"),
128 + # ("_tkinter", "_tkinter/tklib_build.py"),
129 + # ("curses", "_curses_build.py" if sys.platform != "win32" else None),
130 + # ("syslog", "_syslog_build.py" if sys.platform != "win32" else None),
131 + # ("_gdbm", "_gdbm_build.py" if sys.platform != "win32" else None),
132 + # ("grp", "_pwdgrp_build.py" if sys.platform != "win32" else None),
133 + # ("resource", "_resource_build.py" if sys.platform != "win32" else None),
134 + # ("lzma", "_lzma_build.py"),
135 + # # ("_decimal", "_decimal_build.py"), # issue 3024
136 + # ("_sha3", "_sha3/_sha3_build.py"),
137 + # ("xx", None), # for testing: 'None' should be completely ignored
138 + # ("_posixshmem", "_posixshmem_build.py" if sys.platform != "win32" else None),
139 + # ])
140 + cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
141 + audioop syslog pwdgrp resource lzma posixshmem )
142 + use gdbm && cffi_targets+=( gdbm )
143 + use ncurses && cffi_targets+=( curses )
144 + use sqlite && cffi_targets+=( sqlite3 )
145 + use tk && cffi_targets+=( tkinter/tklib )
146 +
147 + local t
148 + # all modules except tkinter output to .
149 + # tkinter outputs to the correct dir ...
150 + cd lib_pypy || die
151 + for t in "${cffi_targets[@]}"; do
152 + # tkinter doesn't work via -m
153 + ../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
154 + done
155 +
156 + # Cleanup temporary objects
157 + find -name "_cffi_*.[co]" -delete || die
158 + find -type d -empty -delete || die
159 +}
160 +
161 +src_test() {
162 + # (unset)
163 + local -x PYTHONDONTWRITEBYTECODE=
164 + local -x COLUMNS=80
165 +
166 + # Test runner requires Python 2 too. However, it spawns PyPy3
167 + # internally so that we end up testing the correct interpreter.
168 + # (--deselect for failing doctests)
169 + "${EPYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
170 +}
171 +
172 +src_install() {
173 + einfo "Installing PyPy ..."
174 + dodir /usr/bin
175 + dosym pypy3-c-${PYPY_PV} /usr/bin/pypy3
176 + insinto /usr/lib/pypy3.8
177 + # preserve mtimes to avoid obsoleting caches
178 + insopts -p
179 + doins -r lib_pypy lib-python/3/.
180 + insinto /usr/include
181 + doins -r include/pypy3.8
182 +
183 + # replace copied headers with symlinks
184 + for x in "${BROOT}"/usr/include/pypy3.8/${PYPY_PV}/*; do
185 + dosym "${PYPY_PV}/${x##*/}" "/usr/include/pypy3.8/${x##*/}"
186 + done
187 +
188 + dodoc README.rst
189 +
190 + local dest=/usr/lib/pypy3.8
191 + if ! use gdbm; then
192 + rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
193 + fi
194 + if ! use sqlite; then
195 + rm -r "${ED}${dest}"/sqlite3 \
196 + "${ED}${dest}"/lib_pypy/_sqlite3* \
197 + "${ED}${dest}"/test/test_sqlite.py || die
198 + fi
199 + if ! use tk; then
200 + rm -r "${ED}${dest}"/{idlelib,tkinter} \
201 + "${ED}${dest}"/lib_pypy/_tkinter \
202 + "${ED}${dest}"/test/test_{tcl,tk,ttk*}.py || die
203 + fi
204 +
205 + local -x EPYTHON=pypy3
206 + local -x PYTHON=${ED}/usr/bin/pypy3-c-${PYPY_PV}
207 + # temporarily copy to build tree to facilitate module builds
208 + cp -p "${BROOT}/usr/bin/pypy3-c-${PYPY_PV}" "${PYTHON}" || die
209 +
210 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
211 + python_moduleinto "${dest}"/site-packages
212 + python_domodule epython.py
213 +
214 + einfo "Byte-compiling Python standard library..."
215 + python_optimize "${ED}${dest}"
216 +
217 + # remove to avoid collisions
218 + rm "${PYTHON}" || die
219 +}