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/, dev-python/pypy/files/
Date: Mon, 30 Dec 2019 11:59:05
Message-Id: 1577707070.684285a764b2a88522fcdccd684c85b88f17ce8a.mgorny@gentoo
1 commit: 684285a764b2a88522fcdccd684c85b88f17ce8a
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 30 11:03:23 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 30 11:57:50 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=684285a7
7
8 dev-python/pypy: Remove old
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy/Manifest | 3 -
13 dev-python/pypy/files/5.9.0-shared-lib.patch | 12 --
14 dev-python/pypy/metadata.xml | 3 -
15 dev-python/pypy/pypy-7.2.0.ebuild | 287 ---------------------------
16 dev-python/pypy/pypy-7.3.0_rc1.ebuild | 286 --------------------------
17 5 files changed, 591 deletions(-)
18
19 diff --git a/dev-python/pypy/Manifest b/dev-python/pypy/Manifest
20 index b4e2427cda1..4facc6d4316 100644
21 --- a/dev-python/pypy/Manifest
22 +++ b/dev-python/pypy/Manifest
23 @@ -1,5 +1,2 @@
24 -DIST pypy2.7-v7.2.0-src.tar.bz2 20219532 BLAKE2B 225e2cebdfa3ceb310f2a047b1d9e1d375b181c10707822890f39fc0a5ec9e6ddd7a8cf6e073074067960b766a0a813294042513a08b8e7e02b011f612e17917 SHA512 8f724490f9fa06686c8e25ddd3592b260bbffae460395de4c7d29d983780ce9b8925fa87434aac6446aac2034381cc1a13074faf252f5d1ac466a252f219f1ae
25 DIST pypy2.7-v7.3.0-src.tar.bz2 20328540 BLAKE2B 7f71c98f436f11e8f4d248b6aeb3e2f81962cdeeaf3eb534473f1c6b5e8cd37d9abc047d7fa750a1ceeeaa63fab6eff6e5f1e60394b8104bbcd7e1fc47885c61 SHA512 05f039f090d837a72012db55f23d94da3f21c7458f18bd1e8ba632489248eb6486ced07b786d05e573abf2b3def2a68d96e7e1109e6d189d8e6c303c60ee3535
26 -DIST pypy2.7-v7.3.0rc1-src.tar.bz2 20416611 BLAKE2B acb971ec6db423d32aba9691672ff04257d4188d73852577a924305238ac16c71370e23e4a8da38b309e3e280baeb58cfa21a94a5b7252c0a1e54db5fd27dd2b SHA512 f24de1766da15cdf98333c8ac1942c14ab1990de23df2910c2cb0e63f65bcd1c72545f6c9913175aea53a17e9a65dd302a80fd3d424665c99c372fb6bd179807
27 -DIST python-gentoo-patches-2.7.15.tar.xz 16208 BLAKE2B 5739c2b3a236d48f8e33f0fe6515bfe7a8f99096f6223b402653988feac2513d37d26b6e40e5e049852f42657358170e468ca60097e0e2294e760787c12ad591 SHA512 687fd008d1d41b1e65ce5417f6f6aba84ffd42f7af44ef97c03a7806b28e6888f8df043a0c15187a8b229cc17642853e6feb25494db97f4d10f8a66f8ebcbcca
28 DIST python-gentoo-patches-2.7.17.tar.xz 13476 BLAKE2B 788688e2941d2d6d4f768168881b2c3639213a97e214557b3a93f8db44d81e2b6d70be847b7462e54e3786660ebee4ee331402081d92167d74ad149279c3f389 SHA512 1641737635d33607a77ed2ee2462854cec603be39737de3f81abb188702aaf46f039d1616f9dcd413da1f4a8040175c66a2883e496132c2e4ebe8f860b36f9f1
29
30 diff --git a/dev-python/pypy/files/5.9.0-shared-lib.patch b/dev-python/pypy/files/5.9.0-shared-lib.patch
31 deleted file mode 100644
32 index 5d89d3b15a3..00000000000
33 --- a/dev-python/pypy/files/5.9.0-shared-lib.patch
34 +++ /dev/null
35 @@ -1,12 +0,0 @@
36 -diff -dupr a/rpython/translator/platform/posix.py b/rpython/translator/platform/posix.py
37 ---- a/rpython/translator/platform/posix.py 2017-10-05 20:17:25.009954656 +0200
38 -+++ b/rpython/translator/platform/posix.py 2017-10-05 20:17:31.115666386 +0200
39 -@@ -227,7 +227,7 @@ class BasePosix(Platform):
40 - 'int main(int argc, char* argv[]) '
41 - '{ return $(PYPY_MAIN_FUNCTION)(argc, argv); }" > $@')
42 - m.rule('$(DEFAULT_TARGET)', ['$(TARGET)', 'main.o'],
43 -- ['$(CC_LINK) $(LDFLAGS_LINK) main.o -L. -l$(SHARED_IMPORT_LIB) -o $@ $(RPATH_FLAGS)', '$(MAKE) postcompile BIN=$(DEFAULT_TARGET)'])
44 -+ ['$(CC_LINK) $(LDFLAGS_LINK) main.o -L. -l$(SHARED_IMPORT_LIB) \'-Wl,-rpath,$$ORIGIN\' -o $@', '$(MAKE) postcompile BIN=$(DEFAULT_TARGET)'])
45 -
46 - return m
47 -
48
49 diff --git a/dev-python/pypy/metadata.xml b/dev-python/pypy/metadata.xml
50 index 89f86a0b2be..fa323d0cd24 100644
51 --- a/dev-python/pypy/metadata.xml
52 +++ b/dev-python/pypy/metadata.xml
53 @@ -6,9 +6,6 @@
54 <name>Python</name>
55 </maintainer>
56 <use>
57 - <flag name="low-memory">Build using PyPy with the engine configured towards low memory footprint.
58 - This makes it possible to build PyPy using ~3.5G of RAM on amd64 and ~half of that on x86,
59 - at the cost of lengthened build time.</flag>
60 <flag name="sandbox">Enable sandboxing functionality</flag>
61 </use>
62 <upstream>
63
64 diff --git a/dev-python/pypy/pypy-7.2.0.ebuild b/dev-python/pypy/pypy-7.2.0.ebuild
65 deleted file mode 100644
66 index 87c098986b3..00000000000
67 --- a/dev-python/pypy/pypy-7.2.0.ebuild
68 +++ /dev/null
69 @@ -1,287 +0,0 @@
70 -# Copyright 1999-2019 Gentoo Authors
71 -# Distributed under the terms of the GNU General Public License v2
72 -
73 -EAPI=7
74 -
75 -PYTHON_COMPAT=( python2_7 pypy )
76 -inherit check-reqs pax-utils python-any-r1 toolchain-funcs
77 -
78 -# note: remember to update this to newest dev-lang/python:2.7 on bump
79 -CPY_PATCHSET_VERSION="2.7.15"
80 -MY_P=pypy2.7-v${PV}
81 -
82 -DESCRIPTION="A fast, compliant alternative implementation of the Python language"
83 -HOMEPAGE="https://pypy.org/"
84 -SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2
85 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${CPY_PATCHSET_VERSION}.tar.xz"
86 -
87 -LICENSE="MIT"
88 -# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
89 -# pypy 7.0.0: install directory changed to 'pypy2.7'
90 -SLOT="0/41-py27"
91 -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
92 -IUSE="bzip2 gdbm +jit libressl low-memory ncurses sandbox sqlite cpu_flags_x86_sse2 tk"
93 -
94 -RDEPEND=">=sys-libs/zlib-1.1.3:0=
95 - virtual/libffi:0=
96 - virtual/libintl:0=
97 - dev-libs/expat:0=
98 - !libressl? ( dev-libs/openssl:0= )
99 - libressl? ( dev-libs/libressl:0= )
100 - bzip2? ( app-arch/bzip2:0= )
101 - gdbm? ( sys-libs/gdbm:0= )
102 - ncurses? ( sys-libs/ncurses:0= )
103 - sqlite? ( dev-db/sqlite:3= )
104 - tk? (
105 - dev-lang/tk:0=
106 - dev-tcltk/tix:0=
107 - )
108 - !dev-python/pypy-bin:0"
109 -# don't enforce the dep on pypy with USE=low-memory since it's going
110 -# to cause either collisions or circular dep on itself
111 -DEPEND="${RDEPEND}
112 - !low-memory? (
113 - || (
114 - dev-python/pypy
115 - dev-python/pypy-bin
116 - (
117 - dev-lang/python:2.7
118 - dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
119 - )
120 - )
121 - )"
122 -
123 -S="${WORKDIR}/${MY_P}-src"
124 -
125 -check_env() {
126 - if use low-memory; then
127 - if ! python_is_installed pypy; then
128 - eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
129 - eerror "or dev-python/pypy-bin being installed. Please install it using e.g.:"
130 - eerror
131 - eerror " $ emerge -1v dev-python/pypy-bin"
132 - eerror
133 - eerror "before attempting to build dev-python/pypy[low-memory]."
134 - die "dev-python/pypy-bin (or dev-python/pypy) needs to be installed for USE=low-memory"
135 - fi
136 -
137 - CHECKREQS_MEMORY="1750M"
138 - use amd64 && CHECKREQS_MEMORY="3500M"
139 - else
140 - CHECKREQS_MEMORY="3G"
141 - use amd64 && CHECKREQS_MEMORY="6G"
142 - fi
143 -
144 - check-reqs_pkg_pretend
145 -}
146 -
147 -pkg_pretend() {
148 - [[ ${MERGE_TYPE} != binary ]] && check_env
149 -}
150 -
151 -pkg_setup() {
152 - if [[ ${MERGE_TYPE} != binary ]]; then
153 - check_env
154 -
155 - if python_is_installed pypy; then
156 - if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] || use low-memory; then
157 - einfo "Using already-installed PyPy to perform the translation."
158 - local EPYTHON=pypy
159 - else
160 - einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
161 - einfo "recommends using PyPy for that. If you wish to do so, please unset"
162 - einfo "the EPYTHON variable."
163 - fi
164 - fi
165 -
166 - python-any-r1_pkg_setup
167 - fi
168 -}
169 -
170 -src_prepare() {
171 - eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
172 - eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
173 - eapply "${FILESDIR}"/5.9.0-shared-lib.patch # 517002
174 -
175 - sed -e "s^@EPREFIX@^${EPREFIX}^" \
176 - -i lib-python/2.7/distutils/command/install.py || die
177 -
178 - # apply CPython stdlib patches
179 - pushd lib-python/2.7 > /dev/null || die
180 - # TODO: cpy turkish locale patch now fixes C code
181 - # probably needs better port to pypy, if it is broken there
182 - eapply "${FILESDIR}"/5.8.0_all_distutils_cxx.patch
183 - eapply -p2 "${WORKDIR}"/patches/0011-use_pyxml.patch
184 - popd > /dev/null || die
185 -
186 - eapply_user
187 -}
188 -
189 -src_configure() {
190 - tc-export CC
191 -
192 - local jit_backend
193 - if use jit; then
194 - jit_backend='--jit-backend='
195 -
196 - # We only need the explicit sse2 switch for x86.
197 - # On other arches we can rely on autodetection which uses
198 - # compiler macros. Plus, --jit-backend= doesn't accept all
199 - # the modern values...
200 -
201 - if use x86; then
202 - if use cpu_flags_x86_sse2; then
203 - jit_backend+=x86
204 - else
205 - jit_backend+=x86-without-sse2
206 - fi
207 - else
208 - jit_backend+=auto
209 - fi
210 - fi
211 -
212 - local args=(
213 - --shared
214 - $(usex jit -Ojit -O2)
215 - $(usex sandbox --sandbox '')
216 -
217 - ${jit_backend}
218 -
219 - pypy/goal/targetpypystandalone
220 - )
221 -
222 - # Avoid linking against libraries disabled by use flags
223 - local opts=(
224 - bzip2:bz2
225 - ncurses:_minimal_curses
226 - )
227 -
228 - local opt
229 - for opt in "${opts[@]}"; do
230 - local flag=${opt%:*}
231 - local mod=${opt#*:}
232 -
233 - args+=(
234 - $(usex ${flag} --withmod --withoutmod)-${mod}
235 - )
236 - done
237 -
238 - local interp=( "${PYTHON}" )
239 - if use low-memory; then
240 - interp=( env PYPY_GC_MAX_DELTA=200MB
241 - "${PYTHON}" --jit loop_longevity=300 )
242 - fi
243 -
244 - # translate into the C sources
245 - # we're going to make them ourselves since otherwise pypy does not
246 - # free up the unneeded memory before spawning the compiler
247 - set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
248 - echo -e "\033[1m${@}\033[0m"
249 - "${@}" || die "translation failed"
250 -}
251 -
252 -src_compile() {
253 - emake -C "${T}"/usession*-0/testing_1
254 -
255 - # copy back to make sys.prefix happy
256 - cp -p "${T}"/usession*-0/testing_1/{pypy-c,libpypy-c.so} . || die
257 - pax-mark m pypy-c libpypy-c.so
258 -
259 - einfo "Generating caches and CFFI modules ..."
260 -
261 - # Generate Grammar and PatternGrammar pickles.
262 - ./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
263 - || die "Generation of Grammar and PatternGrammar pickles failed"
264 -
265 - # Generate cffi modules
266 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
267 -#cffi_build_scripts = {
268 -# "_ssl": "_ssl_build.py",
269 -# "sqlite3": "_sqlite3_build.py",
270 -# "audioop": "_audioop_build.py",
271 -# "tk": "_tkinter/tklib_build.py",
272 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
273 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
274 -# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
275 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
276 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
277 - cffi_targets=( ssl audioop syslog pwdgrp resource )
278 - use gdbm && cffi_targets+=( gdbm )
279 - use ncurses && cffi_targets+=( curses )
280 - use sqlite && cffi_targets+=( sqlite3 )
281 - use tk && cffi_targets+=( tkinter/tklib )
282 -
283 - local t
284 - # all modules except tkinter output to .
285 - # tkinter outputs to the correct dir ...
286 - cd lib_pypy || die
287 - for t in "${cffi_targets[@]}"; do
288 - # tkinter doesn't work via -m
289 - ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
290 - done
291 -
292 - # Cleanup temporary objects
293 - find -name "_cffi_*.[co]" -delete || die
294 - find -type d -empty -delete || die
295 -}
296 -
297 -src_test() {
298 - # (unset)
299 - local -x PYTHONDONTWRITEBYTECODE=
300 -
301 - local ignored_tests=(
302 - # network
303 - --ignore=lib-python/2.7/test/test_urllibnet.py
304 - --ignore=lib-python/2.7/test/test_urllib2net.py
305 - # lots of free space
306 - --ignore=lib-python/2.7/test/test_zipfile64.py
307 - # no module named 'worker' -- a lot
308 - --ignore=lib-python/2.7/test/test_xpickle.py
309 - )
310 -
311 - ./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
312 - "${ignored_tests[@]}" lib-python || die
313 -}
314 -
315 -src_install() {
316 - local dest=/usr/lib/pypy2.7
317 - einfo "Installing PyPy ..."
318 - exeinto "${dest}"
319 - doexe pypy-c libpypy-c.so
320 - pax-mark m "${ED}${dest}/pypy-c" "${ED}${dest}/libpypy-c.so"
321 - insinto "${dest}"
322 - # preserve mtimes to avoid obsoleting caches
323 - insopts -p
324 - doins -r include lib_pypy lib-python
325 - dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
326 - dodoc README.rst
327 -
328 - if ! use gdbm; then
329 - rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
330 - "${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
331 - fi
332 - if ! use sqlite; then
333 - rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
334 - "${ED}${dest}"/lib_pypy/_sqlite3.py \
335 - "${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
336 - fi
337 - if ! use tk; then
338 - rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
339 - "${ED}${dest}"/lib_pypy/_tkinter \
340 - "${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
341 - fi
342 -
343 - local -x PYTHON=${ED}${dest}/pypy-c
344 - # we can't use eclass function since PyPy is dumb and always gives
345 - # paths relative to the interpreter
346 - local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy2.7/site-packages
347 - python_export pypy EPYTHON
348 -
349 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
350 - python_domodule epython.py
351 -
352 - einfo "Byte-compiling Python standard library..."
353 -
354 - # compile the installed modules
355 - python_optimize "${ED}${dest}"
356 -}
357
358 diff --git a/dev-python/pypy/pypy-7.3.0_rc1.ebuild b/dev-python/pypy/pypy-7.3.0_rc1.ebuild
359 deleted file mode 100644
360 index 4dda5f32fd2..00000000000
361 --- a/dev-python/pypy/pypy-7.3.0_rc1.ebuild
362 +++ /dev/null
363 @@ -1,286 +0,0 @@
364 -# Copyright 1999-2019 Gentoo Authors
365 -# Distributed under the terms of the GNU General Public License v2
366 -
367 -EAPI=7
368 -
369 -PYTHON_COMPAT=( python2_7 pypy )
370 -inherit check-reqs pax-utils python-any-r1 toolchain-funcs
371 -
372 -# note: remember to update this to newest dev-lang/python:2.7 on bump
373 -CPY_PATCHSET_VERSION="2.7.15"
374 -MY_P=pypy2.7-v${PV/_/}
375 -
376 -DESCRIPTION="A fast, compliant alternative implementation of the Python language"
377 -HOMEPAGE="https://pypy.org/"
378 -SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2
379 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${CPY_PATCHSET_VERSION}.tar.xz"
380 -
381 -LICENSE="MIT"
382 -# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
383 -SLOT="0/73"
384 -KEYWORDS=""
385 -IUSE="bzip2 gdbm +jit libressl low-memory ncurses sandbox sqlite cpu_flags_x86_sse2 tk"
386 -
387 -RDEPEND=">=sys-libs/zlib-1.1.3:0=
388 - virtual/libffi:0=
389 - virtual/libintl:0=
390 - dev-libs/expat:0=
391 - !libressl? ( dev-libs/openssl:0= )
392 - libressl? ( dev-libs/libressl:0= )
393 - bzip2? ( app-arch/bzip2:0= )
394 - gdbm? ( sys-libs/gdbm:0= )
395 - ncurses? ( sys-libs/ncurses:0= )
396 - sqlite? ( dev-db/sqlite:3= )
397 - tk? (
398 - dev-lang/tk:0=
399 - dev-tcltk/tix:0=
400 - )
401 - !dev-python/pypy-bin:0"
402 -# don't enforce the dep on pypy with USE=low-memory since it's going
403 -# to cause either collisions or circular dep on itself
404 -DEPEND="${RDEPEND}
405 - !low-memory? (
406 - || (
407 - dev-python/pypy
408 - dev-python/pypy-bin
409 - (
410 - dev-lang/python:2.7
411 - dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
412 - )
413 - )
414 - )"
415 -
416 -S="${WORKDIR}/${MY_P}-src"
417 -
418 -check_env() {
419 - if use low-memory; then
420 - if ! python_is_installed pypy; then
421 - eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
422 - eerror "or dev-python/pypy-bin being installed. Please install it using e.g.:"
423 - eerror
424 - eerror " $ emerge -1v dev-python/pypy-bin"
425 - eerror
426 - eerror "before attempting to build dev-python/pypy[low-memory]."
427 - die "dev-python/pypy-bin (or dev-python/pypy) needs to be installed for USE=low-memory"
428 - fi
429 -
430 - CHECKREQS_MEMORY="1750M"
431 - use amd64 && CHECKREQS_MEMORY="3500M"
432 - else
433 - CHECKREQS_MEMORY="3G"
434 - use amd64 && CHECKREQS_MEMORY="6G"
435 - fi
436 -
437 - check-reqs_pkg_pretend
438 -}
439 -
440 -pkg_pretend() {
441 - [[ ${MERGE_TYPE} != binary ]] && check_env
442 -}
443 -
444 -pkg_setup() {
445 - if [[ ${MERGE_TYPE} != binary ]]; then
446 - check_env
447 -
448 - if python_is_installed pypy; then
449 - if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] || use low-memory; then
450 - einfo "Using already-installed PyPy to perform the translation."
451 - local EPYTHON=pypy
452 - else
453 - einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
454 - einfo "recommends using PyPy for that. If you wish to do so, please unset"
455 - einfo "the EPYTHON variable."
456 - fi
457 - fi
458 -
459 - python-any-r1_pkg_setup
460 - fi
461 -}
462 -
463 -src_prepare() {
464 - eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
465 - eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
466 - eapply "${FILESDIR}"/5.9.0-shared-lib.patch # 517002
467 -
468 - sed -e "s^@EPREFIX@^${EPREFIX}^" \
469 - -i lib-python/2.7/distutils/command/install.py || die
470 -
471 - # apply CPython stdlib patches
472 - pushd lib-python/2.7 > /dev/null || die
473 - # TODO: cpy turkish locale patch now fixes C code
474 - # probably needs better port to pypy, if it is broken there
475 - eapply "${FILESDIR}"/5.8.0_all_distutils_cxx.patch
476 - eapply -p2 "${WORKDIR}"/patches/0011-use_pyxml.patch
477 - popd > /dev/null || die
478 -
479 - eapply_user
480 -}
481 -
482 -src_configure() {
483 - tc-export CC
484 -
485 - local jit_backend
486 - if use jit; then
487 - jit_backend='--jit-backend='
488 -
489 - # We only need the explicit sse2 switch for x86.
490 - # On other arches we can rely on autodetection which uses
491 - # compiler macros. Plus, --jit-backend= doesn't accept all
492 - # the modern values...
493 -
494 - if use x86; then
495 - if use cpu_flags_x86_sse2; then
496 - jit_backend+=x86
497 - else
498 - jit_backend+=x86-without-sse2
499 - fi
500 - else
501 - jit_backend+=auto
502 - fi
503 - fi
504 -
505 - local args=(
506 - --shared
507 - $(usex jit -Ojit -O2)
508 - $(usex sandbox --sandbox '')
509 -
510 - ${jit_backend}
511 -
512 - pypy/goal/targetpypystandalone
513 - )
514 -
515 - # Avoid linking against libraries disabled by use flags
516 - local opts=(
517 - bzip2:bz2
518 - ncurses:_minimal_curses
519 - )
520 -
521 - local opt
522 - for opt in "${opts[@]}"; do
523 - local flag=${opt%:*}
524 - local mod=${opt#*:}
525 -
526 - args+=(
527 - $(usex ${flag} --withmod --withoutmod)-${mod}
528 - )
529 - done
530 -
531 - local interp=( "${PYTHON}" )
532 - if use low-memory; then
533 - interp=( env PYPY_GC_MAX_DELTA=200MB
534 - "${PYTHON}" --jit loop_longevity=300 )
535 - fi
536 -
537 - # translate into the C sources
538 - # we're going to make them ourselves since otherwise pypy does not
539 - # free up the unneeded memory before spawning the compiler
540 - set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
541 - echo -e "\033[1m${@}\033[0m"
542 - "${@}" || die "translation failed"
543 -}
544 -
545 -src_compile() {
546 - emake -C "${T}"/usession*-0/testing_1
547 -
548 - # copy back to make sys.prefix happy
549 - cp -p "${T}"/usession*-0/testing_1/{pypy-c,libpypy-c.so} . || die
550 - pax-mark m pypy-c libpypy-c.so
551 -
552 - einfo "Generating caches and CFFI modules ..."
553 -
554 - # Generate Grammar and PatternGrammar pickles.
555 - ./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
556 - || die "Generation of Grammar and PatternGrammar pickles failed"
557 -
558 - # Generate cffi modules
559 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
560 -#cffi_build_scripts = {
561 -# "_ssl": "_ssl_build.py",
562 -# "sqlite3": "_sqlite3_build.py",
563 -# "audioop": "_audioop_build.py",
564 -# "tk": "_tkinter/tklib_build.py",
565 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
566 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
567 -# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
568 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
569 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
570 - cffi_targets=( ssl audioop syslog pwdgrp resource )
571 - use gdbm && cffi_targets+=( gdbm )
572 - use ncurses && cffi_targets+=( curses )
573 - use sqlite && cffi_targets+=( sqlite3 )
574 - use tk && cffi_targets+=( tkinter/tklib )
575 -
576 - local t
577 - # all modules except tkinter output to .
578 - # tkinter outputs to the correct dir ...
579 - cd lib_pypy || die
580 - for t in "${cffi_targets[@]}"; do
581 - # tkinter doesn't work via -m
582 - ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
583 - done
584 -
585 - # Cleanup temporary objects
586 - find -name "_cffi_*.[co]" -delete || die
587 - find -type d -empty -delete || die
588 -}
589 -
590 -src_test() {
591 - # (unset)
592 - local -x PYTHONDONTWRITEBYTECODE=
593 -
594 - local ignored_tests=(
595 - # network
596 - --ignore=lib-python/2.7/test/test_urllibnet.py
597 - --ignore=lib-python/2.7/test/test_urllib2net.py
598 - # lots of free space
599 - --ignore=lib-python/2.7/test/test_zipfile64.py
600 - # no module named 'worker' -- a lot
601 - --ignore=lib-python/2.7/test/test_xpickle.py
602 - )
603 -
604 - ./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
605 - "${ignored_tests[@]}" lib-python || die
606 -}
607 -
608 -src_install() {
609 - local dest=/usr/lib/pypy2.7
610 - einfo "Installing PyPy ..."
611 - exeinto "${dest}"
612 - doexe pypy-c libpypy-c.so
613 - pax-mark m "${ED}${dest}/pypy-c" "${ED}${dest}/libpypy-c.so"
614 - insinto "${dest}"
615 - # preserve mtimes to avoid obsoleting caches
616 - insopts -p
617 - doins -r include lib_pypy lib-python
618 - dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
619 - dodoc README.rst
620 -
621 - if ! use gdbm; then
622 - rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
623 - "${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
624 - fi
625 - if ! use sqlite; then
626 - rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
627 - "${ED}${dest}"/lib_pypy/_sqlite3.py \
628 - "${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
629 - fi
630 - if ! use tk; then
631 - rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
632 - "${ED}${dest}"/lib_pypy/_tkinter \
633 - "${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
634 - fi
635 -
636 - local -x PYTHON=${ED}${dest}/pypy-c
637 - # we can't use eclass function since PyPy is dumb and always gives
638 - # paths relative to the interpreter
639 - local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy2.7/site-packages
640 - python_export pypy EPYTHON
641 -
642 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
643 - python_domodule epython.py
644 -
645 - einfo "Byte-compiling Python standard library..."
646 -
647 - # compile the installed modules
648 - python_optimize "${ED}${dest}"
649 -}