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