summaryrefslogtreecommitdiff
path: root/dev-python/pypy3-exe
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-01-15 15:51:32 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-01-15 15:51:32 +0000
commit21435953e16cda318a82334ddbadb3b5c36d9ea7 (patch)
treee1810a4b135afce04b34862ef0fab2bfaeb8aeca /dev-python/pypy3-exe
parent7bc9c63c9da678a7e6fceb095d56c634afd22c56 (diff)
gentoo resync : 15.01.2020
Diffstat (limited to 'dev-python/pypy3-exe')
-rw-r--r--dev-python/pypy3-exe/Manifest3
-rw-r--r--dev-python/pypy3-exe/metadata.xml16
-rw-r--r--dev-python/pypy3-exe/pypy3-exe-7.3.0.ebuild151
3 files changed, 170 insertions, 0 deletions
diff --git a/dev-python/pypy3-exe/Manifest b/dev-python/pypy3-exe/Manifest
new file mode 100644
index 000000000000..148c04fb6183
--- /dev/null
+++ b/dev-python/pypy3-exe/Manifest
@@ -0,0 +1,3 @@
+DIST pypy3.6-v7.3.0-src.tar.bz2 21937786 BLAKE2B c53ac32a9cca1c4624160eae9f11b5705a59613f1e5100fbb0ee86118de5a7845b8fa5087165d7f5a077d20337dfca14a1c7eadbe768995e20e249ec271ac10d SHA512 313a4254262dd8d8b995a50bddbc360cfb67add0818e51a3e9ce25bda6a9b639e9fea8efe7da6adda76dff0a86a364544a13faa516e51b9ea6c25ec99223b435
+EBUILD pypy3-exe-7.3.0.ebuild 3473 BLAKE2B c47382a372522ab4cba6709d89f9f5fe6e06a23868bcc058bcb325fcd1affc5041f68735e3fa091f55f65aba32e22580b1df516f901a1cf65e9fefbbb732a73f SHA512 71e41c14b3ba2cc0656dd9ab2ef795154b027421750cd539ebc1b2081501b38feb620c692695c1c8b531dab53579cfadf0f3d159a0a220e22bb3caf5dc1e65eb
+MISC metadata.xml 574 BLAKE2B 780347fb0394d2ed8955c96b0a60c66abf4d5835a584dc666ee20d2eb45d6fe4f54800d6bdbedbcd986165c12d89ad5cb730c24c4d85dd67f2d4d85a925a45dc SHA512 32b48188c88a38a5f107a891519ca7749e3c0566f8f0b4a148e14fa31f762c90814d85199efbeae651d8191558b12a13920e899e5a8e2e07b5fdaaca9c4388b2
diff --git a/dev-python/pypy3-exe/metadata.xml b/dev-python/pypy3-exe/metadata.xml
new file mode 100644
index 000000000000..cf6720905ca5
--- /dev/null
+++ b/dev-python/pypy3-exe/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <use>
+ <flag name="low-memory">Build using PyPy with the engine configured towards low memory footprint.
+ This makes it possible to build PyPy using ~3.5G of RAM on amd64 and ~half of that on x86,
+ at the cost of lengthened build time.</flag>
+ </use>
+ <upstream>
+ <remote-id type="bitbucket">pypy/pypy</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/pypy3-exe/pypy3-exe-7.3.0.ebuild b/dev-python/pypy3-exe/pypy3-exe-7.3.0.ebuild
new file mode 100644
index 000000000000..baed59372e8d
--- /dev/null
+++ b/dev-python/pypy3-exe/pypy3-exe-7.3.0.ebuild
@@ -0,0 +1,151 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# pypy3 needs to be built using python 2
+PYTHON_COMPAT=( python2_7 )
+inherit check-reqs pax-utils python-any-r1 toolchain-funcs
+
+MY_P=pypy3.6-v${PV/_/}
+DESCRIPTION="PyPy3 executable (build from source)"
+HOMEPAGE="https://pypy.org/"
+SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${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=
+ virtual/libffi:0=
+ virtual/libintl:0=
+ dev-libs/expat:0=
+ bzip2? ( app-arch/bzip2:0= )
+ ncurses? ( sys-libs/ncurses:0= )
+ !dev-python/pypy3-exe-bin:${PV}"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ low-memory? ( dev-python/pypy )
+ !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
+ 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
+
+ # unset to allow forcing pypy below :)
+ use low-memory && local EPYTHON=
+ if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] &&
+ { has_version -b dev-python/pypy ||
+ has_version -b dev-python/pypy-bin; }
+ then
+ einfo "Using PyPy to perform the translation."
+ EPYTHON=pypy
+ else
+ einfo "Using ${EPYTHON:-python2} to perform the translation. Please note that upstream"
+ einfo "recommends using PyPy for that. If you wish to do so, please install"
+ einfo "dev-python/pypy and ensure that EPYTHON variable is unset."
+ 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/pypy3.6
+ exeinto "${dest}"
+ newexe "${T}"/usession*-0/testing_1/pypy3-c pypy3-c-${PV}
+ insinto "${dest}"/include/${PV}
+ doins include/pypy_*
+ pax-mark m "${ED}${dest}/pypy3-c-${PV}"
+}