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, 30 Dec 2019 11:59:05
Message-Id: 1577707069.3ccfb193c13f3ce898add0dcbca466a3d8c33b50.mgorny@gentoo
1 commit: 3ccfb193c13f3ce898add0dcbca466a3d8c33b50
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 30 11:03:00 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 30 11:57:49 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ccfb193
7
8 dev-python/pypy: Remove the live ebuild
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy/pypy-9999.ebuild | 293 ---------------------------------------
13 1 file changed, 293 deletions(-)
14
15 diff --git a/dev-python/pypy/pypy-9999.ebuild b/dev-python/pypy/pypy-9999.ebuild
16 deleted file mode 100644
17 index a6955da9367..00000000000
18 --- a/dev-python/pypy/pypy-9999.ebuild
19 +++ /dev/null
20 @@ -1,293 +0,0 @@
21 -# Copyright 1999-2019 Gentoo Authors
22 -# Distributed under the terms of the GNU General Public License v2
23 -
24 -EAPI=7
25 -
26 -PYTHON_COMPAT=( python2_7 pypy )
27 -EHG_REPO_URI="https://bitbucket.org/pypy/pypy"
28 -inherit check-reqs mercurial pax-utils python-any-r1 toolchain-funcs
29 -
30 -# note: remember to update this to newest dev-lang/python:2.7 on bump
31 -CPY_PATCHSET_VERSION="2.7.15"
32 -MY_P=pypy2.7-v${PV}
33 -
34 -DESCRIPTION="A fast, compliant alternative implementation of the Python language"
35 -HOMEPAGE="https://pypy.org/"
36 -SRC_URI="
37 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${CPY_PATCHSET_VERSION}.tar.xz"
38 -
39 -LICENSE="MIT"
40 -# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
41 -# pypy 7.0.0: install directory changed to 'pypy2.7'
42 -SLOT="0/41-py27"
43 -KEYWORDS=""
44 -IUSE="bzip2 gdbm +jit libressl low-memory ncurses sandbox sqlite cpu_flags_x86_sse2 tk"
45 -
46 -RDEPEND=">=sys-libs/zlib-1.1.3:0=
47 - virtual/libffi:0=
48 - virtual/libintl:0=
49 - dev-libs/expat:0=
50 - !libressl? ( dev-libs/openssl:0= )
51 - libressl? ( dev-libs/libressl:0= )
52 - bzip2? ( app-arch/bzip2:0= )
53 - gdbm? ( sys-libs/gdbm:0= )
54 - ncurses? ( sys-libs/ncurses:0= )
55 - sqlite? ( dev-db/sqlite:3= )
56 - tk? (
57 - dev-lang/tk:0=
58 - dev-tcltk/tix:0=
59 - )
60 - !dev-python/pypy-bin:0"
61 -# don't enforce the dep on pypy with USE=low-memory since it's going
62 -# to cause either collisions or circular dep on itself
63 -DEPEND="${RDEPEND}
64 - !low-memory? (
65 - || (
66 - dev-python/pypy
67 - dev-python/pypy-bin
68 - (
69 - dev-lang/python:2.7
70 - dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
71 - )
72 - )
73 - )"
74 -
75 -S="${WORKDIR}/${MY_P}-src"
76 -
77 -check_env() {
78 - if use low-memory; then
79 - if ! python_is_installed pypy; then
80 - eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
81 - eerror "or dev-python/pypy-bin being installed. Please install it using e.g.:"
82 - eerror
83 - eerror " $ emerge -1v dev-python/pypy-bin"
84 - eerror
85 - eerror "before attempting to build dev-python/pypy[low-memory]."
86 - die "dev-python/pypy-bin (or dev-python/pypy) needs to be installed for USE=low-memory"
87 - fi
88 -
89 - CHECKREQS_MEMORY="1750M"
90 - use amd64 && CHECKREQS_MEMORY="3500M"
91 - else
92 - CHECKREQS_MEMORY="3G"
93 - use amd64 && CHECKREQS_MEMORY="6G"
94 - fi
95 -
96 - check-reqs_pkg_pretend
97 -}
98 -
99 -pkg_pretend() {
100 - [[ ${MERGE_TYPE} != binary ]] && check_env
101 -}
102 -
103 -pkg_setup() {
104 - if [[ ${MERGE_TYPE} != binary ]]; then
105 - check_env
106 -
107 - if python_is_installed pypy; then
108 - if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] || use low-memory; then
109 - einfo "Using already-installed PyPy to perform the translation."
110 - local EPYTHON=pypy
111 - else
112 - einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
113 - einfo "recommends using PyPy for that. If you wish to do so, please unset"
114 - einfo "the EPYTHON variable."
115 - fi
116 - fi
117 -
118 - python-any-r1_pkg_setup
119 - fi
120 -}
121 -
122 -src_unpack() {
123 - default
124 - mercurial_src_unpack
125 -}
126 -
127 -src_prepare() {
128 - eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
129 - eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
130 - eapply "${FILESDIR}"/5.9.0-shared-lib.patch # 517002
131 -
132 - sed -e "s^@EPREFIX@^${EPREFIX}^" \
133 - -i lib-python/2.7/distutils/command/install.py || die
134 -
135 - # apply CPython stdlib patches
136 - pushd lib-python/2.7 > /dev/null || die
137 - # TODO: cpy turkish locale patch now fixes C code
138 - # probably needs better port to pypy, if it is broken there
139 - eapply "${FILESDIR}"/5.8.0_all_distutils_cxx.patch
140 - eapply -p2 "${WORKDIR}"/patches/0011-use_pyxml.patch
141 - popd > /dev/null || die
142 -
143 - eapply_user
144 -}
145 -
146 -src_configure() {
147 - tc-export CC
148 -
149 - local jit_backend
150 - if use jit; then
151 - jit_backend='--jit-backend='
152 -
153 - # We only need the explicit sse2 switch for x86.
154 - # On other arches we can rely on autodetection which uses
155 - # compiler macros. Plus, --jit-backend= doesn't accept all
156 - # the modern values...
157 -
158 - if use x86; then
159 - if use cpu_flags_x86_sse2; then
160 - jit_backend+=x86
161 - else
162 - jit_backend+=x86-without-sse2
163 - fi
164 - else
165 - jit_backend+=auto
166 - fi
167 - fi
168 -
169 - local args=(
170 - --shared
171 - $(usex jit -Ojit -O2)
172 - $(usex sandbox --sandbox '')
173 -
174 - ${jit_backend}
175 -
176 - pypy/goal/targetpypystandalone
177 - )
178 -
179 - # Avoid linking against libraries disabled by use flags
180 - local opts=(
181 - bzip2:bz2
182 - ncurses:_minimal_curses
183 - )
184 -
185 - local opt
186 - for opt in "${opts[@]}"; do
187 - local flag=${opt%:*}
188 - local mod=${opt#*:}
189 -
190 - args+=(
191 - $(usex ${flag} --withmod --withoutmod)-${mod}
192 - )
193 - done
194 -
195 - local interp=( "${PYTHON}" )
196 - if use low-memory; then
197 - interp=( env PYPY_GC_MAX_DELTA=200MB
198 - "${PYTHON}" --jit loop_longevity=300 )
199 - fi
200 -
201 - # translate into the C sources
202 - # we're going to make them ourselves since otherwise pypy does not
203 - # free up the unneeded memory before spawning the compiler
204 - set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
205 - echo -e "\033[1m${@}\033[0m"
206 - "${@}" || die "translation failed"
207 -}
208 -
209 -src_compile() {
210 - emake -C "${T}"/usession*-0/testing_1
211 -
212 - # copy back to make sys.prefix happy
213 - cp -p "${T}"/usession*-0/testing_1/{pypy-c,libpypy-c.so} . || die
214 - pax-mark m pypy-c libpypy-c.so
215 -
216 - einfo "Generating caches and CFFI modules ..."
217 -
218 - # Generate Grammar and PatternGrammar pickles.
219 - ./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
220 - || die "Generation of Grammar and PatternGrammar pickles failed"
221 -
222 - # Generate cffi modules
223 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
224 -#cffi_build_scripts = {
225 -# "_ssl": "_ssl_build.py",
226 -# "sqlite3": "_sqlite3_build.py",
227 -# "audioop": "_audioop_build.py",
228 -# "tk": "_tkinter/tklib_build.py",
229 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
230 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
231 -# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
232 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
233 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
234 - cffi_targets=( ssl audioop syslog pwdgrp resource )
235 - use gdbm && cffi_targets+=( gdbm )
236 - use ncurses && cffi_targets+=( curses )
237 - use sqlite && cffi_targets+=( sqlite3 )
238 - use tk && cffi_targets+=( tkinter/tklib )
239 -
240 - local t
241 - # all modules except tkinter output to .
242 - # tkinter outputs to the correct dir ...
243 - cd lib_pypy || die
244 - for t in "${cffi_targets[@]}"; do
245 - # tkinter doesn't work via -m
246 - ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
247 - done
248 -
249 - # Cleanup temporary objects
250 - find -name "_cffi_*.[co]" -delete || die
251 - find -type d -empty -delete || die
252 -}
253 -
254 -src_test() {
255 - # (unset)
256 - local -x PYTHONDONTWRITEBYTECODE=
257 -
258 - local ignored_tests=(
259 - # network
260 - --ignore=lib-python/2.7/test/test_urllibnet.py
261 - --ignore=lib-python/2.7/test/test_urllib2net.py
262 - # lots of free space
263 - --ignore=lib-python/2.7/test/test_zipfile64.py
264 - # no module named 'worker' -- a lot
265 - --ignore=lib-python/2.7/test/test_xpickle.py
266 - )
267 -
268 - ./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
269 - "${ignored_tests[@]}" lib-python || die
270 -}
271 -
272 -src_install() {
273 - local dest=/usr/lib/pypy2.7
274 - einfo "Installing PyPy ..."
275 - exeinto "${dest}"
276 - doexe pypy-c libpypy-c.so
277 - pax-mark m "${ED}${dest}/pypy-c" "${ED}${dest}/libpypy-c.so"
278 - insinto "${dest}"
279 - # preserve mtimes to avoid obsoleting caches
280 - insopts -p
281 - doins -r include lib_pypy lib-python
282 - dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
283 - dodoc README.rst
284 -
285 - if ! use gdbm; then
286 - rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
287 - "${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
288 - fi
289 - if ! use sqlite; then
290 - rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
291 - "${ED}${dest}"/lib_pypy/_sqlite3.py \
292 - "${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
293 - fi
294 - if ! use tk; then
295 - rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
296 - "${ED}${dest}"/lib_pypy/_tkinter \
297 - "${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
298 - fi
299 -
300 - local -x PYTHON=${ED}${dest}/pypy-c
301 - # we can't use eclass function since PyPy is dumb and always gives
302 - # paths relative to the interpreter
303 - local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy2.7/site-packages
304 - python_export pypy EPYTHON
305 -
306 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
307 - python_domodule epython.py
308 -
309 - einfo "Byte-compiling Python standard library..."
310 -
311 - # compile the installed modules
312 - python_optimize "${ED}${dest}"
313 -}