dev-python/pypy-exe: Bump to 7.3.6_rc1

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2021-09-13 22:15:33 +02:00
parent 21b56c15a0
commit 7003c2c7b8
2 changed files with 180 additions and 0 deletions

View File

@@ -1,2 +1,4 @@
DIST pypy2.7-gentoo-patches-7.3.5.tar.xz 6928 BLAKE2B 41aff14411882e60102866a41de6a2c13983d5489c9ed928e2823714883b5cca289c093426fdec35b6df8d17de7a96528d799e10412a0f2f02563e152acf24ea SHA512 f12c1a414cf40e86e9d2a7d1cdfaaacc1045f8043da479b5270ef983ffcf01418a70bbd21ae740abf544091cdc5026bffe467d631242d5e9e0863a64fa8d026b
DIST pypy2.7-gentoo-patches-7.3.6rc1.tar.xz 7904 BLAKE2B 3a5b8efaa67d5a1b4f65a56c6256a3b1efa765079e0fb2c2d380b325175f2e8f3a7d7c4886f734374b6069b3ebf3ac63483f90ada0ece72ff5d8e5c82940c875 SHA512 820d6155e3451b22076719eb3ffc29fab74965761faeade52013d3928fd63cd00b8c5d045f0da0bc1f303a9d2998cd210cd6bec05b2ca01c8b281a61c9a4a73c
DIST pypy2.7-v7.3.5-src.tar.bz2 21572184 BLAKE2B 388b8623c2c5de839dea0e60acc5e11a6a774b4a6cdc051691053a97fe13ec12c6735a4be64015653ef420c0d8af2c79d8faa90a7dfc3042e29f35f4e1ded6c3 SHA512 a30c666c29eec7cca7e2e52f26480958b5885cd59c6b2e3d3c0d8c1cc55c298e878fc95f88e38a4297bb3d7d1cc1f77470de958e5acfd317e1fc8bdd5d013dcb
DIST pypy2.7-v7.3.6rc1-src.tar.bz2 21617621 BLAKE2B 659dd16920b157dae94c5d1f7a9346c7b933ec8c6a3019e36aaa6911bd01d5c9d064a75baa3d8f3df423db4d5a1de5d4f3c8fb63c8d5188d23401b07cc7611be SHA512 f8b949488c3af8acc5533d92238b7bca9ce59c24e93413e0db88094eaf58af5f92a9c9a941f3b7184d2761af2c2c4775891353df053a0762519606a4ce7ca544

View File

@@ -0,0 +1,178 @@
# Copyright 1999-2021 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
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}"
}