commit:     829dccad2b3d9f3b0edc96ba157e3723e84eb2d2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 11 10:06:34 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Feb 11 12:15:59 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=829dccad

dev-python/pypy-exe: Bump to 7.3.8_rc2

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy-exe/Manifest                  |   2 +
 dev-python/pypy-exe/pypy-exe-7.3.8_rc2.ebuild | 178 ++++++++++++++++++++++++++
 2 files changed, 180 insertions(+)

diff --git a/dev-python/pypy-exe/Manifest b/dev-python/pypy-exe/Manifest
index e54c9e8a69a2..7c9c676fd5de 100644
--- a/dev-python/pypy-exe/Manifest
+++ b/dev-python/pypy-exe/Manifest
@@ -1,4 +1,6 @@
 DIST pypy2.7-gentoo-patches-7.3.6.tar.xz 7904 BLAKE2B 
6a809f8f1fd59c18627abaf81b47fa5948d39d5ece86fa416944c1c6585ec5d43b56f4228479a6afdca9788a0ecfdc83fceb4eeea25f289c1dc0b2dbda79b882
 SHA512 
01fe42cdf94b559ed787e253325f7df0add62e30e77c6b6e4c0301c81ff624a31167d95b39d24d72f28441468d571112f424957de38e7f26ecdbfe0f33617296
 DIST pypy2.7-gentoo-patches-7.3.8rc1.tar.xz 7424 BLAKE2B 
931fccd3415e0da7c0fa5a228fc1fec2006a9d12d3523222fc0618a901c161df9f149d09e354029b42ca2144bdeebbd228ec6025574d87d4b630fd0750bc4919
 SHA512 
c193610c46d4b02d1445073f12c3285ce053f5b860584b1c39bff48d5e800c609d40ff0eb91049cdf8f4bfdb4e7bb48d7059de98785e598349022602b97e5f2c
+DIST pypy2.7-gentoo-patches-7.3.8rc2.tar.xz 7424 BLAKE2B 
1d0e7e86cbc08ac3dc6f10fdb887bc4b634a9ac0aeeb39962b5cca85e05122c7dd8548848933d88f62508d3d2032f5f4abe1feea6cf06976659d142d451d0ffb
 SHA512 
62d33bd700c28cd93617d69ccbbb3651fa794378583fdf584b2030f330b3a9bf55fba7d03539baacd9faac02e5d812b481c64b9c3f25cf304d780d162e8c3840
 DIST pypy2.7-v7.3.6-src.tar.bz2 21621891 BLAKE2B 
a2d18ae9d455747484de491df228e7f26af46fc3bc1fd1c16ceba79eba5a3a3272d48312c9da112ae9310722b5af33098f28a7dc15d7ff4760886a8c974692a2
 SHA512 
df914f5e1a1f5ae5c1ea11cd8e29482309af4dce041cf2ae6d7b35a35717fec903be70f56e5f1ddbc9fd370cbe29f6896d25eb2cd10c493c352c80b279070ba3
 DIST pypy2.7-v7.3.8rc1-src.tar.bz2 23267987 BLAKE2B 
035aef49ff0e8b1caed24e87712364ca350fe9f51247eaf732a32458a756264a867ad1270d4edc500daba8dcf70ca8882eb7f381135961f7f48d784ffe8bc6ee
 SHA512 
88184be129ca3698db4e04ae6d241b7c748626870400a100ee2b8bba6ae3c0508071e435adb204bd6b34642ff3c8b0b71643446a3b443cc4467d68591fd53ceb
+DIST pypy2.7-v7.3.8rc2-src.tar.bz2 23272804 BLAKE2B 
5ff559f603f06a44a6149dd898df3351f2de4c42219dbcf6e811e1120079e8979a3edb3c76a01a30400684bb8088eb8e15c0408b6ea0d3762eff87eca41a0021
 SHA512 
ab85b219d43d556d84847af116d3012706264571d6ebdc0b1242195cdc906f9a9073ce5f42e9e5b4a9d1f974fe103b64190c7f3e5b53766443a4b9b938f55d1c

diff --git a/dev-python/pypy-exe/pypy-exe-7.3.8_rc2.ebuild 
b/dev-python/pypy-exe/pypy-exe-7.3.8_rc2.ebuild
new file mode 100644
index 000000000000..e35d87754072
--- /dev/null
+++ b/dev-python/pypy-exe/pypy-exe-7.3.8_rc2.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python2_7 )
+inherit check-reqs pax-utils python-any-r1 toolchain-funcs
+
+PYPY_PV=${PV%_p*}
+MY_P=pypy2.7-v${PYPY_PV/_}
+PATCHSET="pypy2.7-gentoo-patches-${PV/_}"
+
+DESCRIPTION="PyPy executable (build from source)"
+HOMEPAGE="https://www.pypy.org/";
+SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2
+       https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz";
+S="${WORKDIR}/${MY_P}-src"
+
+LICENSE="MIT"
+SLOT="${PYPY_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:${PYPY_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_prepare() {
+       local PATCHES=(
+               "${WORKDIR}/${PATCHSET}"
+       )
+       default
+}
+
+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-${PYPY_PV}
+       insinto "${dest}"/include/${PYPY_PV}
+       doins include/pypy_*
+       pax-mark m "${ED}${dest}/pypy-c-${PYPY_PV}"
+}

Reply via email to