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: Mon, 27 Feb 2023 05:50:47
Message-Id: 1677476466.240a66e2253f04c8938fc83abeed93a8d57ed161.mgorny@gentoo
1 commit: 240a66e2253f04c8938fc83abeed93a8d57ed161
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 27 05:41:06 2023 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 27 05:41:06 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=240a66e2
7
8 dev-python/pypy3: Remove old
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.11-r1.ebuild | 205 --------------------------------
14 2 files changed, 206 deletions(-)
15
16 diff --git a/dev-python/pypy3/Manifest b/dev-python/pypy3/Manifest
17 index c6ec081e1ddd..ebda7445a38c 100644
18 --- a/dev-python/pypy3/Manifest
19 +++ b/dev-python/pypy3/Manifest
20 @@ -1,3 +1,2 @@
21 -DIST pypy3.9-gentoo-patches-7.3.11.tar.xz 6444 BLAKE2B adcc1ae4c3ae2c5317a05d6de51785945625d8bcc7cb35bd6608fa80f09b37c483c95663eacb0353013a5abec308d25b12666699c65512f5f3a6d7345f2b5b18 SHA512 f2064ecffa09ba23f5f8c281ca4c8c0740cb6b57185d66c02eec2bcb77cfb566b1a2db4f52c472bcaf0d5fb759ee8003b27761af37785d12465c2010fd73c49d
22 DIST pypy3.9-gentoo-patches-7.3.11_p1.tar.xz 7480 BLAKE2B ffb478402e82244af25dd67bb9e21abb4bb186d98495899f8ca8f323bdf27a77356e40efd33217a5238ef86f6156fc7d85c681a747ea5a35bd73bab659972986 SHA512 6c3ee21b51145907c2434f740e9849ac02ad83203fdcb2802b97ba199f37d08297d8016f659069bea3f0854ace30aefb947af4f057cbc91332106d9fc1389cf4
23 DIST pypy3.9-v7.3.11-src.tar.bz2 23460769 BLAKE2B fa8a827c28813243926c8689addb008c0a43acdc3f81a18749a8f2c1926b6294f2c0c95a4c315e3b77ce84b4f337af7a0bce5daf8dcb60ead965532d4af183cb SHA512 33c978ffbeeb39453028d1d1646ccfdace062ce48a5d939245bea41643038dd3687e80e34f88fa0622bcb175d7dd78f75cbe36b24229c8052f09d2d17dcdfd8c
24
25 diff --git a/dev-python/pypy3/pypy3-7.3.11-r1.ebuild b/dev-python/pypy3/pypy3-7.3.11-r1.ebuild
26 deleted file mode 100644
27 index e64e9730f17b..000000000000
28 --- a/dev-python/pypy3/pypy3-7.3.11-r1.ebuild
29 +++ /dev/null
30 @@ -1,205 +0,0 @@
31 -# Copyright 1999-2023 Gentoo Authors
32 -# Distributed under the terms of the GNU General Public License v2
33 -
34 -EAPI=8
35 -
36 -inherit pax-utils python-utils-r1 toolchain-funcs
37 -
38 -PYPY_PV=${PV%_p*}
39 -MY_P=pypy3.9-v${PYPY_PV/_rc/rc}
40 -PATCHSET="pypy3.9-gentoo-patches-${PV/_rc/rc}"
41 -
42 -DESCRIPTION="A fast, compliant alternative implementation of the Python (3.9) language"
43 -HOMEPAGE="
44 - https://www.pypy.org/
45 - https://foss.heptapod.net/pypy/pypy/
46 -"
47 -SRC_URI="
48 - https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2
49 - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
50 -"
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/pypy39-pp73-336"
57 -KEYWORDS="amd64 ~arm64 ~ppc64 x86 ~amd64-linux ~x86-linux"
58 -IUSE="+ensurepip gdbm +jit ncurses sqlite tk"
59 -# many tests are failing upstream
60 -# see https://buildbot.pypy.org/summary?branch=py3.9
61 -RESTRICT="test"
62 -
63 -RDEPEND="
64 - || (
65 - >=dev-python/pypy3-exe-${PYPY_PV}:3.9-${PYPY_PV}[bzip2(+),ncurses?]
66 - >=dev-python/pypy3-exe-bin-${PYPY_PV}:3.9-${PYPY_PV}
67 - )
68 - dev-lang/python-exec[python_targets_pypy3(-)]
69 - dev-libs/openssl:0=
70 - dev-python/gentoo-common
71 - ensurepip? ( dev-python/ensurepip-wheels )
72 - gdbm? ( sys-libs/gdbm:0= )
73 - sqlite? ( dev-db/sqlite:3= )
74 - tk? (
75 - dev-lang/tk:0=
76 - dev-tcltk/tix:0=
77 - )
78 -"
79 -DEPEND="
80 - ${RDEPEND}
81 -"
82 -
83 -src_prepare() {
84 - local PATCHES=(
85 - "${WORKDIR}/${PATCHSET}"
86 - )
87 - default
88 -
89 - eapply_user
90 -}
91 -
92 -src_configure() {
93 - tc-export CC
94 -}
95 -
96 -src_compile() {
97 - mkdir bin || die
98 - # switch to the layout expected for cffi module builds
99 - mkdir include/pypy3.9 || die
100 - # copy over to make sys.prefix happy
101 - cp -p "${BROOT}"/usr/bin/pypy3.9-c-${PYPY_PV} pypy3.9-c || die
102 - cp -p "${BROOT}"/usr/include/pypy3.9/${PYPY_PV}/* include/pypy3.9/ || 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.9/ || die
106 - mv pypy/module/cpyext/parse/*.h include/pypy3.9/ || die
107 - pax-mark m pypy3.9-c
108 -
109 - # verify the subslot
110 - local soabi=$(
111 - ./pypy3.9-c - <<-EOF
112 - import importlib.util
113 - import sysconfig
114 - soabi = sysconfig.get_config_var("SOABI")
115 - magic = importlib.util._RAW_MAGIC_NUMBER & 0xffff
116 - print(f"{soabi}-{magic}")
117 - EOF
118 - )
119 - [[ ${soabi} == ${SLOT#*/} ]] || die "update subslot to ${soabi}"
120 -
121 - # Add epython.py to the distribution
122 - echo 'EPYTHON="pypy3"' > lib-python/3/epython.py || die
123 -
124 - einfo "Generating caches and CFFI modules ..."
125 -
126 - # Generate sysconfig data
127 - local host_gnu_type=$(sh pypy/tool/release/config.guess)
128 - local overrides=(
129 - HOST_GNU_TYPE "${host_gnu_type:-unknown}"
130 - INCLUDEPY "${EPREFIX}/usr/include/pypy3.9"
131 - LIBDIR "${EPREFIX}/usr/$(get_libdir)"
132 - TZPATH "${EPREFIX}/usr/share/zoneinfo"
133 - WHEEL_PKG_DIR "${EPREFIX}/usr/lib/python/ensurepip"
134 - )
135 - ./pypy3.9-c -m sysconfig --generate-posix-vars "${overrides[@]}" || die
136 - local outdir
137 - outdir=$(<pybuilddir.txt) || die
138 - cp "${outdir}"/_sysconfigdata__*.py lib-python/3/ || die
139 -
140 - # Generate Grammar and PatternGrammar pickles.
141 - ./pypy3.9-c - <<-EOF || die "Generation of Grammar and PatternGrammar pickles failed"
142 - import lib2to3.pygram
143 - import lib2to3.patcomp
144 - lib2to3.patcomp.PatternCompiler()
145 - EOF
146 -
147 - # Generate cffi modules
148 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
149 - # (NB: we build CFFI modules first to avoid error log when importing
150 - # build_cffi_imports).
151 - cffi_targets=( pypy_util blake2/_blake2 sha3/_sha3 ssl
152 - audioop syslog pwdgrp resource lzma posixshmem )
153 - use gdbm && cffi_targets+=( gdbm )
154 - use ncurses && cffi_targets+=( curses )
155 - use sqlite && cffi_targets+=( sqlite3 )
156 - use tk && cffi_targets+=( tkinter/tklib )
157 -
158 - local t
159 - # all modules except tkinter output to .
160 - # tkinter outputs to the correct dir ...
161 - cd lib_pypy || die
162 - for t in "${cffi_targets[@]}"; do
163 - # tkinter doesn't work via -m
164 - ../pypy3.9-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
165 - done
166 -
167 - # Verify that CFFI module list is up-to-date
168 - local expected_cksum=63d4659f
169 - local local_cksum=$(
170 - ../pypy3.9-c - <<-EOF
171 - import binascii
172 - import json
173 - from pypy_tools.build_cffi_imports import cffi_build_scripts as x
174 - print("%08x" % (binascii.crc32(json.dumps(x).encode()),))
175 - EOF
176 - )
177 - if [[ ${local_cksum} != ${expected_cksum} ]]; then
178 - die "Please verify cffi_targets and update checksum to ${local_cksum}"
179 - fi
180 -
181 - # Cleanup temporary objects
182 - find -name "*_cffi.[co]" -delete || die
183 - find -type d -empty -delete || die
184 -}
185 -
186 -src_install() {
187 - einfo "Installing PyPy ..."
188 - dodir /usr/bin
189 - dosym pypy3.9-c-${PYPY_PV} /usr/bin/pypy3.9
190 - dosym pypy3.9 /usr/bin/pypy3
191 - insinto /usr/lib/pypy3.9
192 - # preserve mtimes to avoid obsoleting caches
193 - insopts -p
194 - doins -r lib-python/3/. lib_pypy/.
195 - insinto /usr/include
196 - doins -r include/pypy3.9
197 -
198 - # replace copied headers with symlinks
199 - for x in "${BROOT}"/usr/include/pypy3.9/${PYPY_PV}/*; do
200 - dosym "${PYPY_PV}/${x##*/}" "/usr/include/pypy3.9/${x##*/}"
201 - done
202 -
203 - dodoc README.rst
204 -
205 - local dest=/usr/lib/pypy3.9
206 - rm -r "${ED}${dest}"/ensurepip/_bundled || die
207 - if ! use ensurepip; then
208 - rm -r "${ED}${dest}"/ensurepip || die
209 - fi
210 - if ! use gdbm; then
211 - rm -r "${ED}${dest}"/_gdbm* || die
212 - fi
213 - if ! use sqlite; then
214 - rm -r "${ED}${dest}"/sqlite3 \
215 - "${ED}${dest}"/_sqlite3* \
216 - "${ED}${dest}"/test/test_sqlite.py || die
217 - fi
218 - if ! use tk; then
219 - rm -r "${ED}${dest}"/{idlelib,tkinter} \
220 - "${ED}${dest}"/_tkinter \
221 - "${ED}${dest}"/test/test_{tcl,tk,ttk*}.py || die
222 - fi
223 - dosym ../python/EXTERNALLY-MANAGED "${dest}/EXTERNALLY-MANAGED"
224 -
225 - local -x EPYTHON=pypy3
226 - local -x PYTHON=${ED}/usr/bin/pypy3.9-c-${PYPY_PV}
227 - # temporarily copy to build tree to facilitate module builds
228 - cp -p "${BROOT}/usr/bin/pypy3.9-c-${PYPY_PV}" "${PYTHON}" || die
229 -
230 - einfo "Byte-compiling Python standard library..."
231 - python_optimize "${ED}${dest}"
232 -
233 - # remove to avoid collisions
234 - rm "${PYTHON}" || die
235 -}