parent
2e95eb6294
commit
8763b5e3ee
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<name>Sven Wegener</name>
|
||||
<email>swegener@gentoo.org</email>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
@ -0,0 +1,8 @@
|
||||
# Copyright 2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit acct-group
|
||||
|
||||
ACCT_GROUP_ID=158
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<name>Sven Wegener</name>
|
||||
<email>swegener@gentoo.org</email>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
@ -0,0 +1,8 @@
|
||||
# Copyright 2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit acct-group
|
||||
|
||||
ACCT_GROUP_ID=157
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<name>Sven Wegener</name>
|
||||
<email>swegener@gentoo.org</email>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
@ -0,0 +1,8 @@
|
||||
# Copyright 2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit acct-group
|
||||
|
||||
ACCT_GROUP_ID=156
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,48 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils
|
||||
|
||||
MY_P=pypy-exe-${PV/_p/-}
|
||||
DESCRIPTION="PyPy executable (pre-built version)"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="
|
||||
amd64? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/amd64/pypy/dev-python/pypy-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.amd64.xpak
|
||||
)
|
||||
x86? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/x86/pypy/dev-python/pypy-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.x86.xpak
|
||||
)"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="${PV%_p*}"
|
||||
KEYWORDS="amd64 x86"
|
||||
|
||||
RDEPEND=">=sys-libs/zlib-1.1.3:0/1
|
||||
dev-libs/libffi:0/7
|
||||
virtual/libintl:0/0
|
||||
dev-libs/expat:0/0
|
||||
app-arch/bzip2:0/1
|
||||
sys-libs/ncurses:0/6
|
||||
!dev-python/pypy-exe:${PV}"
|
||||
|
||||
QA_PREBUILT="
|
||||
usr/lib/pypy2.7/pypy-c-${SLOT}"
|
||||
|
||||
src_unpack() {
|
||||
ebegin "Unpacking ${MY_P}.${ARCH}.xpak"
|
||||
tar -x < <(xz -c -d --single-stream "${DISTDIR}/${MY_P}.${ARCH}.xpak")
|
||||
eend ${?} || die "Unpacking ${MY_P} failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto /
|
||||
doins -r usr
|
||||
fperms +x "/usr/lib/pypy2.7/pypy-c-${SLOT}"
|
||||
pax-mark m "${ED}/usr/lib/pypy2.7/pypy-c-${SLOT}"
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils
|
||||
|
||||
MY_P=pypy-exe-${PV}-1
|
||||
DESCRIPTION="PyPy executable (pre-built version)"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="
|
||||
amd64? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/amd64/pypy/dev-python/pypy-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.amd64.xpak
|
||||
)
|
||||
x86? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/x86/pypy/dev-python/pypy-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.x86.xpak
|
||||
)"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="${PV}"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
RDEPEND=">=sys-libs/zlib-1.1.3:0/1
|
||||
dev-libs/libffi:0/7
|
||||
virtual/libintl:0/0
|
||||
dev-libs/expat:0/0
|
||||
app-arch/bzip2:0/1
|
||||
sys-libs/ncurses:0/6
|
||||
!dev-python/pypy-exe:${PV}"
|
||||
|
||||
QA_PREBUILT="
|
||||
usr/lib/pypy2.7/pypy-c-${SLOT}"
|
||||
|
||||
src_unpack() {
|
||||
ebegin "Unpacking ${MY_P}.${ARCH}.xpak"
|
||||
tar -x < <(xz -c -d --single-stream "${DISTDIR}/${MY_P}.${ARCH}.xpak")
|
||||
eend ${?} || die "Unpacking ${MY_P} failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto /
|
||||
doins -r usr
|
||||
fperms +x "/usr/lib/pypy2.7/pypy-c-${SLOT}"
|
||||
pax-mark m "${ED}/usr/lib/pypy2.7/pypy-c-${SLOT}"
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils
|
||||
|
||||
MY_P=pypy-exe-${PV}-1
|
||||
DESCRIPTION="PyPy executable (pre-built version)"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="
|
||||
amd64? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/amd64/pypy/dev-python/pypy-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.amd64.xpak
|
||||
)
|
||||
x86? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/x86/pypy/dev-python/pypy-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.x86.xpak
|
||||
)"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="${PV}"
|
||||
KEYWORDS=""
|
||||
|
||||
RDEPEND=">=sys-libs/zlib-1.1.3:0/1
|
||||
dev-libs/libffi:0/7
|
||||
virtual/libintl:0/0
|
||||
dev-libs/expat:0/0
|
||||
app-arch/bzip2:0/1
|
||||
sys-libs/ncurses:0/6
|
||||
!dev-python/pypy-exe:${PV}"
|
||||
|
||||
QA_PREBUILT="
|
||||
usr/lib/pypy2.7/pypy-c-${SLOT}"
|
||||
|
||||
src_unpack() {
|
||||
ebegin "Unpacking ${MY_P}.${ARCH}.xpak"
|
||||
tar -x < <(xz -c -d --single-stream "${DISTDIR}/${MY_P}.${ARCH}.xpak")
|
||||
eend ${?} || die "Unpacking ${MY_P} failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto /
|
||||
doins -r usr
|
||||
fperms +x "/usr/lib/pypy2.7/pypy-c-${SLOT}"
|
||||
pax-mark m "${ED}/usr/lib/pypy2.7/pypy-c-${SLOT}"
|
||||
}
|
@ -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
|
||||
|
@ -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}"
|
||||
}
|
@ -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}"
|
||||
}
|
@ -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}"
|
||||
}
|
@ -1,6 +1,2 @@
|
||||
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
|
||||
DIST python-gentoo-patches-2.7.17-r1.tar.xz 14708 BLAKE2B f6e25236a471649de122d0f29506f7a4f34044a568ead47a68980411d9722b761fe1f9d653d5edccb6978b65c8c1eecbef55f403b94f32b37c0ad68e061505a8 SHA512 ecdde5e38c6fe5e69691fb3a68c8f4f43da7857d4abaff763d3cf6ad864ba43c769c03b186b60f2736a1ffb1e3e4c9982715d1b8a99ff3f5740096153bb8a90f
|
||||
DIST python-gentoo-patches-2.7.18-r1.tar.xz 15500 BLAKE2B 7008b29827dbbd80d4ab8f010ccf9efced99c6b4b9109e4430c0ba269ce53529cb6fedd832502c8d2d3aa21938749cc3591c2545b21c0a59a6e60f8598e84ccc SHA512 e656ab07281fd932b92165674619bbf55ecf410d2937ae4ae771d490b4532540498cc731d30d19c1e8aafd1f64df8a406bbfbb46ea985b3dcd8edb89a0b7f20f
|
||||
|
@ -1,388 +0,0 @@
|
||||
From 9bf4611231faa0dc9ae64c6a7a8b55a3290a3ca2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||
Date: Tue, 25 Apr 2017 07:14:11 +0200
|
||||
Subject: [PATCH] Fancy patch for distutils C++ support, rebased for pypy5.7
|
||||
|
||||
http://bugs.python.org/issue1222585
|
||||
http://bugs.gentoo.org/show_bug.cgi?id=599918
|
||||
---
|
||||
_osx_support.py | 10 ++---
|
||||
distutils/cygwinccompiler.py | 21 ++++++++--
|
||||
distutils/emxccompiler.py | 14 +++++--
|
||||
distutils/sysconfig_cpython.py | 26 ++++++++++---
|
||||
distutils/sysconfig_pypy.py | 37 ++++++++++++++----
|
||||
distutils/unixccompiler.py | 55 ++++++++++++++-------------
|
||||
6 files changed, 112 insertions(+), 51 deletions(-)
|
||||
|
||||
diff --git a/_osx_support.py b/_osx_support.py
|
||||
index d2aaae7..8bcdb05 100644
|
||||
--- a/_osx_support.py
|
||||
+++ b/_osx_support.py
|
||||
@@ -14,13 +14,13 @@ __all__ = [
|
||||
# configuration variables that may contain universal build flags,
|
||||
# like "-arch" or "-isdkroot", that may need customization for
|
||||
# the user environment
|
||||
-_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
|
||||
- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
|
||||
- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
|
||||
- 'PY_CORE_CFLAGS')
|
||||
+_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS',
|
||||
+ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED',
|
||||
+ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS',
|
||||
+ 'PY_CPPFLAGS', 'PY_CORE_CFLAGS')
|
||||
|
||||
# configuration variables that may contain compiler calls
|
||||
-_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')
|
||||
+_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX')
|
||||
|
||||
# prefix added to original configuration variable names
|
||||
_INITPRE = '_OSX_SUPPORT_INITIAL_'
|
||||
diff --git a/distutils/cygwinccompiler.py b/distutils/cygwinccompiler.py
|
||||
index 767400c..7133097 100644
|
||||
--- a/distutils/cygwinccompiler.py
|
||||
+++ b/distutils/cygwinccompiler.py
|
||||
@@ -120,8 +120,10 @@ class CygwinCCompiler (UnixCCompiler):
|
||||
# dllwrap 2.10.90 is buggy
|
||||
if self.ld_version >= "2.10.90":
|
||||
self.linker_dll = "gcc"
|
||||
+ self.linker_dll_cxx = "g++"
|
||||
else:
|
||||
self.linker_dll = "dllwrap"
|
||||
+ self.linker_dll_cxx = "dllwrap"
|
||||
|
||||
# ld_version >= "2.13" support -shared so use it instead of
|
||||
# -mdll -static
|
||||
@@ -135,9 +137,13 @@ class CygwinCCompiler (UnixCCompiler):
|
||||
self.set_executables(compiler='gcc -mcygwin -O -Wall',
|
||||
compiler_so='gcc -mcygwin -mdll -O -Wall',
|
||||
compiler_cxx='g++ -mcygwin -O -Wall',
|
||||
+ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall',
|
||||
linker_exe='gcc -mcygwin',
|
||||
linker_so=('%s -mcygwin %s' %
|
||||
- (self.linker_dll, shared_option)))
|
||||
+ (self.linker_dll, shared_option)),
|
||||
+ linker_exe_cxx='g++ -mcygwin',
|
||||
+ linker_so_cxx=('%s -mcygwin %s' %
|
||||
+ (self.linker_dll_cxx, shared_option)))
|
||||
|
||||
# cygwin and mingw32 need different sets of libraries
|
||||
if self.gcc_version == "2.91.57":
|
||||
@@ -163,8 +169,12 @@ class CygwinCCompiler (UnixCCompiler):
|
||||
raise CompileError, msg
|
||||
else: # for other files use the C-compiler
|
||||
try:
|
||||
- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||
- extra_postargs)
|
||||
+ if self.detect_language(src) == 'c++':
|
||||
+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
+ else:
|
||||
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
except DistutilsExecError, msg:
|
||||
raise CompileError, msg
|
||||
|
||||
@@ -330,9 +340,14 @@ class Mingw32CCompiler (CygwinCCompiler):
|
||||
self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
|
||||
compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
|
||||
compiler_cxx='g++%s -O -Wall' % no_cygwin,
|
||||
+ compiler_so_cxx='g++%s -mdll -O -Wall' % no_cygwin,
|
||||
linker_exe='gcc%s' % no_cygwin,
|
||||
linker_so='%s%s %s %s'
|
||||
% (self.linker_dll, no_cygwin,
|
||||
+ shared_option, entry_point),
|
||||
+ linker_exe_cxx='g++%s' % no_cygwin,
|
||||
+ linker_so_cxx='%s%s %s %s'
|
||||
+ % (self.linker_dll_cxx, no_cygwin,
|
||||
shared_option, entry_point))
|
||||
# Maybe we should also append -mthreads, but then the finished
|
||||
# dlls need another dll (mingwm10.dll see Mingw32 docs)
|
||||
diff --git a/distutils/emxccompiler.py b/distutils/emxccompiler.py
|
||||
index a017205..bdc532c 100644
|
||||
--- a/distutils/emxccompiler.py
|
||||
+++ b/distutils/emxccompiler.py
|
||||
@@ -65,8 +65,12 @@ class EMXCCompiler (UnixCCompiler):
|
||||
# XXX optimization, warnings etc. should be customizable.
|
||||
self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||
compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||
+ compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||
+ compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
|
||||
linker_exe='gcc -Zomf -Zmt -Zcrtdll',
|
||||
- linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
|
||||
+ linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll',
|
||||
+ linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll',
|
||||
+ linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll')
|
||||
|
||||
# want the gcc library statically linked (so that we don't have
|
||||
# to distribute a version dependent on the compiler we have)
|
||||
@@ -83,8 +87,12 @@ class EMXCCompiler (UnixCCompiler):
|
||||
raise CompileError, msg
|
||||
else: # for other files use the C-compiler
|
||||
try:
|
||||
- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||
- extra_postargs)
|
||||
+ if self.detect_language(src) == 'c++':
|
||||
+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
+ else:
|
||||
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
except DistutilsExecError, msg:
|
||||
raise CompileError, msg
|
||||
|
||||
diff --git a/distutils/sysconfig_cpython.py b/distutils/sysconfig_cpython.py
|
||||
index 35f39e4..8dd032d 100644
|
||||
--- a/distutils/sysconfig_cpython.py
|
||||
+++ b/distutils/sysconfig_cpython.py
|
||||
@@ -171,10 +171,12 @@ def customize_compiler(compiler):
|
||||
_osx_support.customize_compiler(_config_vars)
|
||||
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
|
||||
|
||||
- (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
|
||||
- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
|
||||
- 'CCSHARED', 'LDSHARED', 'SO', 'AR',
|
||||
- 'ARFLAGS')
|
||||
+ (cc, cxx, ccshared, ldshared, ldcxxshared, so_ext, ar, ar_flags) = \
|
||||
+ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
|
||||
+ 'SO', 'AR', 'ARFLAGS')
|
||||
+
|
||||
+ cflags = ''
|
||||
+ cxxflags = ''
|
||||
|
||||
if 'CC' in os.environ:
|
||||
newcc = os.environ['CC']
|
||||
@@ -189,19 +191,27 @@ def customize_compiler(compiler):
|
||||
cxx = os.environ['CXX']
|
||||
if 'LDSHARED' in os.environ:
|
||||
ldshared = os.environ['LDSHARED']
|
||||
+ if 'LDCXXSHARED' in os.environ:
|
||||
+ ldcxxshared = os.environ['LDCXXSHARED']
|
||||
if 'CPP' in os.environ:
|
||||
cpp = os.environ['CPP']
|
||||
else:
|
||||
cpp = cc + " -E" # not always
|
||||
if 'LDFLAGS' in os.environ:
|
||||
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
|
||||
if 'CFLAGS' in os.environ:
|
||||
- cflags = opt + ' ' + os.environ['CFLAGS']
|
||||
+ cflags = os.environ['CFLAGS']
|
||||
ldshared = ldshared + ' ' + os.environ['CFLAGS']
|
||||
+ if 'CXXFLAGS' in os.environ:
|
||||
+ cxxflags = os.environ['CXXFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
|
||||
if 'CPPFLAGS' in os.environ:
|
||||
cpp = cpp + ' ' + os.environ['CPPFLAGS']
|
||||
cflags = cflags + ' ' + os.environ['CPPFLAGS']
|
||||
+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
|
||||
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
|
||||
if 'AR' in os.environ:
|
||||
ar = os.environ['AR']
|
||||
if 'ARFLAGS' in os.environ:
|
||||
@@ -210,13 +220,17 @@ def customize_compiler(compiler):
|
||||
archiver = ar + ' ' + ar_flags
|
||||
|
||||
cc_cmd = cc + ' ' + cflags
|
||||
+ cxx_cmd = cxx + ' ' + cxxflags
|
||||
compiler.set_executables(
|
||||
preprocessor=cpp,
|
||||
compiler=cc_cmd,
|
||||
compiler_so=cc_cmd + ' ' + ccshared,
|
||||
- compiler_cxx=cxx,
|
||||
+ compiler_cxx=cxx_cmd,
|
||||
+ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
|
||||
linker_so=ldshared,
|
||||
linker_exe=cc,
|
||||
+ linker_so_cxx=ldcxxshared,
|
||||
+ linker_exe_cxx=cxx,
|
||||
archiver=archiver)
|
||||
|
||||
compiler.shared_lib_extension = so_ext
|
||||
diff --git a/distutils/sysconfig_pypy.py b/distutils/sysconfig_pypy.py
|
||||
index 368f232..4fe1f08 100644
|
||||
--- a/distutils/sysconfig_pypy.py
|
||||
+++ b/distutils/sysconfig_pypy.py
|
||||
@@ -67,6 +67,7 @@ def _init_posix():
|
||||
g['CFLAGS'] = "-DNDEBUG -O2"
|
||||
g['CCSHARED'] = "-fPIC"
|
||||
g['LDSHARED'] = "cc -pthread -shared"
|
||||
+ g['LDCXXSHARED'] = "c++ -pthread -shared"
|
||||
g['SO'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION][0]
|
||||
g['AR'] = "ar"
|
||||
g['ARFLAGS'] = "rc"
|
||||
@@ -85,6 +86,7 @@ def _init_posix():
|
||||
# just a guess
|
||||
arch = platform.machine()
|
||||
g['LDSHARED'] += ' -undefined dynamic_lookup'
|
||||
+ g['LDCXXSHARED'] += ' -undefined dynamic_lookup'
|
||||
g['CC'] += ' -arch %s' % (arch,)
|
||||
|
||||
global _config_vars
|
||||
@@ -168,37 +170,52 @@ def customize_compiler(compiler):
|
||||
_osx_support.customize_compiler(_config_vars)
|
||||
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
|
||||
|
||||
- (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
|
||||
- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
|
||||
- 'CCSHARED', 'LDSHARED', 'SO', 'AR',
|
||||
- 'ARFLAGS')
|
||||
+ (cc, cxx, ccshared, ldshared, ldcxxshared, so_ext, ar, ar_flags) = \
|
||||
+ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
|
||||
+ 'SO', 'AR', 'ARFLAGS')
|
||||
+
|
||||
+ cflags = ''
|
||||
+ cxxflags = ''
|
||||
|
||||
if 'CC' in os.environ:
|
||||
newcc = os.environ['CC']
|
||||
- if (sys.platform == 'darwin'
|
||||
+ if (True
|
||||
and 'LDSHARED' not in os.environ
|
||||
and ldshared.startswith(cc)):
|
||||
# On OS X, if CC is overridden, use that as the default
|
||||
# command for LDSHARED as well
|
||||
+ # Gentoo: s/OS X/every system/
|
||||
ldshared = newcc + ldshared[len(cc):]
|
||||
cc = newcc
|
||||
if 'CXX' in os.environ:
|
||||
- cxx = os.environ['CXX']
|
||||
+ newcxx = os.environ['CXX']
|
||||
+ if ('LDCXXSHARED' not in os.environ
|
||||
+ and ldcxxshared.startswith(cxx)):
|
||||
+ ldcxxshared = newcxx + ldcxxshared[len(cxx):]
|
||||
+ cxx = newcxx
|
||||
if 'LDSHARED' in os.environ:
|
||||
ldshared = os.environ['LDSHARED']
|
||||
+ if 'LDCXXSHARED' in os.environ:
|
||||
+ ldcxxshared = os.environ['LDCXXSHARED']
|
||||
if 'CPP' in os.environ:
|
||||
cpp = os.environ['CPP']
|
||||
else:
|
||||
cpp = cc + " -E" # not always
|
||||
if 'LDFLAGS' in os.environ:
|
||||
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
|
||||
if 'CFLAGS' in os.environ:
|
||||
- cflags = opt + ' ' + os.environ['CFLAGS']
|
||||
+ cflags = os.environ['CFLAGS']
|
||||
ldshared = ldshared + ' ' + os.environ['CFLAGS']
|
||||
+ if 'CXXFLAGS' in os.environ:
|
||||
+ cxxflags = os.environ['CXXFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
|
||||
if 'CPPFLAGS' in os.environ:
|
||||
cpp = cpp + ' ' + os.environ['CPPFLAGS']
|
||||
cflags = cflags + ' ' + os.environ['CPPFLAGS']
|
||||
+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
|
||||
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
|
||||
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
|
||||
if 'AR' in os.environ:
|
||||
ar = os.environ['AR']
|
||||
if 'ARFLAGS' in os.environ:
|
||||
@@ -207,13 +224,17 @@ def customize_compiler(compiler):
|
||||
archiver = ar + ' ' + ar_flags
|
||||
|
||||
cc_cmd = cc + ' ' + cflags
|
||||
+ cxx_cmd = cxx + ' ' + cxxflags
|
||||
compiler.set_executables(
|
||||
preprocessor=cpp,
|
||||
compiler=cc_cmd,
|
||||
compiler_so=cc_cmd + ' ' + ccshared,
|
||||
- compiler_cxx=cxx,
|
||||
+ compiler_cxx=cxx_cmd,
|
||||
+ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
|
||||
linker_so=ldshared,
|
||||
linker_exe=cc,
|
||||
+ linker_so_cxx=ldcxxshared,
|
||||
+ linker_exe_cxx=cxx,
|
||||
archiver=archiver)
|
||||
|
||||
compiler.shared_lib_extension = so_ext
|
||||
diff --git a/distutils/unixccompiler.py b/distutils/unixccompiler.py
|
||||
index dee88a5..558b568 100644
|
||||
--- a/distutils/unixccompiler.py
|
||||
+++ b/distutils/unixccompiler.py
|
||||
@@ -55,14 +55,17 @@ class UnixCCompiler(CCompiler):
|
||||
# are pretty generic; they will probably have to be set by an outsider
|
||||
# (eg. using information discovered by the sysconfig about building
|
||||
# Python extensions).
|
||||
- executables = {'preprocessor' : None,
|
||||
- 'compiler' : ["cc"],
|
||||
- 'compiler_so' : ["cc"],
|
||||
- 'compiler_cxx' : ["c++"], # pypy: changed, 'cc' is bogus
|
||||
- 'linker_so' : ["cc", "-shared"],
|
||||
- 'linker_exe' : ["cc"],
|
||||
- 'archiver' : ["ar", "-cr"],
|
||||
- 'ranlib' : None,
|
||||
+ executables = {'preprocessor' : None,
|
||||
+ 'compiler' : ["cc"],
|
||||
+ 'compiler_so' : ["cc"],
|
||||
+ 'compiler_cxx' : ["c++"],
|
||||
+ 'compiler_so_cxx' : ["c++"],
|
||||
+ 'linker_so' : ["cc", "-shared"],
|
||||
+ 'linker_exe' : ["cc"],
|
||||
+ 'linker_so_cxx' : ["c++", "-shared"],
|
||||
+ 'linker_exe_cxx' : ["c++"],
|
||||
+ 'archiver' : ["ar", "-cr"],
|
||||
+ 'ranlib' : None,
|
||||
}
|
||||
|
||||
if sys.platform[:6] == "darwin":
|
||||
@@ -129,12 +132,19 @@ class UnixCCompiler(CCompiler):
|
||||
|
||||
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
|
||||
compiler_so = self.compiler_so
|
||||
+ compiler_so_cxx = self.compiler_so_cxx
|
||||
if sys.platform == 'darwin':
|
||||
compiler_so = _osx_support.compiler_fixup(compiler_so,
|
||||
cc_args + extra_postargs)
|
||||
+ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx,
|
||||
+ cc_args + extra_postargs)
|
||||
try:
|
||||
- self.spawn(compiler_so + cc_args + [src, '-o', obj] +
|
||||
- extra_postargs)
|
||||
+ if self.detect_language(src) == 'c++':
|
||||
+ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
+ else:
|
||||
+ self.spawn(compiler_so + cc_args + [src, '-o', obj] +
|
||||
+ extra_postargs)
|
||||
except DistutilsExecError, msg:
|
||||
raise CompileError, msg
|
||||
|
||||
@@ -191,23 +201,16 @@ class UnixCCompiler(CCompiler):
|
||||
ld_args.extend(extra_postargs)
|
||||
self.mkpath(os.path.dirname(output_filename))
|
||||
try:
|
||||
- if target_desc == CCompiler.EXECUTABLE:
|
||||
- linker = self.linker_exe[:]
|
||||
+ if target_lang == "c++":
|
||||
+ if target_desc == CCompiler.EXECUTABLE:
|
||||
+ linker = self.linker_exe_cxx[:]
|
||||
+ else:
|
||||
+ linker = self.linker_so_cxx[:]
|
||||
else:
|
||||
- linker = self.linker_so[:]
|
||||
- if target_lang == "c++" and self.compiler_cxx:
|
||||
- # skip over environment variable settings if /usr/bin/env
|
||||
- # is used to set up the linker's environment.
|
||||
- # This is needed on OSX. Note: this assumes that the
|
||||
- # normal and C++ compiler have the same environment
|
||||
- # settings.
|
||||
- i = 0
|
||||
- if os.path.basename(linker[0]) == "env":
|
||||
- i = 1
|
||||
- while '=' in linker[i]:
|
||||
- i = i + 1
|
||||
-
|
||||
- linker[i] = self.compiler_cxx[i]
|
||||
+ if target_desc == CCompiler.EXECUTABLE:
|
||||
+ linker = self.linker_exe[:]
|
||||
+ else:
|
||||
+ linker = self.linker_so[:]
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
linker = _osx_support.compiler_fixup(linker, ld_args)
|
||||
--
|
||||
2.12.2
|
||||
|
@ -1,182 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils python-utils-r1
|
||||
|
||||
MY_P=pypy2.7-v${PV/_/}
|
||||
# note: remember to update this to newest dev-lang/python:2.7 on bump
|
||||
PATCHSET="python-gentoo-patches-2.7.17-r1"
|
||||
|
||||
DESCRIPTION="A fast, compliant alternative implementation of the Python language"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="https://downloads.python.org/pypy/${MY_P}-src.tar.bz2
|
||||
https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz"
|
||||
S="${WORKDIR}/${MY_P}-src"
|
||||
|
||||
LICENSE="MIT"
|
||||
# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
|
||||
SLOT="0/73"
|
||||
KEYWORDS="amd64 ~ppc64 x86 ~amd64-linux ~x86-linux"
|
||||
IUSE="bzip2 gdbm +jit libressl ncurses sqlite tk"
|
||||
|
||||
RDEPEND="
|
||||
|| (
|
||||
dev-python/pypy-exe:${PV}[bzip2?,ncurses?]
|
||||
dev-python/pypy-exe-bin:${PV}
|
||||
)
|
||||
!libressl? ( dev-libs/openssl:0= )
|
||||
libressl? ( dev-libs/libressl:0= )
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!<dev-python/pypy-bin-7.3.0:0"
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
src_prepare() {
|
||||
eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
|
||||
eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
|
||||
|
||||
sed -e "s^@EPREFIX@^${EPREFIX}^" \
|
||||
-i lib-python/2.7/distutils/command/install.py || die
|
||||
|
||||
# apply CPython stdlib patches
|
||||
pushd lib-python/2.7 > /dev/null || die
|
||||
# TODO: cpy turkish locale patch now fixes C code
|
||||
# probably needs better port to pypy, if it is broken there
|
||||
eapply "${FILESDIR}"/5.8.0_all_distutils_cxx.patch
|
||||
eapply -p2 "${WORKDIR}/${PATCHSET}"/0010-use_pyxml.patch
|
||||
popd > /dev/null || die
|
||||
|
||||
# this test relies on pypy-c hardcoding correct build time paths
|
||||
sed -i -e 's:test_executable_without_cwd:_&:' \
|
||||
lib-python/2.7/test/test_subprocess.py || die
|
||||
# broken upstream
|
||||
# see http://buildbot.pypy.org/summary?branch=%3Ctrunk%3E
|
||||
sed -i -e 's:test_alpn_protocols:_&:' \
|
||||
-e 's:test_default_ecdh_curve:_&:' \
|
||||
lib-python/2.7/test/test_ssl.py || die
|
||||
# requires Internet
|
||||
sed -i -e '/class NetworkedTests/i@unittest.skip("Requires networking")' \
|
||||
lib-python/2.7/test/test_ssl.py || die
|
||||
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# copy over to make sys.prefix happy
|
||||
cp -p "${BROOT}"/usr/lib/pypy2.7/pypy-c-${PV} pypy-c || die
|
||||
cp -p "${BROOT}"/usr/lib/pypy2.7/include/${PV}/* include/ || die
|
||||
# (not installed by pypy)
|
||||
rm pypy/module/cpyext/include/_numpypy/numpy/README || die
|
||||
mv pypy/module/cpyext/include/* include/ || die
|
||||
mv pypy/module/cpyext/parse/*.h include/ || die
|
||||
pax-mark m pypy-c
|
||||
|
||||
einfo "Generating caches and CFFI modules ..."
|
||||
|
||||
# Generate Grammar and PatternGrammar pickles.
|
||||
./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
|
||||
|| die "Generation of Grammar and PatternGrammar pickles failed"
|
||||
|
||||
# Generate cffi modules
|
||||
# Please keep in sync with pypy/tool/build_cffi_imports.py!
|
||||
#cffi_build_scripts = {
|
||||
# "_ssl": "_ssl_build.py",
|
||||
# "sqlite3": "_sqlite3_build.py",
|
||||
# "audioop": "_audioop_build.py",
|
||||
# "tk": "_tkinter/tklib_build.py",
|
||||
# "curses": "_curses_build.py" if sys.platform != "win32" else None,
|
||||
# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
|
||||
# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
|
||||
# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
|
||||
# "resource": "_resource_build.py" if sys.platform != "win32" else None,
|
||||
cffi_targets=( ssl audioop syslog pwdgrp resource )
|
||||
use gdbm && cffi_targets+=( gdbm )
|
||||
use ncurses && cffi_targets+=( curses )
|
||||
use sqlite && cffi_targets+=( sqlite3 )
|
||||
use tk && cffi_targets+=( tkinter/tklib )
|
||||
|
||||
local t
|
||||
# all modules except tkinter output to .
|
||||
# tkinter outputs to the correct dir ...
|
||||
cd lib_pypy || die
|
||||
for t in "${cffi_targets[@]}"; do
|
||||
# tkinter doesn't work via -m
|
||||
../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
|
||||
done
|
||||
|
||||
# Cleanup temporary objects
|
||||
find -name "_cffi_*.[co]" -delete || die
|
||||
find -type d -empty -delete || die
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# (unset)
|
||||
local -x PYTHONDONTWRITEBYTECODE=
|
||||
|
||||
local ignored_tests=(
|
||||
# network
|
||||
--ignore=lib-python/2.7/test/test_urllibnet.py
|
||||
--ignore=lib-python/2.7/test/test_urllib2net.py
|
||||
# lots of free space
|
||||
--ignore=lib-python/2.7/test/test_zipfile64.py
|
||||
# no module named 'worker' -- a lot
|
||||
--ignore=lib-python/2.7/test/test_xpickle.py
|
||||
)
|
||||
|
||||
./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
|
||||
"${ignored_tests[@]}" lib-python || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest=/usr/lib/pypy2.7
|
||||
einfo "Installing PyPy ..."
|
||||
dosym pypy-c-${PV} "${dest}/pypy-c"
|
||||
insinto "${dest}"
|
||||
# preserve mtimes to avoid obsoleting caches
|
||||
insopts -p
|
||||
doins -r include lib_pypy lib-python
|
||||
|
||||
# replace copied headers with symlinks
|
||||
for x in "${BROOT}"/usr/lib/pypy2.7/include/${PV}/*; do
|
||||
dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
|
||||
done
|
||||
|
||||
dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
|
||||
dodoc README.rst
|
||||
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
|
||||
"${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
|
||||
"${ED}${dest}"/lib_pypy/_sqlite3.py \
|
||||
"${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
|
||||
"${ED}${dest}"/lib_pypy/_tkinter \
|
||||
"${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
|
||||
local -x EPYTHON=pypy
|
||||
local -x PYTHON=${ED}${dest}/pypy-c-${PV}
|
||||
# temporarily copy to build tree to facilitate module builds
|
||||
cp -p "${BROOT}${dest}/pypy-c-${PV}" "${PYTHON}" || die
|
||||
|
||||
echo "EPYTHON='${EPYTHON}'" > epython.py || die
|
||||
python_moduleinto /usr/lib/pypy2.7/site-packages
|
||||
python_domodule epython.py
|
||||
|
||||
einfo "Byte-compiling Python standard library..."
|
||||
python_optimize "${ED}${dest}"
|
||||
|
||||
# remove to avoid collisions
|
||||
rm "${PYTHON}" || die
|
||||
}
|
@ -1,175 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils python-utils-r1
|
||||
|
||||
MY_P=pypy2.7-v${PV/_/}
|
||||
# note: remember to update this to newest dev-lang/python:2.7 on bump
|
||||
PATCHSET="python-gentoo-patches-2.7.18-r1"
|
||||
|
||||
DESCRIPTION="A fast, compliant alternative implementation of the Python language"
|
||||
HOMEPAGE="https://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"
|
||||
# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
|
||||
SLOT="0/73"
|
||||
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
|
||||
IUSE="bzip2 gdbm +jit libressl ncurses sqlite tk"
|
||||
|
||||
RDEPEND="
|
||||
|| (
|
||||
dev-python/pypy-exe:${PV}[bzip2?,ncurses?]
|
||||
dev-python/pypy-exe-bin:${PV}
|
||||
)
|
||||
!libressl? ( dev-libs/openssl:0= )
|
||||
libressl? ( dev-libs/libressl:0= )
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!<dev-python/pypy-bin-7.3.0:0"
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
src_prepare() {
|
||||
eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
|
||||
eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
|
||||
|
||||
sed -e "s^@EPREFIX@^${EPREFIX}^" \
|
||||
-i lib-python/2.7/distutils/command/install.py || die
|
||||
|
||||
# apply CPython stdlib patches
|
||||
pushd lib-python/2.7 > /dev/null || die
|
||||
# TODO: cpy turkish locale patch now fixes C code
|
||||
# probably needs better port to pypy, if it is broken there
|
||||
eapply "${FILESDIR}"/5.8.0_all_distutils_cxx.patch
|
||||
eapply -p2 "${WORKDIR}/${PATCHSET}"/0010-use_pyxml.patch
|
||||
popd > /dev/null || die
|
||||
|
||||
# this test relies on pypy-c hardcoding correct build time paths
|
||||
sed -i -e 's:test_executable_without_cwd:_&:' \
|
||||
lib-python/2.7/test/test_subprocess.py || die
|
||||
# requires Internet
|
||||
sed -i -e '/class NetworkedTests/i@unittest.skip("Requires networking")' \
|
||||
lib-python/2.7/test/test_ssl.py || die
|
||||
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# copy over to make sys.prefix happy
|
||||
cp -p "${BROOT}"/usr/lib/pypy2.7/pypy-c-${PV} pypy-c || die
|
||||
cp -p "${BROOT}"/usr/lib/pypy2.7/include/${PV}/* include/ || die
|
||||
# (not installed by pypy)
|
||||
rm pypy/module/cpyext/include/_numpypy/numpy/README || die
|
||||
mv pypy/module/cpyext/include/* include/ || die
|
||||
mv pypy/module/cpyext/parse/*.h include/ || die
|
||||
pax-mark m pypy-c
|
||||
|
||||
einfo "Generating caches and CFFI modules ..."
|
||||
|
||||
# Generate Grammar and PatternGrammar pickles.
|
||||
./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
|
||||
|| die "Generation of Grammar and PatternGrammar pickles failed"
|
||||
|
||||
# Generate cffi modules
|
||||
# Please keep in sync with pypy/tool/build_cffi_imports.py!
|
||||
#cffi_build_scripts = {
|
||||
# "_ssl": "_ssl_build.py",
|
||||
# "sqlite3": "_sqlite3_build.py",
|
||||
# "audioop": "_audioop_build.py",
|
||||
# "tk": "_tkinter/tklib_build.py",
|
||||
# "curses": "_curses_build.py" if sys.platform != "win32" else None,
|
||||
# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
|
||||
# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
|
||||
# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
|
||||
# "resource": "_resource_build.py" if sys.platform != "win32" else None,
|
||||
cffi_targets=( ssl audioop syslog pwdgrp resource )
|
||||
use gdbm && cffi_targets+=( gdbm )
|
||||
use ncurses && cffi_targets+=( curses )
|
||||
use sqlite && cffi_targets+=( sqlite3 )
|
||||
use tk && cffi_targets+=( tkinter/tklib )
|
||||
|
||||
local t
|
||||
# all modules except tkinter output to .
|
||||
# tkinter outputs to the correct dir ...
|
||||
cd lib_pypy || die
|
||||
for t in "${cffi_targets[@]}"; do
|
||||
# tkinter doesn't work via -m
|
||||
../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
|
||||
done
|
||||
|
||||
# Cleanup temporary objects
|
||||
find -name "_cffi_*.[co]" -delete || die
|
||||
find -type d -empty -delete || die
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# (unset)
|
||||
local -x PYTHONDONTWRITEBYTECODE=
|
||||
|
||||
local ignored_tests=(
|
||||
# network
|
||||
--ignore=lib-python/2.7/test/test_urllibnet.py
|
||||
--ignore=lib-python/2.7/test/test_urllib2net.py
|
||||
# lots of free space
|
||||
--ignore=lib-python/2.7/test/test_zipfile64.py
|
||||
)
|
||||
|
||||
./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
|
||||
"${ignored_tests[@]}" lib-python || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest=/usr/lib/pypy2.7
|
||||
einfo "Installing PyPy ..."
|
||||
dosym pypy-c-${PV} "${dest}/pypy-c"
|
||||
insinto "${dest}"
|
||||
# preserve mtimes to avoid obsoleting caches
|
||||
insopts -p
|
||||
doins -r include lib_pypy lib-python
|
||||
|
||||
# replace copied headers with symlinks
|
||||
for x in "${BROOT}"/usr/lib/pypy2.7/include/${PV}/*; do
|
||||
dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
|
||||
done
|
||||
|
||||
dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
|
||||
dodoc README.rst
|
||||
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
|
||||
"${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
|
||||
"${ED}${dest}"/lib_pypy/_sqlite3.py \
|
||||
"${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
|
||||
"${ED}${dest}"/lib_pypy/_tkinter \
|
||||
"${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
|
||||
local -x EPYTHON=pypy
|
||||
local -x PYTHON=${ED}${dest}/pypy-c-${PV}
|
||||
# temporarily copy to build tree to facilitate module builds
|
||||
cp -p "${BROOT}${dest}/pypy-c-${PV}" "${PYTHON}" || die
|
||||
|
||||
echo "EPYTHON='${EPYTHON}'" > epython.py || die
|
||||
python_moduleinto /usr/lib/pypy2.7/site-packages
|
||||
python_domodule epython.py
|
||||
|
||||
einfo "Byte-compiling Python standard library..."
|
||||
python_optimize "${ED}${dest}"
|
||||
|
||||
# remove to avoid collisions
|
||||
rm "${PYTHON}" || die
|
||||
}
|
@ -1,176 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils python-utils-r1
|
||||
|
||||
MY_P=pypy2.7-v${PV/_/}
|
||||
# note: remember to update this to newest dev-lang/python:2.7 on bump
|
||||
PATCHSET="python-gentoo-patches-2.7.18-r1"
|
||||
|
||||
DESCRIPTION="A fast, compliant alternative implementation of the Python language"
|
||||
HOMEPAGE="https://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"
|
||||
# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
|
||||
SLOT="0/73"
|
||||
KEYWORDS=""
|
||||
IUSE="bzip2 gdbm +jit libressl ncurses sqlite tk"
|
||||
|
||||
RDEPEND="
|
||||
|| (
|
||||
dev-python/pypy-exe:${PV}[bzip2?,ncurses?]
|
||||
dev-python/pypy-exe-bin:${PV}
|
||||
)
|
||||
!libressl? ( dev-libs/openssl:0= )
|
||||
libressl? ( dev-libs/libressl:0= )
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!<dev-python/pypy-bin-7.3.0:0"
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
src_prepare() {
|
||||
eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
|
||||
eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
|
||||
eapply "${FILESDIR}/7.3.3-distutils-cxx.patch"
|
||||
|
||||
sed -e "s^@EPREFIX@^${EPREFIX}^" \
|
||||
-i lib-python/2.7/distutils/command/install.py || die
|
||||
|
||||
# apply CPython stdlib patches
|
||||
pushd lib-python/2.7 > /dev/null || die
|
||||
# TODO: cpy turkish locale patch now fixes C code
|
||||
# probably needs better port to pypy, if it is broken there
|
||||
eapply -p2 "${WORKDIR}/${PATCHSET}"/0010-use_pyxml.patch
|
||||
popd > /dev/null || die
|
||||
|
||||
# this test relies on pypy-c hardcoding correct build time paths
|
||||
sed -i -e 's:test_executable_without_cwd:_&:' \
|
||||
lib-python/2.7/test/test_subprocess.py || die
|
||||
# requires Internet
|
||||
sed -i -e '/class NetworkedTests/i@unittest.skip("Requires networking")' \
|
||||
lib-python/2.7/test/test_ssl.py || die
|
||||
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# copy over to make sys.prefix happy
|
||||
cp -p "${BROOT}"/usr/lib/pypy2.7/pypy-c-${PV} pypy-c || die
|
||||
cp -p "${BROOT}"/usr/lib/pypy2.7/include/${PV}/* include/ || die
|
||||
# (not installed by pypy)
|
||||
rm pypy/module/cpyext/include/_numpypy/numpy/README || die
|
||||
mv pypy/module/cpyext/include/* include/ || die
|
||||
mv pypy/module/cpyext/parse/*.h include/ || die
|
||||
pax-mark m pypy-c
|
||||
|
||||
einfo "Generating caches and CFFI modules ..."
|
||||
|
||||
# Generate Grammar and PatternGrammar pickles.
|
||||
./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
|
||||
|| die "Generation of Grammar and PatternGrammar pickles failed"
|
||||
|
||||
# Generate cffi modules
|
||||
# Please keep in sync with pypy/tool/build_cffi_imports.py!
|
||||
#cffi_build_scripts = {
|
||||
# "_ssl": "_ssl_build.py",
|
||||
# "sqlite3": "_sqlite3_build.py",
|
||||
# "audioop": "_audioop_build.py",
|
||||
# "tk": "_tkinter/tklib_build.py",
|
||||
# "curses": "_curses_build.py" if sys.platform != "win32" else None,
|
||||
# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
|
||||
# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
|
||||
# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
|
||||
# "resource": "_resource_build.py" if sys.platform != "win32" else None,
|
||||
cffi_targets=( ssl audioop syslog pwdgrp resource )
|
||||
use gdbm && cffi_targets+=( gdbm )
|
||||
use ncurses && cffi_targets+=( curses )
|
||||
use sqlite && cffi_targets+=( sqlite3 )
|
||||
use tk && cffi_targets+=( tkinter/tklib )
|
||||
|
||||
local t
|
||||
# all modules except tkinter output to .
|
||||
# tkinter outputs to the correct dir ...
|
||||
cd lib_pypy || die
|
||||
for t in "${cffi_targets[@]}"; do
|
||||
# tkinter doesn't work via -m
|
||||
../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
|
||||
done
|
||||
|
||||
# Cleanup temporary objects
|
||||
find -name "_cffi_*.[co]" -delete || die
|
||||
find -type d -empty -delete || die
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# (unset)
|
||||
local -x PYTHONDONTWRITEBYTECODE=
|
||||
local -x COLUMNS=80
|
||||
|
||||
local ignored_tests=(
|
||||
# network
|
||||
--ignore=lib-python/2.7/test/test_urllibnet.py
|
||||
--ignore=lib-python/2.7/test/test_urllib2net.py
|
||||
# lots of free space
|
||||
--ignore=lib-python/2.7/test/test_zipfile64.py
|
||||
)
|
||||
|
||||
./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
|
||||
"${ignored_tests[@]}" lib-python || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest=/usr/lib/pypy2.7
|
||||
einfo "Installing PyPy ..."
|
||||
dosym pypy-c-${PV} "${dest}/pypy-c"
|
||||
insinto "${dest}"
|
||||
# preserve mtimes to avoid obsoleting caches
|
||||
insopts -p
|
||||
doins -r include lib_pypy lib-python
|
||||
|
||||
# replace copied headers with symlinks
|
||||
for x in "${BROOT}"/usr/lib/pypy2.7/include/${PV}/*; do
|
||||
dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
|
||||
done
|
||||
|
||||
dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
|
||||
dodoc README.rst
|
||||
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
|
||||
"${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
|
||||
"${ED}${dest}"/lib_pypy/_sqlite3.py \
|
||||
"${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
|
||||
"${ED}${dest}"/lib_pypy/_tkinter \
|
||||
"${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
|
||||
local -x EPYTHON=pypy
|
||||
local -x PYTHON=${ED}${dest}/pypy-c-${PV}
|
||||
# temporarily copy to build tree to facilitate module builds
|
||||
cp -p "${BROOT}${dest}/pypy-c-${PV}" "${PYTHON}" || die
|
||||
|
||||
echo "EPYTHON='${EPYTHON}'" > epython.py || die
|
||||
python_moduleinto /usr/lib/pypy2.7/site-packages
|
||||
python_domodule epython.py
|
||||
|
||||
einfo "Byte-compiling Python standard library..."
|
||||
python_optimize "${ED}${dest}"
|
||||
|
||||
# remove to avoid collisions
|
||||
rm "${PYTHON}" || die
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils
|
||||
|
||||
MY_P=pypy3-exe-${PV/_p/-}
|
||||
DESCRIPTION="PyPy3 executable (pre-built version)"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="
|
||||
amd64? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/amd64/pypy/dev-python/pypy3-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.amd64.xpak
|
||||
)
|
||||
x86? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/x86/pypy/dev-python/pypy3-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.x86.xpak
|
||||
)"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="${PV%_p*}"
|
||||
KEYWORDS="amd64 x86"
|
||||
|
||||
RDEPEND=">=sys-libs/zlib-1.1.3:0/1
|
||||
dev-libs/libffi:0/7
|
||||
virtual/libintl:0/0
|
||||
dev-libs/expat:0/0
|
||||
app-arch/bzip2:0/1
|
||||
sys-libs/ncurses:0/6
|
||||
!dev-python/pypy-exe:${PV}"
|
||||
|
||||
QA_PREBUILT="
|
||||
usr/lib/pypy3.6/pypy3-c-${SLOT}"
|
||||
|
||||
src_unpack() {
|
||||
ebegin "Unpacking ${MY_P}.${ARCH}.xpak"
|
||||
tar -x < <(xz -c -d --single-stream "${DISTDIR}/${MY_P}.${ARCH}.xpak")
|
||||
eend ${?} || die "Unpacking ${MY_P} failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto /
|
||||
doins -r usr
|
||||
fperms +x "/usr/lib/pypy3.6/pypy3-c-${SLOT}"
|
||||
pax-mark m "${ED}/usr/lib/pypy3.6/pypy3-c-${SLOT}"
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils
|
||||
|
||||
MY_P=pypy3-exe-${PV}-r1-1
|
||||
DESCRIPTION="PyPy3 executable (pre-built version)"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="
|
||||
amd64? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/amd64/pypy/dev-python/pypy3-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.amd64.xpak
|
||||
)
|
||||
x86? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/x86/pypy/dev-python/pypy3-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.x86.xpak
|
||||
)"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="${PV}"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
RDEPEND=">=sys-libs/zlib-1.1.3:0/1
|
||||
dev-libs/libffi:0/7
|
||||
virtual/libintl:0/0
|
||||
dev-libs/expat:0/0
|
||||
app-arch/bzip2:0/1
|
||||
sys-libs/ncurses:0/6
|
||||
!dev-python/pypy-exe:${PV}"
|
||||
|
||||
QA_PREBUILT="
|
||||
usr/lib/pypy3.6/pypy3-c-${SLOT}"
|
||||
|
||||
src_unpack() {
|
||||
ebegin "Unpacking ${MY_P}.${ARCH}.xpak"
|
||||
tar -x < <(xz -c -d --single-stream "${DISTDIR}/${MY_P}.${ARCH}.xpak")
|
||||
eend ${?} || die "Unpacking ${MY_P} failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto /
|
||||
doins -r usr
|
||||
fperms +x "/usr/lib/pypy3.6/pypy3-c-${SLOT}"
|
||||
pax-mark m "${ED}/usr/lib/pypy3.6/pypy3-c-${SLOT}"
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils
|
||||
|
||||
MY_P=pypy3-exe-${PV}-r1-1
|
||||
DESCRIPTION="PyPy3 executable (pre-built version)"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="
|
||||
amd64? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/amd64/pypy/dev-python/pypy3-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.amd64.xpak
|
||||
)
|
||||
x86? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/x86/pypy/dev-python/pypy3-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.x86.xpak
|
||||
)"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="${PV}"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
RDEPEND=">=sys-libs/zlib-1.1.3:0/1
|
||||
dev-libs/libffi:0/7
|
||||
virtual/libintl:0/0
|
||||
dev-libs/expat:0/0
|
||||
app-arch/bzip2:0/1
|
||||
sys-libs/ncurses:0/6
|
||||
!dev-python/pypy-exe:${PV}"
|
||||
|
||||
PYPY_PV=${SLOT%_p*}
|
||||
QA_PREBUILT="
|
||||
usr/lib/pypy3.7/pypy3-c-${PYPY_PV}"
|
||||
|
||||
src_unpack() {
|
||||
ebegin "Unpacking ${MY_P}.${ARCH}.xpak"
|
||||
tar -x < <(xz -c -d --single-stream "${DISTDIR}/${MY_P}.${ARCH}.xpak")
|
||||
eend ${?} || die "Unpacking ${MY_P} failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto /
|
||||
doins -r usr
|
||||
fperms +x "/usr/lib/pypy3.7/pypy3-c-${PYPY_PV}"
|
||||
pax-mark m "${ED}/usr/lib/pypy3.7/pypy3-c-${PYPY_PV}"
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils
|
||||
|
||||
MY_P=pypy3-exe-${PV}-1
|
||||
DESCRIPTION="PyPy3 executable (pre-built version)"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="
|
||||
amd64? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/amd64/pypy/dev-python/pypy3-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.amd64.xpak
|
||||
)
|
||||
x86? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/x86/pypy/dev-python/pypy3-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.x86.xpak
|
||||
)"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="${PV}"
|
||||
KEYWORDS=""
|
||||
|
||||
RDEPEND=">=sys-libs/zlib-1.1.3:0/1
|
||||
dev-libs/libffi:0/7
|
||||
virtual/libintl:0/0
|
||||
dev-libs/expat:0/0
|
||||
app-arch/bzip2:0/1
|
||||
sys-libs/ncurses:0/6
|
||||
!dev-python/pypy-exe:${PV}"
|
||||
|
||||
QA_PREBUILT="
|
||||
usr/lib/pypy3.6/pypy3-c-${SLOT}"
|
||||
|
||||
src_unpack() {
|
||||
ebegin "Unpacking ${MY_P}.${ARCH}.xpak"
|
||||
tar -x < <(xz -c -d --single-stream "${DISTDIR}/${MY_P}.${ARCH}.xpak")
|
||||
eend ${?} || die "Unpacking ${MY_P} failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto /
|
||||
doins -r usr
|
||||
fperms +x "/usr/lib/pypy3.6/pypy3-c-${SLOT}"
|
||||
pax-mark m "${ED}/usr/lib/pypy3.6/pypy3-c-${SLOT}"
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit pax-utils
|
||||
|
||||
MY_P=pypy3-exe-${PV}-1
|
||||
DESCRIPTION="PyPy3 executable (pre-built version)"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="
|
||||
amd64? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/amd64/pypy/dev-python/pypy3-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.amd64.xpak
|
||||
)
|
||||
x86? (
|
||||
https://dev.gentoo.org/~mgorny/binpkg/x86/pypy/dev-python/pypy3-exe/${MY_P}.xpak
|
||||
-> ${MY_P}.x86.xpak
|
||||
)"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="${PV}"
|
||||
KEYWORDS=""
|
||||
|
||||
RDEPEND=">=sys-libs/zlib-1.1.3:0/1
|
||||
dev-libs/libffi:0/7
|
||||
virtual/libintl:0/0
|
||||
dev-libs/expat:0/0
|
||||
app-arch/bzip2:0/1
|
||||
sys-libs/ncurses:0/6
|
||||
!dev-python/pypy-exe:${PV}"
|
||||
|
||||
PYPY_PV=${SLOT%_p*}
|
||||
QA_PREBUILT="
|
||||
usr/lib/pypy3.7/pypy3-c-${PYPY_PV}"
|
||||
|
||||
src_unpack() {
|
||||
ebegin "Unpacking ${MY_P}.${ARCH}.xpak"
|
||||
tar -x < <(xz -c -d --single-stream "${DISTDIR}/${MY_P}.${ARCH}.xpak")
|
||||
eend ${?} || die "Unpacking ${MY_P} failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto /
|
||||
doins -r usr
|
||||
fperms +x "/usr/lib/pypy3.7/pypy3-c-${PYPY_PV}"
|
||||
pax-mark m "${ED}/usr/lib/pypy3.7/pypy3-c-${PYPY_PV}"
|
||||
}
|
@ -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
|
||||
|
@ -1,61 +0,0 @@
|
||||
From 5ee2925459372a8af805e952f433acd75e426325 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||
Date: Sun, 4 Oct 2020 15:46:23 +0200
|
||||
Subject: [PATCH] Fix sethostname() failure when passed bytes
|
||||
|
||||
My implementation of sethostname() was broken and failed when passed
|
||||
bytes on Python 3. Update the implementation to match CPython -- that
|
||||
is, use bytes if provided, or fsencode() when str is provided.
|
||||
|
||||
--HG--
|
||||
branch : py3.6
|
||||
---
|
||||
pypy/module/_socket/interp_func.py | 8 +++++++-
|
||||
pypy/module/_socket/test/test_sock_app.py | 12 ++++++++++++
|
||||
2 files changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/pypy/module/_socket/interp_func.py b/pypy/module/_socket/interp_func.py
|
||||
index bdc4f1293f..1727e51d51 100644
|
||||
--- a/pypy/module/_socket/interp_func.py
|
||||
+++ b/pypy/module/_socket/interp_func.py
|
||||
@@ -392,7 +392,13 @@ if hasattr(rsocket, 'sethostname'):
|
||||
|
||||
Set the host name.
|
||||
"""
|
||||
- hostname = space.text_w(w_hostname)
|
||||
+ if space.isinstance_w(w_hostname, space.w_bytes):
|
||||
+ hostname = space.bytes_w(w_hostname)
|
||||
+ elif space.isinstance_w(w_hostname, space.w_unicode):
|
||||
+ hostname = space.fsencode_w(w_hostname)
|
||||
+ else:
|
||||
+ raise oefmt(space.w_TypeError,
|
||||
+ "sethostname() argument 1 must be str or bytes")
|
||||
try:
|
||||
res = rsocket.sethostname(hostname)
|
||||
except SocketError as e:
|
||||
diff --git a/pypy/module/_socket/test/test_sock_app.py b/pypy/module/_socket/test/test_sock_app.py
|
||||
index fe3efec8e3..355fb8a2a9 100644
|
||||
--- a/pypy/module/_socket/test/test_sock_app.py
|
||||
+++ b/pypy/module/_socket/test/test_sock_app.py
|
||||
@@ -210,6 +210,18 @@ def test_getaddrinfo(space, w_socket):
|
||||
assert space.unwrap(w_l) == True
|
||||
|
||||
|
||||
+def test_sethostname(space, w_socket):
|
||||
+ space.raises_w(space.w_OSError, space.appexec,
|
||||
+ [w_socket],
|
||||
+ "(_socket): _socket.sethostname(_socket.gethostname())")
|
||||
+
|
||||
+
|
||||
+def test_sethostname_bytes(space, w_socket):
|
||||
+ space.raises_w(space.w_OSError, space.appexec,
|
||||
+ [w_socket],
|
||||
+ "(_socket): _socket.sethostname(_socket.gethostname().encode())")
|
||||
+
|
||||
+
|
||||
def test_unknown_addr_as_object(space, ):
|
||||
from pypy.module._socket.interp_socket import addr_as_object
|
||||
c_addr = lltype.malloc(rsocket._c.sockaddr, flavor='raw', track_allocation=False)
|
||||
--
|
||||
GitLab
|
||||
|
@ -1,151 +0,0 @@
|
||||
# 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://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/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 && 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}"
|
||||
}
|
@ -1,161 +0,0 @@
|
||||
# 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://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/pypy3-exe-bin:${PV}"
|
||||
DEPEND="${RDEPEND}"
|
||||
BDEPEND="
|
||||
low-memory? ( dev-python/pypy )
|
||||
!low-memory? (
|
||||
|| (
|
||||
dev-python/pypy
|
||||
dev-lang/python:2.7
|
||||
)
|
||||
)"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/pypy3-7.3.2-sethostname-bytes.patch
|
||||
"${FILESDIR}"/pypy3-7.3.2-ppc64-segfault.patch
|
||||
)
|
||||
|
||||
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 && 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
|
||||
|
||||
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/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}"
|
||||
}
|
@ -1,162 +0,0 @@
|
||||
# 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
|
||||
|
||||
PYPY_PV=${PV%_p37}
|
||||
MY_P=pypy3.7-v${PYPY_PV/_/}
|
||||
DESCRIPTION="PyPy3 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/pypy3-exe-bin:${PV}"
|
||||
DEPEND="${RDEPEND}"
|
||||
BDEPEND="
|
||||
low-memory? ( dev-python/pypy )
|
||||
!low-memory? (
|
||||
|| (
|
||||
dev-python/pypy
|
||||
dev-lang/python:2.7
|
||||
)
|
||||
)"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/pypy3-7.3.2-sethostname-bytes.patch
|
||||
"${FILESDIR}"/pypy3-7.3.2-ppc64-segfault.patch
|
||||
)
|
||||
|
||||
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 && 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
|
||||
|
||||
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/pypy3.7
|
||||
exeinto "${dest}"
|
||||
newexe "${T}"/usession*-0/testing_1/pypy3-c pypy3-c-${PYPY_PV}
|
||||
insinto "${dest}"/include/${PYPY_PV}
|
||||
doins include/pypy_*
|
||||
pax-mark m "${ED}${dest}/pypy3-c-${PYPY_PV}"
|
||||
}
|
@ -1,156 +0,0 @@
|
||||
# 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://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/pypy3-exe-bin:${PV}"
|
||||
DEPEND="${RDEPEND}"
|
||||
BDEPEND="
|
||||
low-memory? ( dev-python/pypy )
|
||||
!low-memory? (
|
||||
|| (
|
||||
dev-python/pypy
|
||||
dev-lang/python:2.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 && 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
|
||||
|
||||
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/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}"
|
||||
}
|
@ -1,157 +0,0 @@
|
||||
# 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
|
||||
|
||||
PYPY_PV=${PV%_p37}
|
||||
MY_P=pypy3.7-v${PYPY_PV/_/}
|
||||
DESCRIPTION="PyPy3 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/pypy3-exe-bin:${PV}"
|
||||
DEPEND="${RDEPEND}"
|
||||
BDEPEND="
|
||||
low-memory? ( dev-python/pypy )
|
||||
!low-memory? (
|
||||
|| (
|
||||
dev-python/pypy
|
||||
dev-lang/python:2.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 && 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
|
||||
|
||||
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/pypy3.7
|
||||
exeinto "${dest}"
|
||||
newexe "${T}"/usession*-0/testing_1/pypy3-c pypy3-c-${PYPY_PV}
|
||||
insinto "${dest}"/include/${PYPY_PV}
|
||||
doins include/pypy_*
|
||||
pax-mark m "${ED}${dest}/pypy3-c-${PYPY_PV}"
|
||||
}
|
@ -1,220 +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 pax-utils python-any-r1 toolchain-funcs
|
||||
|
||||
MY_P=pypy3.6-v${PV/_/}
|
||||
|
||||
DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="https://downloads.python.org/pypy/${MY_P}-src.tar.bz2"
|
||||
S="${WORKDIR}/${MY_P}-src"
|
||||
|
||||
LICENSE="MIT"
|
||||
# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
|
||||
SLOT="0/pypy36-pp73"
|
||||
KEYWORDS="amd64 ~ppc64 x86 ~amd64-linux ~x86-linux"
|
||||
IUSE="bzip2 gdbm +jit libressl ncurses sqlite test tk"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
|| (
|
||||
dev-python/pypy3-exe:${PV}[bzip2?,ncurses?]
|
||||
dev-python/pypy3-exe-bin:${PV}
|
||||
)
|
||||
!libressl? ( dev-libs/openssl:0= )
|
||||
libressl? ( dev-libs/libressl:0= )
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!<dev-python/pypy3-bin-7.3.0:0"
|
||||
DEPEND="${RDEPEND}
|
||||
test? (
|
||||
${PYTHON_DEPS}
|
||||
!!dev-python/pytest-forked
|
||||
)"
|
||||
|
||||
pkg_setup() {
|
||||
use test && python-any-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
|
||||
eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
|
||||
eapply "${FILESDIR}"/7.2.0-distutils-cxx.patch
|
||||
|
||||
sed -e "s^@EPREFIX@^${EPREFIX}^" \
|
||||
-i lib-python/3/distutils/command/install.py || die
|
||||
|
||||
# apply CPython stdlib patches
|
||||
pushd lib-python/3 > /dev/null || die
|
||||
eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
|
||||
popd > /dev/null || die
|
||||
|
||||
# see http://buildbot.pypy.org/summary?branch=py3.6&builder=pypy-c-jit-linux-x86-64
|
||||
sed -i -e 's:test_runeval_step:_&:' \
|
||||
lib-python/3/test/test_bdb.py || die
|
||||
sed -i -e 's:test_crashing_decode_handler:_&:' \
|
||||
lib-python/3/test/test_codeccallbacks.py || die
|
||||
sed -i -e 's:test_jumpy:_&:' \
|
||||
lib-python/3/test/test_dis.py || die
|
||||
sed -i -e 's:test_ast_line_numbers:_&:' \
|
||||
-e 's:test_backslashes_in_string_part:_&:' \
|
||||
lib-python/3/test/test_fstring.py || die
|
||||
sed -i -e 's:test_listdir_bytes_like:_&:' \
|
||||
lib-python/3/test/test_posix.py || die
|
||||
sed -i -e 's:test_auto_history:_&:' \
|
||||
-e 's:test_history_size:_&:' \
|
||||
lib-python/3/test/test_readline.py || die
|
||||
sed -i -e 's:test_pha_optional:_&:' \
|
||||
-e 's:test_pha_required:_&:' \
|
||||
lib-python/3/test/test_ssl.py || die
|
||||
sed -i -e 's:test_eval_bytes_invalid_escape:_&:' \
|
||||
-e 's:test_eval_str_invalid_escape:_&:' \
|
||||
lib-python/3/test/test_string_literals.py || die
|
||||
sed -i -e 's:test_jump_out_of_async_for_block:_&:' \
|
||||
-e 's:test_jump_over_async_for_block_before_else:_&:' \
|
||||
-e 's:test_no_jump_.*wards_into_async_for_block:_&:' \
|
||||
-e 's:test_no_jump_into_async_for_block_before_else:_&:' \
|
||||
-e 's:test_no_jump_from_yield:_&:' \
|
||||
lib-python/3/test/test_sys_settrace.py || die
|
||||
sed -i -e 's:test_circular_imports:_&:' \
|
||||
lib-python/3/test/test_threaded_import.py || die
|
||||
|
||||
# fixed in git
|
||||
sed -i -e 's:test_SOCK_CLOEXEC:_&:' \
|
||||
lib-python/3/test/test_socket.py || die
|
||||
|
||||
# the first one's broken by sandbox, the second by our env
|
||||
sed -i -e 's:test_empty_env:_&:' \
|
||||
-e 's:test_executable:_&:' \
|
||||
lib-python/3/test/test_subprocess.py || die
|
||||
|
||||
# XXX
|
||||
sed -i -e 's:test_locale:_&:' \
|
||||
lib-python/3/test/test_format.py || die
|
||||
sed -i -e 's:test_decompressor_bug_28275:_&:' \
|
||||
lib-python/3/test/test_lzma.py || die
|
||||
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
tc-export CC
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# copy over to make sys.prefix happy
|
||||
cp -p "${BROOT}"/usr/lib/pypy3.6/pypy3-c-${PV} pypy3-c || die
|
||||
cp -p "${BROOT}"/usr/lib/pypy3.6/include/${PV}/* include/ || die
|
||||
# (not installed by pypy)
|
||||
rm pypy/module/cpyext/include/_numpypy/numpy/README || die
|
||||
mv pypy/module/cpyext/include/* include/ || die
|
||||
mv pypy/module/cpyext/parse/*.h include/ || die
|
||||
pax-mark m pypy3-c
|
||||
|
||||
einfo "Generating caches and CFFI modules ..."
|
||||
|
||||
# Generate Grammar and PatternGrammar pickles.
|
||||
./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
|
||||
|| die "Generation of Grammar and PatternGrammar pickles failed"
|
||||
|
||||
# Generate cffi modules
|
||||
# Please keep in sync with pypy/tool/build_cffi_imports.py!
|
||||
#cffi_build_scripts = {
|
||||
# "_blake2": "_blake2/_blake2_build.py",
|
||||
# "_ssl": "_ssl_build.py",
|
||||
# "sqlite3": "_sqlite3_build.py",
|
||||
# "audioop": "_audioop_build.py",
|
||||
# "tk": "_tkinter/tklib_build.py",
|
||||
# "curses": "_curses_build.py" if sys.platform != "win32" else None,
|
||||
# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
|
||||
# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
|
||||
# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
|
||||
# "resource": "_resource_build.py" if sys.platform != "win32" else None,
|
||||
# "lzma": "_lzma_build.py",
|
||||
# "_decimal": "_decimal_build.py",
|
||||
# "_sha3": "_sha3/_sha3_build.py",
|
||||
cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
|
||||
audioop syslog pwdgrp resource lzma decimal )
|
||||
use gdbm && cffi_targets+=( gdbm )
|
||||
use ncurses && cffi_targets+=( curses )
|
||||
use sqlite && cffi_targets+=( sqlite3 )
|
||||
use tk && cffi_targets+=( tkinter/tklib )
|
||||
|
||||
local t
|
||||
# all modules except tkinter output to .
|
||||
# tkinter outputs to the correct dir ...
|
||||
cd lib_pypy || die
|
||||
for t in "${cffi_targets[@]}"; do
|
||||
# tkinter doesn't work via -m
|
||||
../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
|
||||
done
|
||||
|
||||
# Cleanup temporary objects
|
||||
find -name "_cffi_*.[co]" -delete || die
|
||||
find -type d -empty -delete || die
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# (unset)
|
||||
local -x PYTHONDONTWRITEBYTECODE=
|
||||
local -x COLUMNS=80
|
||||
|
||||
# Test runner requires Python 2 too. However, it spawns PyPy3
|
||||
# internally so that we end up testing the correct interpreter.
|
||||
"${EPYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest=/usr/lib/pypy3.6
|
||||
einfo "Installing PyPy ..."
|
||||
dosym pypy3-c-${PV} "${dest}/pypy3-c"
|
||||
insinto "${dest}"
|
||||
# preserve mtimes to avoid obsoleting caches
|
||||
insopts -p
|
||||
doins -r include lib_pypy lib-python
|
||||
|
||||
# replace copied headers with symlinks
|
||||
for x in "${BROOT}"/usr/lib/pypy3.6/include/${PV}/*; do
|
||||
dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
|
||||
done
|
||||
|
||||
dosym ../lib/pypy3.6/pypy3-c /usr/bin/pypy3
|
||||
dodoc README.rst
|
||||
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
|
||||
"${ED}${dest}"/lib_pypy/_sqlite3* \
|
||||
"${ED}${dest}"/lib-python/*3/test/test_sqlite.py || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED}${dest}"/lib-python/*3/{idlelib,tkinter} \
|
||||
"${ED}${dest}"/lib_pypy/_tkinter \
|
||||
"${ED}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
|
||||
local -x EPYTHON=pypy3
|
||||
local -x PYTHON=${ED}${dest}/pypy3-c-${PV}
|
||||
# temporarily copy to build tree to facilitate module builds
|
||||
cp -p "${BROOT}${dest}/pypy3-c-${PV}" "${PYTHON}" || die
|
||||
|
||||
echo "EPYTHON='${EPYTHON}'" > epython.py || die
|
||||
python_moduleinto /usr/lib/pypy3.6/site-packages
|
||||
python_domodule epython.py
|
||||
|
||||
einfo "Byte-compiling Python standard library..."
|
||||
python_optimize "${ED}${dest}"
|
||||
|
||||
# remove to avoid collisions
|
||||
rm "${PYTHON}" || die
|
||||
}
|
@ -1,207 +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 pax-utils python-any-r1 toolchain-funcs
|
||||
|
||||
MY_P=pypy3.6-v${PV/_/}
|
||||
|
||||
DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2"
|
||||
S="${WORKDIR}/${MY_P}-src"
|
||||
|
||||
LICENSE="MIT"
|
||||
# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
|
||||
SLOT="0/pypy36-pp73"
|
||||
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
|
||||
IUSE="bzip2 gdbm +jit libressl ncurses sqlite test tk"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
|| (
|
||||
dev-python/pypy3-exe:${PV}[bzip2?,ncurses?]
|
||||
dev-python/pypy3-exe-bin:${PV}
|
||||
)
|
||||
!libressl? ( dev-libs/openssl:0= )
|
||||
libressl? ( dev-libs/libressl:0= )
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!<dev-python/pypy3-bin-7.3.0:0"
|
||||
DEPEND="${RDEPEND}
|
||||
test? (
|
||||
${PYTHON_DEPS}
|
||||
!!dev-python/pytest-forked
|
||||
)"
|
||||
|
||||
pkg_setup() {
|
||||
use test && python-any-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
|
||||
eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
|
||||
eapply "${FILESDIR}"/7.2.0-distutils-cxx.patch
|
||||
|
||||
sed -e "s^@EPREFIX@^${EPREFIX}^" \
|
||||
-i lib-python/3/distutils/command/install.py || die
|
||||
|
||||
# apply CPython stdlib patches
|
||||
pushd lib-python/3 > /dev/null || die
|
||||
eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
|
||||
popd > /dev/null || die
|
||||
|
||||
# see http://buildbot.pypy.org/summary?branch=py3.6&builder=pypy-c-jit-linux-x86-64
|
||||
sed -i -e 's:test_jumpy:_&:' \
|
||||
lib-python/3/test/test_dis.py || die
|
||||
sed -i -e 's:test_get_and_set_scheduler_and_param:_&:' \
|
||||
lib-python/3/test/test_posix.py || die
|
||||
sed -i -e 's:test_auto_history:_&:' \
|
||||
-e 's:test_history_size:_&:' \
|
||||
lib-python/3/test/test_readline.py || die
|
||||
sed -i -e 's:test_eval_bytes_invalid_escape:_&:' \
|
||||
-e 's:test_eval_str_invalid_escape:_&:' \
|
||||
lib-python/3/test/test_string_literals.py || die
|
||||
sed -i -e 's:test_jump_out_of_async_for_block:_&:' \
|
||||
-e 's:test_jump_over_async_for_block_before_else:_&:' \
|
||||
-e 's:test_no_jump_.*wards_into_async_for_block:_&:' \
|
||||
-e 's:test_no_jump_into_async_for_block_before_else:_&:' \
|
||||
-e 's:test_no_jump_from_yield:_&:' \
|
||||
lib-python/3/test/test_sys_settrace.py || die
|
||||
sed -i -e 's:test_circular_imports:_&:' \
|
||||
lib-python/3/test/test_threaded_import.py || die
|
||||
|
||||
# the first one's broken by sandbox, the second by our env
|
||||
sed -i -e 's:test_empty_env:_&:' \
|
||||
-e 's:test_executable(:_&:' \
|
||||
-e 's:test_executable_without_cwd:_&:' \
|
||||
lib-python/3/test/test_subprocess.py || die
|
||||
|
||||
# XXX
|
||||
sed -i -e 's:test_locale:_&:' \
|
||||
lib-python/3/test/test_format.py || die
|
||||
sed -i -e 's:test_decompressor_bug_28275:_&:' \
|
||||
lib-python/3/test/test_lzma.py || die
|
||||
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
tc-export CC
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# copy over to make sys.prefix happy
|
||||
cp -p "${BROOT}"/usr/lib/pypy3.6/pypy3-c-${PV} pypy3-c || die
|
||||
cp -p "${BROOT}"/usr/lib/pypy3.6/include/${PV}/* include/ || die
|
||||
# (not installed by pypy)
|
||||
rm pypy/module/cpyext/include/_numpypy/numpy/README || die
|
||||
mv pypy/module/cpyext/include/* include/ || die
|
||||
mv pypy/module/cpyext/parse/*.h include/ || die
|
||||
pax-mark m pypy3-c
|
||||
|
||||
einfo "Generating caches and CFFI modules ..."
|
||||
|
||||
# Generate Grammar and PatternGrammar pickles.
|
||||
./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
|
||||
|| die "Generation of Grammar and PatternGrammar pickles failed"
|
||||
|
||||
# Generate cffi modules
|
||||
# Please keep in sync with pypy/tool/build_cffi_imports.py!
|
||||
#cffi_build_scripts = {
|
||||
# "_blake2": "_blake2/_blake2_build.py",
|
||||
# "_ssl": "_ssl_build.py",
|
||||
# "sqlite3": "_sqlite3_build.py",
|
||||
# "audioop": "_audioop_build.py",
|
||||
# "tk": "_tkinter/tklib_build.py",
|
||||
# "curses": "_curses_build.py" if sys.platform != "win32" else None,
|
||||
# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
|
||||
# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
|
||||
# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
|
||||
# "resource": "_resource_build.py" if sys.platform != "win32" else None,
|
||||
# "lzma": "_lzma_build.py",
|
||||
# "_decimal": "_decimal_build.py",
|
||||
# "_sha3": "_sha3/_sha3_build.py",
|
||||
cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
|
||||
audioop syslog pwdgrp resource lzma decimal )
|
||||
use gdbm && cffi_targets+=( gdbm )
|
||||
use ncurses && cffi_targets+=( curses )
|
||||
use sqlite && cffi_targets+=( sqlite3 )
|
||||
use tk && cffi_targets+=( tkinter/tklib )
|
||||
|
||||
local t
|
||||
# all modules except tkinter output to .
|
||||
# tkinter outputs to the correct dir ...
|
||||
cd lib_pypy || die
|
||||
for t in "${cffi_targets[@]}"; do
|
||||
# tkinter doesn't work via -m
|
||||
../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
|
||||
done
|
||||
|
||||
# Cleanup temporary objects
|
||||
find -name "_cffi_*.[co]" -delete || die
|
||||
find -type d -empty -delete || die
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# (unset)
|
||||
local -x PYTHONDONTWRITEBYTECODE=
|
||||
local -x COLUMNS=80
|
||||
|
||||
# Test runner requires Python 2 too. However, it spawns PyPy3
|
||||
# internally so that we end up testing the correct interpreter.
|
||||
"${EPYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest=/usr/lib/pypy3.6
|
||||
einfo "Installing PyPy ..."
|
||||
dosym pypy3-c-${PV} "${dest}/pypy3-c"
|
||||
insinto "${dest}"
|
||||
# preserve mtimes to avoid obsoleting caches
|
||||
insopts -p
|
||||
doins -r include lib_pypy lib-python
|
||||
|
||||
# replace copied headers with symlinks
|
||||
for x in "${BROOT}"/usr/lib/pypy3.6/include/${PV}/*; do
|
||||
dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
|
||||
done
|
||||
|
||||
dosym ../lib/pypy3.6/pypy3-c /usr/bin/pypy3
|
||||
dodoc README.rst
|
||||
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
|
||||
"${ED}${dest}"/lib_pypy/_sqlite3* \
|
||||
"${ED}${dest}"/lib-python/*3/test/test_sqlite.py || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED}${dest}"/lib-python/*3/{idlelib,tkinter} \
|
||||
"${ED}${dest}"/lib_pypy/_tkinter \
|
||||
"${ED}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
|
||||
local -x EPYTHON=pypy3
|
||||
local -x PYTHON=${ED}${dest}/pypy3-c-${PV}
|
||||
# temporarily copy to build tree to facilitate module builds
|
||||
cp -p "${BROOT}${dest}/pypy3-c-${PV}" "${PYTHON}" || die
|
||||
|
||||
echo "EPYTHON='${EPYTHON}'" > epython.py || die
|
||||
python_moduleinto /usr/lib/pypy3.6/site-packages
|
||||
python_domodule epython.py
|
||||
|
||||
einfo "Byte-compiling Python standard library..."
|
||||
python_optimize "${ED}${dest}"
|
||||
|
||||
# remove to avoid collisions
|
||||
rm "${PYTHON}" || die
|
||||
}
|
@ -1,178 +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 pax-utils python-any-r1 toolchain-funcs
|
||||
|
||||
PYPY_PV=${PV%_p37}
|
||||
MY_P=pypy3.7-v${PYPY_PV/_/}
|
||||
|
||||
DESCRIPTION="A fast, compliant alternative implementation of the Python (3.7) language"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2"
|
||||
S="${WORKDIR}/${MY_P}-src"
|
||||
|
||||
LICENSE="MIT"
|
||||
# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
|
||||
SLOT="0/pypy37-pp73"
|
||||
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
|
||||
IUSE="bzip2 gdbm +jit libressl ncurses sqlite test tk"
|
||||
# pypy3.7 is in alpha state and a lot of tests are failing
|
||||
RESTRICT="test"
|
||||
|
||||
RDEPEND="
|
||||
|| (
|
||||
dev-python/pypy3-exe:${PV}[bzip2?,ncurses?]
|
||||
dev-python/pypy3-exe-bin:${PV}
|
||||
)
|
||||
!libressl? ( dev-libs/openssl:0= )
|
||||
libressl? ( dev-libs/libressl:0= )
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!<dev-python/pypy3-bin-7.3.0:0"
|
||||
DEPEND="${RDEPEND}
|
||||
test? (
|
||||
${PYTHON_DEPS}
|
||||
!!dev-python/pytest-forked
|
||||
)"
|
||||
|
||||
pkg_setup() {
|
||||
use test && python-any-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
|
||||
eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
|
||||
eapply "${FILESDIR}/7.3.2-py37-distutils-cxx.patch"
|
||||
|
||||
sed -e "s^@EPREFIX@^${EPREFIX}^" \
|
||||
-i lib-python/3/distutils/command/install.py || die
|
||||
|
||||
# apply CPython stdlib patches
|
||||
pushd lib-python/3 > /dev/null || die
|
||||
eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
|
||||
popd > /dev/null || die
|
||||
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
tc-export CC
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# copy over to make sys.prefix happy
|
||||
cp -p "${BROOT}"/usr/lib/pypy3.7/pypy3-c-${PYPY_PV} pypy3-c || die
|
||||
cp -p "${BROOT}"/usr/lib/pypy3.7/include/${PYPY_PV}/* include/ || die
|
||||
# (not installed by pypy)
|
||||
rm pypy/module/cpyext/include/_numpypy/numpy/README || die
|
||||
mv pypy/module/cpyext/include/* include/ || die
|
||||
mv pypy/module/cpyext/parse/*.h include/ || die
|
||||
pax-mark m pypy3-c
|
||||
|
||||
einfo "Generating caches and CFFI modules ..."
|
||||
|
||||
# Generate Grammar and PatternGrammar pickles.
|
||||
./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
|
||||
|| die "Generation of Grammar and PatternGrammar pickles failed"
|
||||
|
||||
# Generate cffi modules
|
||||
# Please keep in sync with pypy/tool/build_cffi_imports.py!
|
||||
#cffi_build_scripts = {
|
||||
# "_blake2": "_blake2/_blake2_build.py",
|
||||
# "_ssl": "_ssl_build.py",
|
||||
# "sqlite3": "_sqlite3_build.py",
|
||||
# "audioop": "_audioop_build.py",
|
||||
# "tk": "_tkinter/tklib_build.py",
|
||||
# "curses": "_curses_build.py" if sys.platform != "win32" else None,
|
||||
# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
|
||||
# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
|
||||
# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
|
||||
# "resource": "_resource_build.py" if sys.platform != "win32" else None,
|
||||
# "lzma": "_lzma_build.py",
|
||||
# "_decimal": "_decimal_build.py",
|
||||
# "_sha3": "_sha3/_sha3_build.py",
|
||||
cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
|
||||
audioop syslog pwdgrp resource lzma decimal )
|
||||
use gdbm && cffi_targets+=( gdbm )
|
||||
use ncurses && cffi_targets+=( curses )
|
||||
use sqlite && cffi_targets+=( sqlite3 )
|
||||
use tk && cffi_targets+=( tkinter/tklib )
|
||||
|
||||
local t
|
||||
# all modules except tkinter output to .
|
||||
# tkinter outputs to the correct dir ...
|
||||
cd lib_pypy || die
|
||||
for t in "${cffi_targets[@]}"; do
|
||||
# tkinter doesn't work via -m
|
||||
../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
|
||||
done
|
||||
|
||||
# Cleanup temporary objects
|
||||
find -name "_cffi_*.[co]" -delete || die
|
||||
find -type d -empty -delete || die
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# (unset)
|
||||
local -x PYTHONDONTWRITEBYTECODE=
|
||||
local -x COLUMNS=80
|
||||
|
||||
# Test runner requires Python 2 too. However, it spawns PyPy3
|
||||
# internally so that we end up testing the correct interpreter.
|
||||
# (--deselect for failing doctests)
|
||||
"${EPYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest=/usr/lib/pypy3.7
|
||||
einfo "Installing PyPy ..."
|
||||
dosym pypy3-c-${PYPY_PV} "${dest}/pypy3-c"
|
||||
insinto "${dest}"
|
||||
# preserve mtimes to avoid obsoleting caches
|
||||
insopts -p
|
||||
doins -r include lib_pypy lib-python
|
||||
|
||||
# replace copied headers with symlinks
|
||||
for x in "${BROOT}"/usr/lib/pypy3.7/include/${PYPY_PV}/*; do
|
||||
dosym "${PYPY_PV}/${x##*/}" "${dest}/include/${x##*/}"
|
||||
done
|
||||
|
||||
dosym ../lib/pypy3.7/pypy3-c /usr/bin/pypy3
|
||||
dodoc README.rst
|
||||
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
|
||||
"${ED}${dest}"/lib_pypy/_sqlite3* \
|
||||
"${ED}${dest}"/lib-python/*3/test/test_sqlite.py || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED}${dest}"/lib-python/*3/{idlelib,tkinter} \
|
||||
"${ED}${dest}"/lib_pypy/_tkinter \
|
||||
"${ED}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
|
||||
local -x EPYTHON=pypy3
|
||||
local -x PYTHON=${ED}${dest}/pypy3-c-${PYPY_PV}
|
||||
# temporarily copy to build tree to facilitate module builds
|
||||
cp -p "${BROOT}${dest}/pypy3-c-${PYPY_PV}" "${PYTHON}" || die
|
||||
|
||||
echo "EPYTHON='${EPYTHON}'" > epython.py || die
|
||||
python_moduleinto /usr/lib/pypy3.7/site-packages
|
||||
python_domodule epython.py
|
||||
|
||||
einfo "Byte-compiling Python standard library..."
|
||||
python_optimize "${ED}${dest}"
|
||||
|
||||
# remove to avoid collisions
|
||||
rm "${PYTHON}" || die
|
||||
}
|
@ -1,207 +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 pax-utils python-any-r1 toolchain-funcs
|
||||
|
||||
MY_P=pypy3.6-v${PV/_/}
|
||||
|
||||
DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2"
|
||||
S="${WORKDIR}/${MY_P}-src"
|
||||
|
||||
LICENSE="MIT"
|
||||
# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
|
||||
SLOT="0/pypy36-pp73"
|
||||
KEYWORDS=""
|
||||
IUSE="bzip2 gdbm +jit libressl ncurses sqlite test tk"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
|| (
|
||||
dev-python/pypy3-exe:${PV}[bzip2?,ncurses?]
|
||||
dev-python/pypy3-exe-bin:${PV}
|
||||
)
|
||||
!libressl? ( dev-libs/openssl:0= )
|
||||
libressl? ( dev-libs/libressl:0= )
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!<dev-python/pypy3-bin-7.3.0:0"
|
||||
DEPEND="${RDEPEND}
|
||||
test? (
|
||||
${PYTHON_DEPS}
|
||||
!!dev-python/pytest-forked
|
||||
)"
|
||||
|
||||
pkg_setup() {
|
||||
use test && python-any-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
|
||||
eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
|
||||
eapply "${FILESDIR}"/7.2.0-distutils-cxx.patch
|
||||
|
||||
sed -e "s^@EPREFIX@^${EPREFIX}^" \
|
||||
-i lib-python/3/distutils/command/install.py || die
|
||||
|
||||
# apply CPython stdlib patches
|
||||
pushd lib-python/3 > /dev/null || die
|
||||
eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
|
||||
popd > /dev/null || die
|
||||
|
||||
# see http://buildbot.pypy.org/summary?branch=py3.6&builder=pypy-c-jit-linux-x86-64
|
||||
sed -i -e 's:test_jumpy:_&:' \
|
||||
lib-python/3/test/test_dis.py || die
|
||||
sed -i -e 's:test_get_and_set_scheduler_and_param:_&:' \
|
||||
lib-python/3/test/test_posix.py || die
|
||||
sed -i -e 's:test_auto_history:_&:' \
|
||||
-e 's:test_history_size:_&:' \
|
||||
lib-python/3/test/test_readline.py || die
|
||||
sed -i -e 's:test_eval_bytes_invalid_escape:_&:' \
|
||||
-e 's:test_eval_str_invalid_escape:_&:' \
|
||||
lib-python/3/test/test_string_literals.py || die
|
||||
sed -i -e 's:test_jump_out_of_async_for_block:_&:' \
|
||||
-e 's:test_jump_over_async_for_block_before_else:_&:' \
|
||||
-e 's:test_no_jump_.*wards_into_async_for_block:_&:' \
|
||||
-e 's:test_no_jump_into_async_for_block_before_else:_&:' \
|
||||
-e 's:test_no_jump_from_yield:_&:' \
|
||||
lib-python/3/test/test_sys_settrace.py || die
|
||||
sed -i -e 's:test_circular_imports:_&:' \
|
||||
lib-python/3/test/test_threaded_import.py || die
|
||||
|
||||
# the first one's broken by sandbox, the second by our env
|
||||
sed -i -e 's:test_empty_env:_&:' \
|
||||
-e 's:test_executable(:_&:' \
|
||||
-e 's:test_executable_without_cwd:_&:' \
|
||||
lib-python/3/test/test_subprocess.py || die
|
||||
|
||||
# XXX
|
||||
sed -i -e 's:test_locale:_&:' \
|
||||
lib-python/3/test/test_format.py || die
|
||||
sed -i -e 's:test_decompressor_bug_28275:_&:' \
|
||||
lib-python/3/test/test_lzma.py || die
|
||||
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
tc-export CC
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# copy over to make sys.prefix happy
|
||||
cp -p "${BROOT}"/usr/lib/pypy3.6/pypy3-c-${PV} pypy3-c || die
|
||||
cp -p "${BROOT}"/usr/lib/pypy3.6/include/${PV}/* include/ || die
|
||||
# (not installed by pypy)
|
||||
rm pypy/module/cpyext/include/_numpypy/numpy/README || die
|
||||
mv pypy/module/cpyext/include/* include/ || die
|
||||
mv pypy/module/cpyext/parse/*.h include/ || die
|
||||
pax-mark m pypy3-c
|
||||
|
||||
einfo "Generating caches and CFFI modules ..."
|
||||
|
||||
# Generate Grammar and PatternGrammar pickles.
|
||||
./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
|
||||
|| die "Generation of Grammar and PatternGrammar pickles failed"
|
||||
|
||||
# Generate cffi modules
|
||||
# Please keep in sync with pypy/tool/build_cffi_imports.py!
|
||||
#cffi_build_scripts = {
|
||||
# "_blake2": "_blake2/_blake2_build.py",
|
||||
# "_ssl": "_ssl_build.py",
|
||||
# "sqlite3": "_sqlite3_build.py",
|
||||
# "audioop": "_audioop_build.py",
|
||||
# "tk": "_tkinter/tklib_build.py",
|
||||
# "curses": "_curses_build.py" if sys.platform != "win32" else None,
|
||||
# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
|
||||
# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
|
||||
# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
|
||||
# "resource": "_resource_build.py" if sys.platform != "win32" else None,
|
||||
# "lzma": "_lzma_build.py",
|
||||
# "_decimal": "_decimal_build.py",
|
||||
# "_sha3": "_sha3/_sha3_build.py",
|
||||
cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
|
||||
audioop syslog pwdgrp resource lzma decimal )
|
||||
use gdbm && cffi_targets+=( gdbm )
|
||||
use ncurses && cffi_targets+=( curses )
|
||||
use sqlite && cffi_targets+=( sqlite3 )
|
||||
use tk && cffi_targets+=( tkinter/tklib )
|
||||
|
||||
local t
|
||||
# all modules except tkinter output to .
|
||||
# tkinter outputs to the correct dir ...
|
||||
cd lib_pypy || die
|
||||
for t in "${cffi_targets[@]}"; do
|
||||
# tkinter doesn't work via -m
|
||||
../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
|
||||
done
|
||||
|
||||
# Cleanup temporary objects
|
||||
find -name "_cffi_*.[co]" -delete || die
|
||||
find -type d -empty -delete || die
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# (unset)
|
||||
local -x PYTHONDONTWRITEBYTECODE=
|
||||
local -x COLUMNS=80
|
||||
|
||||
# Test runner requires Python 2 too. However, it spawns PyPy3
|
||||
# internally so that we end up testing the correct interpreter.
|
||||
"${EPYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest=/usr/lib/pypy3.6
|
||||
einfo "Installing PyPy ..."
|
||||
dosym pypy3-c-${PV} "${dest}/pypy3-c"
|
||||
insinto "${dest}"
|
||||
# preserve mtimes to avoid obsoleting caches
|
||||
insopts -p
|
||||
doins -r include lib_pypy lib-python
|
||||
|
||||
# replace copied headers with symlinks
|
||||
for x in "${BROOT}"/usr/lib/pypy3.6/include/${PV}/*; do
|
||||
dosym "${PV}/${x##*/}" "${dest}/include/${x##*/}"
|
||||
done
|
||||
|
||||
dosym ../lib/pypy3.6/pypy3-c /usr/bin/pypy3
|
||||
dodoc README.rst
|
||||
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
|
||||
"${ED}${dest}"/lib_pypy/_sqlite3* \
|
||||
"${ED}${dest}"/lib-python/*3/test/test_sqlite.py || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED}${dest}"/lib-python/*3/{idlelib,tkinter} \
|
||||
"${ED}${dest}"/lib_pypy/_tkinter \
|
||||
"${ED}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
|
||||
local -x EPYTHON=pypy3
|
||||
local -x PYTHON=${ED}${dest}/pypy3-c-${PV}
|
||||
# temporarily copy to build tree to facilitate module builds
|
||||
cp -p "${BROOT}${dest}/pypy3-c-${PV}" "${PYTHON}" || die
|
||||
|
||||
echo "EPYTHON='${EPYTHON}'" > epython.py || die
|
||||
python_moduleinto /usr/lib/pypy3.6/site-packages
|
||||
python_domodule epython.py
|
||||
|
||||
einfo "Byte-compiling Python standard library..."
|
||||
python_optimize "${ED}${dest}"
|
||||
|
||||
# remove to avoid collisions
|
||||
rm "${PYTHON}" || die
|
||||
}
|
@ -1,178 +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 pax-utils python-any-r1 toolchain-funcs
|
||||
|
||||
PYPY_PV=${PV%_p37}
|
||||
MY_P=pypy3.7-v${PYPY_PV/_/}
|
||||
|
||||
DESCRIPTION="A fast, compliant alternative implementation of the Python (3.7) language"
|
||||
HOMEPAGE="https://pypy.org/"
|
||||
SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2"
|
||||
S="${WORKDIR}/${MY_P}-src"
|
||||
|
||||
LICENSE="MIT"
|
||||
# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
|
||||
SLOT="0/pypy37-pp73"
|
||||
KEYWORDS=""
|
||||
IUSE="bzip2 gdbm +jit libressl ncurses sqlite test tk"
|
||||
# pypy3.7 is in alpha state and a lot of tests are failing
|
||||
RESTRICT="test"
|
||||
|
||||
RDEPEND="
|
||||
|| (
|
||||
dev-python/pypy3-exe:${PV}[bzip2?,ncurses?]
|
||||
dev-python/pypy3-exe-bin:${PV}
|
||||
)
|
||||
!libressl? ( dev-libs/openssl:0= )
|
||||
libressl? ( dev-libs/libressl:0= )
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!<dev-python/pypy3-bin-7.3.0:0"
|
||||
DEPEND="${RDEPEND}
|
||||
test? (
|
||||
${PYTHON_DEPS}
|
||||
!!dev-python/pytest-forked
|
||||
)"
|
||||
|
||||
pkg_setup() {
|
||||
use test && python-any-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
eapply "${FILESDIR}/7.3.1-gentoo-path.patch"
|
||||
eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
|
||||
eapply "${FILESDIR}/7.3.2-py37-distutils-cxx.patch"
|
||||
|
||||
sed -e "s^@EPREFIX@^${EPREFIX}^" \
|
||||
-i lib-python/3/distutils/command/install.py || die
|
||||
|
||||
# apply CPython stdlib patches
|
||||
pushd lib-python/3 > /dev/null || die
|
||||
eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
|
||||
popd > /dev/null || die
|
||||
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
tc-export CC
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# copy over to make sys.prefix happy
|
||||
cp -p "${BROOT}"/usr/lib/pypy3.7/pypy3-c-${PYPY_PV} pypy3-c || die
|
||||
cp -p "${BROOT}"/usr/lib/pypy3.7/include/${PYPY_PV}/* include/ || die
|
||||
# (not installed by pypy)
|
||||
rm pypy/module/cpyext/include/_numpypy/numpy/README || die
|
||||
mv pypy/module/cpyext/include/* include/ || die
|
||||
mv pypy/module/cpyext/parse/*.h include/ || die
|
||||
pax-mark m pypy3-c
|
||||
|
||||
einfo "Generating caches and CFFI modules ..."
|
||||
|
||||
# Generate Grammar and PatternGrammar pickles.
|
||||
./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
|
||||
|| die "Generation of Grammar and PatternGrammar pickles failed"
|
||||
|
||||
# Generate cffi modules
|
||||
# Please keep in sync with pypy/tool/build_cffi_imports.py!
|
||||
#cffi_build_scripts = {
|
||||
# "_blake2": "_blake2/_blake2_build.py",
|
||||
# "_ssl": "_ssl_build.py",
|
||||
# "sqlite3": "_sqlite3_build.py",
|
||||
# "audioop": "_audioop_build.py",
|
||||
# "tk": "_tkinter/tklib_build.py",
|
||||
# "curses": "_curses_build.py" if sys.platform != "win32" else None,
|
||||
# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
|
||||
# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
|
||||
# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
|
||||
# "resource": "_resource_build.py" if sys.platform != "win32" else None,
|
||||
# "lzma": "_lzma_build.py",
|
||||
# "_decimal": "_decimal_build.py",
|
||||
# "_sha3": "_sha3/_sha3_build.py",
|
||||
cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
|
||||
audioop syslog pwdgrp resource lzma decimal )
|
||||
use gdbm && cffi_targets+=( gdbm )
|
||||
use ncurses && cffi_targets+=( curses )
|
||||
use sqlite && cffi_targets+=( sqlite3 )
|
||||
use tk && cffi_targets+=( tkinter/tklib )
|
||||
|
||||
local t
|
||||
# all modules except tkinter output to .
|
||||
# tkinter outputs to the correct dir ...
|
||||
cd lib_pypy || die
|
||||
for t in "${cffi_targets[@]}"; do
|
||||
# tkinter doesn't work via -m
|
||||
../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
|
||||
done
|
||||
|
||||
# Cleanup temporary objects
|
||||
find -name "_cffi_*.[co]" -delete || die
|
||||
find -type d -empty -delete || die
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# (unset)
|
||||
local -x PYTHONDONTWRITEBYTECODE=
|
||||
local -x COLUMNS=80
|
||||
|
||||
# Test runner requires Python 2 too. However, it spawns PyPy3
|
||||
# internally so that we end up testing the correct interpreter.
|
||||
# (--deselect for failing doctests)
|
||||
"${EPYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest=/usr/lib/pypy3.7
|
||||
einfo "Installing PyPy ..."
|
||||
dosym pypy3-c-${PYPY_PV} "${dest}/pypy3-c"
|
||||
insinto "${dest}"
|
||||
# preserve mtimes to avoid obsoleting caches
|
||||
insopts -p
|
||||
doins -r include lib_pypy lib-python
|
||||
|
||||
# replace copied headers with symlinks
|
||||
for x in "${BROOT}"/usr/lib/pypy3.7/include/${PYPY_PV}/*; do
|
||||
dosym "${PYPY_PV}/${x##*/}" "${dest}/include/${x##*/}"
|
||||
done
|
||||
|
||||
dosym ../lib/pypy3.7/pypy3-c /usr/bin/pypy3
|
||||
dodoc README.rst
|
||||
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
|
||||
"${ED}${dest}"/lib_pypy/_sqlite3* \
|
||||
"${ED}${dest}"/lib-python/*3/test/test_sqlite.py || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED}${dest}"/lib-python/*3/{idlelib,tkinter} \
|
||||
"${ED}${dest}"/lib_pypy/_tkinter \
|
||||
"${ED}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
|
||||
local -x EPYTHON=pypy3
|
||||
local -x PYTHON=${ED}${dest}/pypy3-c-${PYPY_PV}
|
||||
# temporarily copy to build tree to facilitate module builds
|
||||
cp -p "${BROOT}${dest}/pypy3-c-${PYPY_PV}" "${PYTHON}" || die
|
||||
|
||||
echo "EPYTHON='${EPYTHON}'" > epython.py || die
|
||||
python_moduleinto /usr/lib/pypy3.7/site-packages
|
||||
python_domodule epython.py
|
||||
|
||||
einfo "Byte-compiling Python standard library..."
|
||||
python_optimize "${ED}${dest}"
|
||||
|
||||
# remove to avoid collisions
|
||||
rm "${PYTHON}" || die
|
||||
}
|
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue