summaryrefslogtreecommitdiff
path: root/dev-python/pypy-exe
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-01-22 20:28:19 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-01-22 20:28:19 +0000
commitabaa75b10f899ada8dd05b23cc03205064394bc6 (patch)
treeeca3dd248b73b92013cba00a0fcc1edf2696e19a /dev-python/pypy-exe
parent24fd814c326e282c4321965c31f341dad77e270d (diff)
gentoo resync : 22.01.2021
Diffstat (limited to 'dev-python/pypy-exe')
-rw-r--r--dev-python/pypy-exe/Manifest9
-rw-r--r--dev-python/pypy-exe/files/pypy-7.3.2-ppc64-segfault.patch64
-rw-r--r--dev-python/pypy-exe/pypy-exe-7.3.1.ebuild162
-rw-r--r--dev-python/pypy-exe/pypy-exe-7.3.2.ebuild171
-rw-r--r--dev-python/pypy-exe/pypy-exe-7.3.3.ebuild4
-rw-r--r--dev-python/pypy-exe/pypy-exe-7.3.3_rc1.ebuild167
6 files changed, 3 insertions, 574 deletions
diff --git a/dev-python/pypy-exe/Manifest b/dev-python/pypy-exe/Manifest
index 19cca5c4951b..94cfc472c5cd 100644
--- a/dev-python/pypy-exe/Manifest
+++ b/dev-python/pypy-exe/Manifest
@@ -1,10 +1,3 @@
-AUX pypy-7.3.2-ppc64-segfault.patch 3077 BLAKE2B 88085062fb0db4641f995a560386fb3adca7ef9d54225ad42a9a52c0bb976a816366c1f94e1a17616b49213635ebb9305e090e7e1dcb9f8c05cf5dcb9a08e6f1 SHA512 c07698452b0c88959a08ecc3730980dc1899f39b43d71b62b455ed0c8fb863717f0d8555c7f96d2c465c790fecfedb0c06afc5bb8b5b6255ee04c66a7ac1c377
-DIST pypy2.7-v7.3.1-src.tar.bz2 21053306 BLAKE2B 071d59b7978c98e9ed9243d9a64d93d21b524351cb9a45e0f7d48828f919c84585a1164e7c38739fdd8828ab4b1eedade96dff7d64d0d9cbfe00c74d88d532bb SHA512 1bec44fa0fc4b1186e25f69303f9e332df32184be990d86fba41c40152664a93bd65eabf4dded133371271402cea9b150b60c13bce89d1004b276f0908c0b8f1
-DIST pypy2.7-v7.3.2-src.tar.bz2 21142873 BLAKE2B e6bcd2dc28ef740962d053753ccd172e3895fc83fe23a319c003248e0986f9805839daddd13a0f480f1e9ee813979742699cb0bc8c42b6b05c193fedf67aea4f SHA512 b40d93d615a27e3a035007307a8ab2b49ff90f3047af914b268a80feb8219d372eca14c04a8b0dea91efb992653457b7c6d088c784de32c414cc48879f2d15fc
DIST pypy2.7-v7.3.3-src.tar.bz2 20881821 BLAKE2B ce1ecdd1fffe40574c7662da6038b84d2bca47ab168939ef0c12be2c6348317f17a94a3026e7fa53c71601edc153aefd98f770bd148e7af07ca751c0a5fc1252 SHA512 c2b6c44fdcac5f9445fab01572f859228fc286891fd09a4ddb95d283683d805276c853ec8e61fcd04cb9ee811d0e959d19bb03fdd7442c044f28a773633122e7
-DIST pypy2.7-v7.3.3rc1-src.tar.bz2 20933100 BLAKE2B afbf3c15924e6a215b6323fe97e9782912f09ba1e1db6652b37897ead07deaaa97f591a91f3695e958e8e2dee2626bbda94c4043c025b3f52a12279dc66e483c SHA512 0ddbdcf7ef825888ff748ebdd84cb501653e3a4a0e506e35810f9693b5d3b388c2f636396616f0c8fcc96dc806fa02d74830c1f37ca11fdcfdfd32c3bcd1fdd0
-EBUILD pypy-exe-7.3.1.ebuild 3891 BLAKE2B 1121625d5422a1d52114e58fd7f1632f175fc1623b2b931c3fb528acb1f18fdfc1a0859218330fe3e7c20bc539ff2819ea21cac2cb41328a4d295e7f5e9f684a SHA512 6bff225e427ae47b014a20ae7ab3893e55a893d5ce0670dc0474b4e6626113f5cbeef893e8585d42c8be78a64a051addbbbff1eb90b2266284d6064e73feeb2f
-EBUILD pypy-exe-7.3.2.ebuild 4134 BLAKE2B 41a510875ed28bda552ddd80609ffe31c2d5eea78416af1dedade3616cca89f472c96968013b4855a7a2f5367530ca35a773cbb25cdaa7b6fb60d4de2ee01ae4 SHA512 addda776a9aabdcc9dcfabd2b59ee1d6b7c1938824abed3e69e912d09325669fc61959edf74c4ba15c1704e7e7282c7de386dcedc4265ba62868dbf01a7c1b99
-EBUILD pypy-exe-7.3.3.ebuild 4073 BLAKE2B 5910415342588e30e5a2222f581aed45b141219545044406552b0fc03e08863927d9bf6f0efef96fadfe46a97c4268b8c9d33ff1b8a4f45bfdce21507cb7db3b SHA512 36ccd6935458c136936691a88c05c2d197708e0d565f493825082a007cf967cf62acb4367effcabbc7aacf1f0e7ce30483f84c581e6d2124331db129c6e53bf1
-EBUILD pypy-exe-7.3.3_rc1.ebuild 4025 BLAKE2B f383d2e0f5f5c2041998e5c2dd2bdc77fd29a29895cd78bcdc4ba4f831bd675dc7b1d09e04f58f86bc72467fe076cce01292faaf79a373ed4c1dcc197253b63e SHA512 6a470cd309e2bf810afe9b903779ac1f4894da9acf50dc5afcc0f5d2e4fc0d70d59df40507ef15eb9412957c38c0c4070289dba86347f01940780791fed0bd2c
+EBUILD pypy-exe-7.3.3.ebuild 4072 BLAKE2B 135173666875141b839f4e10acf42cc0aea15f8f28180443ac5371a2a3b2695ce9f889408d244e3a07daeb02be61633e2adab9c734661d952e4f995c32231035 SHA512 210db2c626605b6daf7b1a77e0238a27afbb53ee98ce7b28cdc91ab8e073827b4b9848d47201122f0bd3f1ddfaa8734e97700f99507d9a1035be4f19551121bf
MISC metadata.xml 497 BLAKE2B 02040ea95327971e16090c00e5771bc684710e90000ca07b366226fedbae8973a1f4bdd9d37506446a2fe3caea4fdf83ca186d2706747adccd14ea24a19486b3 SHA512 816621f5288b822fc1c7b360ac6f1e5f7b464a60c9b6e58fc464860bb8a4f44be932fe6562625006925ddda2b5cc14feeaef587303642d894494ddea6472cd2a
diff --git a/dev-python/pypy-exe/files/pypy-7.3.2-ppc64-segfault.patch b/dev-python/pypy-exe/files/pypy-7.3.2-ppc64-segfault.patch
deleted file mode 100644
index c143a3765cdf..000000000000
--- a/dev-python/pypy-exe/files/pypy-7.3.2-ppc64-segfault.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 913e0dae8ac7ce8219a5f31126fee8a794cc314c Mon Sep 17 00:00:00 2001
-From: Armin Rigo <arigo@tunes.org>
-Date: Sat, 26 Sep 2020 09:26:24 +0200
-Subject: [PATCH] oops, fix for test_gc_indexed_box_plus_large_offset
-
----
- rpython/jit/backend/ppc/opassembler.py | 16 +++++++++++-----
- rpython/jit/backend/ppc/regalloc.py | 4 ++--
- 2 files changed, 13 insertions(+), 7 deletions(-)
-
-diff --git a/rpython/jit/backend/ppc/opassembler.py b/rpython/jit/backend/ppc/opassembler.py
-index b79b18e530..4bbfbba93a 100644
---- a/rpython/jit/backend/ppc/opassembler.py
-+++ b/rpython/jit/backend/ppc/opassembler.py
-@@ -755,13 +755,19 @@ class FieldOpAssembler(object):
- def _apply_offset(self, index_loc, ofs_loc):
- # If offset != 0 then we have to add it here. Note that
- # mc.addi() would not be valid with operand r0.
-- assert ofs_loc.is_imm() # must be an immediate...
-- assert _check_imm_arg(ofs_loc.getint()) # ...that fits 16 bits
- assert index_loc.is_core_reg()
- assert index_loc is not r.SCRATCH2
-- # (simplified version of _apply_scale())
-- if ofs_loc.value > 0:
-- self.mc.addi(r.SCRATCH2.value, index_loc.value, ofs_loc.value)
-+ if ofs_loc.is_imm():
-+ # if it is an immediate, it must fit into 16 bits
-+ assert _check_imm_arg(ofs_loc.getint())
-+ # (simplified version of _apply_scale())
-+ if ofs_loc.value != 0:
-+ self.mc.addi(r.SCRATCH2.value, index_loc.value, ofs_loc.value)
-+ index_loc = r.SCRATCH2
-+ else:
-+ # larger immediates are loaded into a register in regalloc.py
-+ assert ofs_loc.is_core_reg()
-+ self.mc.add(r.SCRATCH2.value, index_loc.value, ofs_loc.value)
- index_loc = r.SCRATCH2
- return index_loc
-
-diff --git a/rpython/jit/backend/ppc/regalloc.py b/rpython/jit/backend/ppc/regalloc.py
-index f3ee1129e4..827953cf12 100644
---- a/rpython/jit/backend/ppc/regalloc.py
-+++ b/rpython/jit/backend/ppc/regalloc.py
-@@ -771,7 +771,7 @@ class Regalloc(BaseRegalloc, VectorRegalloc):
- value_loc = self.ensure_reg(op.getarg(2))
- assert op.getarg(3).getint() == 1 # scale
- ofs_loc = self.ensure_reg_or_16bit_imm(op.getarg(4))
-- assert ofs_loc.is_imm() # the arg(4) should always be a small constant
-+ # the arg(4) is often a small constant, but it may be too large
- size_loc = self.ensure_reg_or_any_imm(op.getarg(5))
- return [base_loc, index_loc, value_loc, ofs_loc, size_loc]
-
-@@ -780,7 +780,7 @@ class Regalloc(BaseRegalloc, VectorRegalloc):
- index_loc = self.ensure_reg(op.getarg(1))
- assert op.getarg(2).getint() == 1 # scale
- ofs_loc = self.ensure_reg_or_16bit_imm(op.getarg(3))
-- assert ofs_loc.is_imm() # the arg(3) should always be a small constant
-+ # the arg(3) is often a small constant, but it may be too large
- self.free_op_vars()
- res_loc = self.force_allocate_reg(op)
- size_box = op.getarg(4)
---
-GitLab
-
diff --git a/dev-python/pypy-exe/pypy-exe-7.3.1.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.1.ebuild
deleted file mode 100644
index c17e889d43a2..000000000000
--- a/dev-python/pypy-exe/pypy-exe-7.3.1.ebuild
+++ /dev/null
@@ -1,162 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python2_7 )
-inherit check-reqs pax-utils python-any-r1 toolchain-funcs
-
-MY_P=pypy2.7-v${PV/_/}
-DESCRIPTION="PyPy executable (build from source)"
-HOMEPAGE="https://pypy.org/"
-SRC_URI="https://downloads.python.org/pypy/${MY_P}-src.tar.bz2"
-S="${WORKDIR}/${MY_P}-src"
-
-LICENSE="MIT"
-SLOT="${PV}"
-KEYWORDS="amd64 ~ppc64 x86 ~amd64-linux ~x86-linux"
-IUSE="bzip2 +jit low-memory ncurses cpu_flags_x86_sse2"
-
-RDEPEND=">=sys-libs/zlib-1.1.3:0=
- dev-libs/libffi:0=
- virtual/libintl:0=
- dev-libs/expat:0=
- bzip2? ( app-arch/bzip2:0= )
- ncurses? ( sys-libs/ncurses:0= )
- !dev-python/pypy-exe-bin:${PV}"
-# don't enforce the dep on pypy with USE=low-memory since it's going
-# to cause either collisions or circular dep on itself
-DEPEND="${RDEPEND}"
-BDEPEND="
- !low-memory? (
- || (
- dev-python/pypy
- (
- dev-lang/python:2.7
- dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
- )
- )
- )"
-
-check_env() {
- if use low-memory; then
- if ! has_version -b dev-python/pypy &&
- ! has_version -b dev-python/pypy-bin
- then
- eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
- eerror "being installed. Please install it using e.g.:"
- eerror
- eerror " $ emerge -1v dev-python/pypy dev-python/pypy-exe-bin"
- eerror
- eerror "before attempting to build dev-python/pypy-exe[low-memory]."
- die "dev-python/pypy needs to be installed for USE=low-memory"
- fi
-
- CHECKREQS_MEMORY="1750M"
- use amd64 && CHECKREQS_MEMORY="3500M"
- else
- CHECKREQS_MEMORY="3G"
- use amd64 && CHECKREQS_MEMORY="6G"
- fi
-
- check-reqs_pkg_pretend
-}
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && check_env
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- check_env
-
- use low-memory && EPYTHON=
- if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] &&
- { has_version -b dev-python/pypy ||
- has_version -b dev-python/pypy-bin; }
- then
- einfo "Using already-installed PyPy to perform the translation."
- EPYTHON=pypy
- else
- einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
- einfo "recommends using PyPy for that. If you wish to do so, please unset"
- einfo "the EPYTHON variable."
- python-any-r1_pkg_setup
- fi
- fi
-}
-
-src_configure() {
- tc-export CC
-
- local jit_backend
- if use jit; then
- jit_backend='--jit-backend='
-
- # We only need the explicit sse2 switch for x86.
- # On other arches we can rely on autodetection which uses
- # compiler macros. Plus, --jit-backend= doesn't accept all
- # the modern values...
-
- if use x86; then
- if use cpu_flags_x86_sse2; then
- jit_backend+=x86
- else
- jit_backend+=x86-without-sse2
- fi
- else
- jit_backend+=auto
- fi
- fi
-
- local args=(
- --no-shared
- $(usex jit -Ojit -O2)
-
- ${jit_backend}
-
- pypy/goal/targetpypystandalone
- )
-
- # Avoid linking against libraries disabled by use flags
- local opts=(
- bzip2:bz2
- ncurses:_minimal_curses
- )
-
- local opt
- for opt in "${opts[@]}"; do
- local flag=${opt%:*}
- local mod=${opt#*:}
-
- args+=(
- $(usex ${flag} --withmod --withoutmod)-${mod}
- )
- done
-
- local interp=( "${EPYTHON}" )
- if use low-memory; then
- interp=( env PYPY_GC_MAX_DELTA=200MB
- "${EPYTHON}" --jit loop_longevity=300 )
- fi
-
- # translate into the C sources
- # we're going to make them ourselves since otherwise pypy does not
- # free up the unneeded memory before spawning the compiler
- set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
- echo -e "\033[1m${@}\033[0m"
- "${@}" || die "translation failed"
-}
-
-src_compile() {
- emake -C "${T}"/usession*-0/testing_1
-}
-
-src_install() {
- local dest=/usr/lib/pypy2.7
- exeinto "${dest}"
- newexe "${T}"/usession*-0/testing_1/pypy-c pypy-c-${PV}
- insinto "${dest}"/include/${PV}
- doins include/pypy_*
- pax-mark m "${ED}${dest}/pypy-c-${PV}"
-}
diff --git a/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild
deleted file mode 100644
index 5f8b73f349d8..000000000000
--- a/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild
+++ /dev/null
@@ -1,171 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python2_7 )
-inherit check-reqs pax-utils python-any-r1 toolchain-funcs
-
-MY_P=pypy2.7-v${PV/_/}
-DESCRIPTION="PyPy executable (build from source)"
-HOMEPAGE="https://pypy.org/"
-SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2"
-S="${WORKDIR}/${MY_P}-src"
-
-LICENSE="MIT"
-SLOT="${PV}"
-KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="bzip2 +jit low-memory ncurses cpu_flags_x86_sse2"
-
-RDEPEND=">=sys-libs/zlib-1.1.3:0=
- dev-libs/libffi:0=
- virtual/libintl:0=
- dev-libs/expat:0=
- bzip2? ( app-arch/bzip2:0= )
- ncurses? ( sys-libs/ncurses:0= )
- !dev-python/pypy-exe-bin:${PV}"
-# don't enforce the dep on pypy with USE=low-memory since it's going
-# to cause either collisions or circular dep on itself
-DEPEND="${RDEPEND}"
-BDEPEND="
- !low-memory? (
- || (
- dev-python/pypy
- dev-lang/python:2.7
- )
- )"
-
-check_env() {
- if use low-memory; then
- if ! has_version -b dev-python/pypy &&
- ! has_version -b dev-python/pypy-bin
- then
- eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
- eerror "being installed. Please install it using e.g.:"
- eerror
- eerror " $ emerge -1v dev-python/pypy dev-python/pypy-exe-bin"
- eerror
- eerror "before attempting to build dev-python/pypy-exe[low-memory]."
- die "dev-python/pypy needs to be installed for USE=low-memory"
- fi
-
- CHECKREQS_MEMORY="1750M"
- use amd64 && CHECKREQS_MEMORY="3500M"
- else
- CHECKREQS_MEMORY="3G"
- use amd64 && CHECKREQS_MEMORY="6G"
- fi
-
- check-reqs_pkg_pretend
-}
-
-PATCHES=(
- "${FILESDIR}"/pypy-7.3.2-ppc64-segfault.patch
-)
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && check_env
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- check_env
-
- use low-memory && EPYTHON=
- if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] &&
- { has_version -b dev-python/pypy ||
- has_version -b dev-python/pypy-bin; }
- then
- einfo "Using already-installed PyPy to perform the translation."
- EPYTHON=pypy
- else
- einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
- einfo "recommends using PyPy for that. If you wish to do so, please unset"
- einfo "the EPYTHON variable."
- python-any-r1_pkg_setup
- fi
- fi
-}
-
-src_configure() {
- tc-export CC
-
- local jit_backend
- if use jit; then
- jit_backend='--jit-backend='
-
- # We only need the explicit sse2 switch for x86.
- # On other arches we can rely on autodetection which uses
- # compiler macros. Plus, --jit-backend= doesn't accept all
- # the modern values...
-
- if use x86; then
- if use cpu_flags_x86_sse2; then
- jit_backend+=x86
- else
- jit_backend+=x86-without-sse2
- fi
- else
- jit_backend+=auto
- fi
- fi
-
- local args=(
- --no-shared
- $(usex jit -Ojit -O2)
-
- ${jit_backend}
-
- pypy/goal/targetpypystandalone
- )
-
- # Avoid linking against libraries disabled by use flags
- local opts=(
- bzip2:bz2
- ncurses:_minimal_curses
- )
-
- local opt
- for opt in "${opts[@]}"; do
- local flag=${opt%:*}
- local mod=${opt#*:}
-
- args+=(
- $(usex ${flag} --withmod --withoutmod)-${mod}
- )
- done
-
- local interp=( "${EPYTHON}" )
- if use low-memory; then
- interp=( env PYPY_GC_MAX_DELTA=200MB
- "${EPYTHON}" --jit loop_longevity=300 )
- fi
-
- if [[ ${EPYTHON} != pypy ]]; then
- # reuse bundled pycparser to avoid external dep
- mkdir -p "${T}"/pymod/cffi || die
- : > "${T}"/pymod/cffi/__init__.py || die
- cp -r lib_pypy/cffi/_pycparser "${T}"/pymod/cffi/ || die
- local -x PYTHONPATH=${T}/pymod:${PYTHONPATH}
- fi
-
- # translate into the C sources
- # we're going to build them ourselves since otherwise pypy does not
- # free up the unneeded memory before spawning the compiler
- set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
- echo -e "\033[1m${@}\033[0m"
- "${@}" || die "translation failed"
-}
-
-src_compile() {
- emake -C "${T}"/usession*-0/testing_1
-}
-
-src_install() {
- local dest=/usr/lib/pypy2.7
- exeinto "${dest}"
- newexe "${T}"/usession*-0/testing_1/pypy-c pypy-c-${PV}
- insinto "${dest}"/include/${PV}
- doins include/pypy_*
- pax-mark m "${ED}${dest}/pypy-c-${PV}"
-}
diff --git a/dev-python/pypy-exe/pypy-exe-7.3.3.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.3.ebuild
index 3f210433ff4b..d1dbbea4e782 100644
--- a/dev-python/pypy-exe/pypy-exe-7.3.3.ebuild
+++ b/dev-python/pypy-exe/pypy-exe-7.3.3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -14,7 +14,7 @@ S="${WORKDIR}/${MY_P}-src"
LICENSE="MIT"
SLOT="${PV}"
-KEYWORDS="amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+KEYWORDS="amd64 ~arm64 ~ppc64 x86 ~amd64-linux ~x86-linux"
IUSE="bzip2 +jit low-memory ncurses cpu_flags_x86_sse2"
RDEPEND=">=sys-libs/zlib-1.1.3:0=
diff --git a/dev-python/pypy-exe/pypy-exe-7.3.3_rc1.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.3_rc1.ebuild
deleted file mode 100644
index b3cba7450ed2..000000000000
--- a/dev-python/pypy-exe/pypy-exe-7.3.3_rc1.ebuild
+++ /dev/null
@@ -1,167 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python2_7 )
-inherit check-reqs pax-utils python-any-r1 toolchain-funcs
-
-MY_P=pypy2.7-v${PV/_/}
-DESCRIPTION="PyPy executable (build from source)"
-HOMEPAGE="https://pypy.org/"
-SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2"
-S="${WORKDIR}/${MY_P}-src"
-
-LICENSE="MIT"
-SLOT="${PV}"
-KEYWORDS=""
-IUSE="bzip2 +jit low-memory ncurses cpu_flags_x86_sse2"
-
-RDEPEND=">=sys-libs/zlib-1.1.3:0=
- dev-libs/libffi:0=
- virtual/libintl:0=
- dev-libs/expat:0=
- bzip2? ( app-arch/bzip2:0= )
- ncurses? ( sys-libs/ncurses:0= )
- !dev-python/pypy-exe-bin:${PV}"
-# don't enforce the dep on pypy with USE=low-memory since it's going
-# to cause either collisions or circular dep on itself
-DEPEND="${RDEPEND}"
-BDEPEND="
- !low-memory? (
- || (
- dev-python/pypy
- dev-lang/python:2.7
- )
- )"
-
-check_env() {
- if use low-memory; then
- if ! has_version -b dev-python/pypy &&
- ! has_version -b dev-python/pypy-bin
- then
- eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
- eerror "being installed. Please install it using e.g.:"
- eerror
- eerror " $ emerge -1v dev-python/pypy dev-python/pypy-exe-bin"
- eerror
- eerror "before attempting to build dev-python/pypy-exe[low-memory]."
- die "dev-python/pypy needs to be installed for USE=low-memory"
- fi
-
- CHECKREQS_MEMORY="1750M"
- use amd64 && CHECKREQS_MEMORY="3500M"
- else
- CHECKREQS_MEMORY="3G"
- use amd64 && CHECKREQS_MEMORY="6G"
- fi
-
- check-reqs_pkg_pretend
-}
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && check_env
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- check_env
-
- use low-memory && EPYTHON=
- if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] &&
- { has_version -b dev-python/pypy ||
- has_version -b dev-python/pypy-bin; }
- then
- einfo "Using already-installed PyPy to perform the translation."
- EPYTHON=pypy
- else
- einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
- einfo "recommends using PyPy for that. If you wish to do so, please unset"
- einfo "the EPYTHON variable."
- python-any-r1_pkg_setup
- fi
- fi
-}
-
-src_configure() {
- tc-export CC
-
- local jit_backend
- if use jit; then
- jit_backend='--jit-backend='
-
- # We only need the explicit sse2 switch for x86.
- # On other arches we can rely on autodetection which uses
- # compiler macros. Plus, --jit-backend= doesn't accept all
- # the modern values...
-
- if use x86; then
- if use cpu_flags_x86_sse2; then
- jit_backend+=x86
- else
- jit_backend+=x86-without-sse2
- fi
- else
- jit_backend+=auto
- fi
- fi
-
- local args=(
- --no-shared
- $(usex jit -Ojit -O2)
-
- ${jit_backend}
-
- pypy/goal/targetpypystandalone
- )
-
- # Avoid linking against libraries disabled by use flags
- local opts=(
- bzip2:bz2
- ncurses:_minimal_curses
- )
-
- local opt
- for opt in "${opts[@]}"; do
- local flag=${opt%:*}
- local mod=${opt#*:}
-
- args+=(
- $(usex ${flag} --withmod --withoutmod)-${mod}
- )
- done
-
- local interp=( "${EPYTHON}" )
- if use low-memory; then
- interp=( env PYPY_GC_MAX_DELTA=200MB
- "${EPYTHON}" --jit loop_longevity=300 )
- fi
-
- if [[ ${EPYTHON} != pypy ]]; then
- # reuse bundled pycparser to avoid external dep
- mkdir -p "${T}"/pymod/cffi || die
- : > "${T}"/pymod/cffi/__init__.py || die
- cp -r lib_pypy/cffi/_pycparser "${T}"/pymod/cffi/ || die
- local -x PYTHONPATH=${T}/pymod:${PYTHONPATH}
- fi
-
- # translate into the C sources
- # we're going to build them ourselves since otherwise pypy does not
- # free up the unneeded memory before spawning the compiler
- set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
- echo -e "\033[1m${@}\033[0m"
- "${@}" || die "translation failed"
-}
-
-src_compile() {
- emake -C "${T}"/usession*-0/testing_1
-}
-
-src_install() {
- local dest=/usr/lib/pypy2.7
- exeinto "${dest}"
- newexe "${T}"/usession*-0/testing_1/pypy-c pypy-c-${PV}
- insinto "${dest}"/include/${PV}
- doins include/pypy_*
- pax-mark m "${ED}${dest}/pypy-c-${PV}"
-}