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, 30 Jul 2021 18:14:33
Message-Id: 1627668852.763f495cdba5277597f169070877c3d3cd2d4006.mgorny@gentoo
1 commit: 763f495cdba5277597f169070877c3d3cd2d4006
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 30 11:55:02 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 30 18:14:12 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=763f495c
7
8 dev-python/pypy: Bump to 7.3.5
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy/Manifest | 2 +
13 dev-python/pypy/pypy-7.3.5.ebuild | 160 ++++++++++++++++++++++++++++++++++++++
14 2 files changed, 162 insertions(+)
15
16 diff --git a/dev-python/pypy/Manifest b/dev-python/pypy/Manifest
17 index 49d50023057..8482c7a0c13 100644
18 --- a/dev-python/pypy/Manifest
19 +++ b/dev-python/pypy/Manifest
20 @@ -1,6 +1,8 @@
21 DIST pypy2.7-gentoo-patches-7.3.4.tar.xz 7844 BLAKE2B d06694fa085667e40ef8805c29f7ccf95b49f9de4e99e3ebfa3d69c4202a0ddcebb54c524d7d9f9ec67573a8d2ebe38fb7023d4d3ecef67afc907ecef5c16c02 SHA512 aa8ffefb5d30070ae86c1c14c55c277e39d3da66aea3a0951319158fb65e716e7fa7864e8bf5d26314d4b2a8030c766b63cad6a3663822d2875cd8cc1f3f2de5
22 DIST pypy2.7-gentoo-patches-7.3.4_p1.tar.xz 8880 BLAKE2B dbf76e26b38187aafc5d60ee6189148d6211624689d5c6151d9c77ea5d744774db1bdf7230f97da16623045525449eeefc9d6ead168d8fdb166593c203918601 SHA512 78ed998ec6b8f2ac4bdd381496477d5e337841b1d7da0e77bd39a4748d3dd1a08ac6353561ca618d4cade24d26756ff4c221459162bc532e6597b8e9c7cd8d62
23 +DIST pypy2.7-gentoo-patches-7.3.5.tar.xz 6928 BLAKE2B 41aff14411882e60102866a41de6a2c13983d5489c9ed928e2823714883b5cca289c093426fdec35b6df8d17de7a96528d799e10412a0f2f02563e152acf24ea SHA512 f12c1a414cf40e86e9d2a7d1cdfaaacc1045f8043da479b5270ef983ffcf01418a70bbd21ae740abf544091cdc5026bffe467d631242d5e9e0863a64fa8d026b
24 DIST pypy2.7-gentoo-patches-7.3.5rc3.tar.xz 5796 BLAKE2B b1c0fb0a8d86d117a9d4102777605eedd026b614f4b66272b3fc5da246bbe5edf516e95a40471117b61078c18b9fc615e55e0992a5d0a1be7caf9026ee26b6be SHA512 8699813837dfa4560a6e73b96f770c5d5999ce008e17cf62a856a454cb0b63146787a54934874162c79345488959e0936b3bd03823bc9f8e276f80df1122f7a8
25 DIST pypy2.7-gentoo-patches-7.3.5rc3_p1.tar.xz 6932 BLAKE2B 730c52170dc5b6e893dc8c500b0cfd6bbf84830a4813e808a6a091fcd521bf58496fbe66c93b3bfc19a9032be2fb14ed182542d0831a5fd7e862c3fcdb4f5faa SHA512 088dad634acfb052992d0c4a3c54ba0e7f227c86848c88a94e94d84a9f7447a552aafd5566f39af0918b6b4c9dd279da3c698d0d8c9d362bd5ba13aa3f4a4d27
26 DIST pypy2.7-v7.3.4-src.tar.bz2 21571561 BLAKE2B d0ac56fadec63fe7e65728c36c2aaf96fc5f54919dddbca9571a24c42a9e3e21f672f84555a18a384c4715f0489bd7aef009c0a47b635de88c472a93e2ae8d71 SHA512 4c18c2dbfbf0cc1034bea773828204df77aec7ef82119fb94e5cb762ce1783e00ad70e99d1432b4948dc132e726bdc6015f4a5bf10a5b10415bcfe99da2ecd17
27 +DIST pypy2.7-v7.3.5-src.tar.bz2 21572184 BLAKE2B 388b8623c2c5de839dea0e60acc5e11a6a774b4a6cdc051691053a97fe13ec12c6735a4be64015653ef420c0d8af2c79d8faa90a7dfc3042e29f35f4e1ded6c3 SHA512 a30c666c29eec7cca7e2e52f26480958b5885cd59c6b2e3d3c0d8c1cc55c298e878fc95f88e38a4297bb3d7d1cc1f77470de958e5acfd317e1fc8bdd5d013dcb
28 DIST pypy2.7-v7.3.5rc3-src.tar.bz2 21563312 BLAKE2B e343dcd617026ea5f951f3d24deeb59736c9a6ecc91d1b9c1bd980b6f3c239a5bf0edb9b72a0847a6aeeaead8aca9ecf537af81c9fcf0a2f6647c99edc0d1735 SHA512 e080771ea10a30820f8844b3f512a7681f2e619e8a37fa8ac60198f3c8c3780a8e08aa63749be375c00cd547994f428df44e2cd9f61b272b215ded433374e0a1
29
30 diff --git a/dev-python/pypy/pypy-7.3.5.ebuild b/dev-python/pypy/pypy-7.3.5.ebuild
31 new file mode 100644
32 index 00000000000..47c2d5b3530
33 --- /dev/null
34 +++ b/dev-python/pypy/pypy-7.3.5.ebuild
35 @@ -0,0 +1,160 @@
36 +# Copyright 1999-2021 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +
41 +inherit pax-utils python-utils-r1
42 +
43 +PYPY_PV=${PV%_p*}
44 +MY_P=pypy2.7-v${PYPY_PV/_}
45 +PATCHSET="pypy2.7-gentoo-patches-${PV/_}"
46 +
47 +DESCRIPTION="A fast, compliant alternative implementation of the Python 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 +# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
55 +SLOT="0/73"
56 +KEYWORDS=""
57 +IUSE="bzip2 gdbm +jit ncurses sqlite tk"
58 +
59 +RDEPEND="
60 + || (
61 + >=dev-python/pypy-exe-${PYPY_PV}:${PYPY_PV}[bzip2?,ncurses?]
62 + >=dev-python/pypy-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/pypy-bin-7.3.0:0"
72 +DEPEND="${RDEPEND}"
73 +
74 +src_prepare() {
75 + local PATCHES=(
76 + "${WORKDIR}/${PATCHSET}"
77 + )
78 + default
79 +
80 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
81 + -i lib-python/2.7/distutils/command/install.py || die
82 +}
83 +
84 +src_compile() {
85 + # copy over to make sys.prefix happy
86 + cp -p "${BROOT}"/usr/lib/pypy2.7/pypy-c-${PYPY_PV} pypy-c || die
87 + cp -p "${BROOT}"/usr/lib/pypy2.7/include/${PYPY_PV}/* include/ || die
88 + # (not installed by pypy)
89 + rm pypy/module/cpyext/include/_numpypy/numpy/README || die
90 + mv pypy/module/cpyext/include/* include/ || die
91 + mv pypy/module/cpyext/parse/*.h include/ || die
92 + pax-mark m pypy-c
93 +
94 + einfo "Generating caches and CFFI modules ..."
95 +
96 + # Generate Grammar and PatternGrammar pickles.
97 + ./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
98 + || die "Generation of Grammar and PatternGrammar pickles failed"
99 +
100 + # Generate cffi modules
101 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
102 +#cffi_build_scripts = {
103 +# "_ssl": "_ssl_build.py",
104 +# "sqlite3": "_sqlite3_build.py",
105 +# "audioop": "_audioop_build.py",
106 +# "tk": "_tkinter/tklib_build.py",
107 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
108 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
109 +# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
110 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
111 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
112 + cffi_targets=( ssl audioop syslog pwdgrp resource )
113 + use gdbm && cffi_targets+=( gdbm )
114 + use ncurses && cffi_targets+=( curses )
115 + use sqlite && cffi_targets+=( sqlite3 )
116 + use tk && cffi_targets+=( tkinter/tklib )
117 +
118 + local t
119 + # all modules except tkinter output to .
120 + # tkinter outputs to the correct dir ...
121 + cd lib_pypy || die
122 + for t in "${cffi_targets[@]}"; do
123 + # tkinter doesn't work via -m
124 + ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
125 + done
126 +
127 + # Cleanup temporary objects
128 + find -name "_cffi_*.[co]" -delete || die
129 + find -type d -empty -delete || die
130 +}
131 +
132 +src_test() {
133 + # (unset)
134 + local -x PYTHONDONTWRITEBYTECODE=
135 + local -x COLUMNS=80
136 +
137 + local ignored_tests=(
138 + # network
139 + --ignore=lib-python/2.7/test/test_urllibnet.py
140 + --ignore=lib-python/2.7/test/test_urllib2net.py
141 + # lots of free space
142 + --ignore=lib-python/2.7/test/test_zipfile64.py
143 + )
144 +
145 + ./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
146 + "${ignored_tests[@]}" lib-python || die
147 +}
148 +
149 +src_install() {
150 + local dest=/usr/lib/pypy2.7
151 + einfo "Installing PyPy ..."
152 + dosym pypy-c-${PYPY_PV} "${dest}/pypy-c"
153 + insinto "${dest}"
154 + # preserve mtimes to avoid obsoleting caches
155 + insopts -p
156 + doins -r include lib_pypy lib-python
157 +
158 + # replace copied headers with symlinks
159 + for x in "${BROOT}"/usr/lib/pypy2.7/include/${PYPY_PV}/*; do
160 + dosym "${PYPY_PV}/${x##*/}" "${dest}/include/${x##*/}"
161 + done
162 +
163 + dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
164 + dodoc README.rst
165 +
166 + if ! use gdbm; then
167 + rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
168 + "${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
169 + fi
170 + if ! use sqlite; then
171 + rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
172 + "${ED}${dest}"/lib_pypy/_sqlite3.py \
173 + "${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
174 + fi
175 + if ! use tk; then
176 + rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
177 + "${ED}${dest}"/lib_pypy/_tkinter \
178 + "${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
179 + fi
180 +
181 + local -x EPYTHON=pypy
182 + local -x PYTHON=${ED}${dest}/pypy-c-${PYPY_PV}
183 + # temporarily copy to build tree to facilitate module builds
184 + cp -p "${BROOT}${dest}/pypy-c-${PYPY_PV}" "${PYTHON}" || die
185 +
186 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
187 + python_moduleinto /usr/lib/pypy2.7/site-packages
188 + python_domodule epython.py
189 +
190 + einfo "Byte-compiling Python standard library..."
191 + python_optimize "${ED}${dest}"
192 +
193 + # remove to avoid collisions
194 + rm "${PYTHON}" || die
195 +}