summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2019-10-18 08:29:39 +0200
committerMichał Górny <mgorny@gentoo.org>2019-10-18 08:29:39 +0200
commit3caa819a54ff26fb54f4a1f55b292222d721ddfc (patch)
treedc3e04e952bc90bf8b6eeae02768a4e69ca6ae57 /dev-binpkg/pypy
parentdev-binpkg/pypy3: Restore non-SSE2 x86 backend (diff)
downloadmgorny-3caa819a54ff26fb54f4a1f55b292222d721ddfc.tar.gz
mgorny-3caa819a54ff26fb54f4a1f55b292222d721ddfc.tar.bz2
mgorny-3caa819a54ff26fb54f4a1f55b292222d721ddfc.zip
dev-binpkg/pypy: Bump to 7.2.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-binpkg/pypy')
-rw-r--r--dev-binpkg/pypy/Manifest1
-rw-r--r--dev-binpkg/pypy/pypy-7.2.0.ebuild206
2 files changed, 207 insertions, 0 deletions
diff --git a/dev-binpkg/pypy/Manifest b/dev-binpkg/pypy/Manifest
index 524f848..9e35763 100644
--- a/dev-binpkg/pypy/Manifest
+++ b/dev-binpkg/pypy/Manifest
@@ -15,3 +15,4 @@ DIST pypy2-v6.0.0-src.tar.bz2 19741694 BLAKE2B 55f5000e590613b516b12c3682a658fe6
DIST pypy2.7-v7.0.0-src.tar.bz2 19811330 BLAKE2B 38089896934d79d2b3f5813cc9dae23b0534d9d312871b22336a277d5a15b82d748f66f896558cfdb45a23004944a648436e89ae36fadc107930e7b99963e12b SHA512 7fb5682ee4226af51008f50a81c922e44c231410fe36b7656efa20f22c855ba30a01bc96ee897b4c7a02941d37a405c922b09855977313878e34aaad6bf023dc
DIST pypy2.7-v7.1.0-src.tar.bz2 20032490 BLAKE2B e916d63d7915959c87830509630d8b2ab993d012d314e88c7cc84bed4c595957c3fc575f7b57fac7c24aaf1492797ca43b146e457357b6e73d9772724461de66 SHA512 fa7c1a6669686dbd9c0da627dc2a06ad696f20274218af9602f91d73f3ebe0ede380c6e1a50534f53dee8f075eaef5a403c7c5b5bdbfff25e679ba30522391bb
DIST pypy2.7-v7.1.1-src.tar.bz2 20027876 BLAKE2B a411d7312ed3b9be9297e7ff4cc569530529272156117ca037bbe29ad477e7ce3b8903d13c6a5a35e9867a8ccbfaa418061a7b37317b4b713508c429a41ffe9a SHA512 f998931ecf4f9aeee24f0fed95589716175971816c00e50bc53de6de0cfe2a8537b89c1aee636d15faecf91df8c29943295485686185f5247a3e0913fa514f48
+DIST pypy2.7-v7.2.0-src.tar.bz2 20219532 BLAKE2B 225e2cebdfa3ceb310f2a047b1d9e1d375b181c10707822890f39fc0a5ec9e6ddd7a8cf6e073074067960b766a0a813294042513a08b8e7e02b011f612e17917 SHA512 8f724490f9fa06686c8e25ddd3592b260bbffae460395de4c7d29d983780ce9b8925fa87434aac6446aac2034381cc1a13074faf252f5d1ac466a252f219f1ae
diff --git a/dev-binpkg/pypy/pypy-7.2.0.ebuild b/dev-binpkg/pypy/pypy-7.2.0.ebuild
new file mode 100644
index 0000000..9ddef9b
--- /dev/null
+++ b/dev-binpkg/pypy/pypy-7.2.0.ebuild
@@ -0,0 +1,206 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 pypy )
+inherit check-reqs pax-utils python-any-r1 toolchain-funcs
+
+# note: remember to update this to newest dev-lang/python:2.7 on bump
+CPY_PATCHSET_VERSION="2.7.15"
+MY_P=pypy2.7-v${PV}
+
+DESCRIPTION="A fast, compliant alternative implementation of the Python language"
+HOMEPAGE="http://pypy.org/"
+SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
+
+LICENSE="MIT"
+# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
+# pypy 7.0.0: install directory changed to 'pypy2.7'
+SLOT="0/41-py27"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="bzip2 +jit low-memory ncurses sandbox cpu_flags_x86_sse2 test"
+
+DEPEND=">=sys-libs/zlib-1.1.3:0=
+ virtual/libffi:0=
+ virtual/libintl:0=
+ dev-libs/expat:0=
+ bzip2? ( app-arch/bzip2:0= )
+ ncurses? ( sys-libs/ncurses:0= )
+ app-arch/lzip
+ ${PYTHON_DEPS}"
+
+S="${WORKDIR}/${MY_P}-src"
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if use low-memory; then
+ if ! python_is_installed pypy; then
+ eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
+ eerror "or dev-python/pypy-bin being installed. Please install it using e.g.:"
+ eerror
+ eerror " $ emerge -1v dev-python/pypy-bin"
+ eerror
+ eerror "before attempting to build dev-python/pypy[low-memory]."
+ die "dev-python/pypy-bin (or 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
+ fi
+
+ [[ ${PYPY_BINPKG_STORE} ]] || die 'PYPY_BINPKG_STORE unset, wtf?!'
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ pkg_pretend
+
+ if python_is_installed pypy; then
+ if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] || use low-memory; then
+ einfo "Using already-installed PyPy to perform the translation."
+ local 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."
+ fi
+ fi
+
+ python-any-r1_pkg_setup
+
+ local cpu
+ if use amd64; then
+ # common denominator between Intel & AMD
+ cpu='x86-64'
+ elif use x86; then
+ if use cpu_flags_x86_sse2; then
+ # lowest with SSE2
+ cpu='pentium-m'
+ else
+ # lowest with SSE, compat. with athlon-xp
+ # TODO: do we want to support something older?
+ cpu='pentium3'
+ fi
+ else
+ die "Unsupported arch ${ARCH}"
+ fi
+
+ export CFLAGS="-march=${cpu} -mtune=generic -O2 -pipe"
+ export CXXFLAGS=${CFLAGS}
+
+ elog "CFLAGS: ${CFLAGS}"
+ fi
+}
+
+src_prepare() {
+ eapply "${FILESDIR}"/5.9.0-shared-lib.patch # 517002
+
+ eapply_user
+}
+
+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=(
+ --shared
+ $(usex jit -Ojit -O2)
+ $(usex sandbox --sandbox '')
+
+ ${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=( "${PYTHON}" )
+ if use low-memory; then
+ interp=( env PYPY_GC_MAX_DELTA=200MB
+ "${PYTHON}" --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
+
+ # copy back to make sys.prefix happy
+ cp -p "${T}"/usession*-0/testing_1/{pypy-c,libpypy-c.so} . || die
+ pax-mark m pypy-c libpypy-c.so
+}
+
+src_install() {
+ local flags=( bzip2 jit ncurses sandbox )
+ use x86 && flags+=( cpu_flags_x86_sse2 )
+ local f suffix="-${ARCH}"
+
+ for f in ${flags[@]}; do
+ use ${f} && suffix+="+${f#cpu_flags_x86_}"
+ done
+
+ local BIN_P=pypy-bin-${PV}
+
+ einfo "Zipping PyPy ..."
+ mkdir "${BIN_P}${suffix}"{,/include} || die
+ mv pypy-c libpypy-c.so "${BIN_P}${suffix}"/ || die
+ mv include/pypy_* "${BIN_P}${suffix}"/include/ || die
+ chmod +x "${BIN_P}${suffix}"/pypy-c || die
+
+ tar -cf "${BIN_P}${suffix}.tar" "${BIN_P}${suffix}" || die
+ lzip -v9 "${BIN_P}${suffix}.tar" || die
+}
+
+# Yup, very hacky.
+pkg_preinst() {
+ # integrity check.
+ [[ ${PYPY_BINPKG_STORE} ]] || die 'PYPY_BINPKG_STORE unset, wtf?!'
+ mkdir -p "${ROOT%/}${PYPY_BINPKG_STORE}" || die
+ mv "${S}"/*.tar.lz "${ROOT%/}${PYPY_BINPKG_STORE}" || die
+}