From b004a9255b47a53fd0428e4dfd72f3b76ac49541 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Fri, 18 Oct 2019 08:30:22 +0200 Subject: dev-binpkg/pypy3: Bump to 7.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- dev-binpkg/pypy3/Manifest | 1 + dev-binpkg/pypy3/pypy3-7.2.0.ebuild | 196 ++++++++++++++++++++++++++++++++++++ 2 files changed, 197 insertions(+) create mode 100644 dev-binpkg/pypy3/pypy3-7.2.0.ebuild diff --git a/dev-binpkg/pypy3/Manifest b/dev-binpkg/pypy3/Manifest index f058403..5c05d4d 100644 --- a/dev-binpkg/pypy3/Manifest +++ b/dev-binpkg/pypy3/Manifest @@ -10,3 +10,4 @@ DIST pypy3.3-v5.5.0-alpha-src.tar.bz2 25122033 BLAKE2B 6d0fc60fd8f5461a043f7a48d DIST pypy3.5-v7.0.0-src.tar.bz2 22730690 BLAKE2B 312aea1f88303b225bbfa5e82a28d3c2893d9977b03a3fd12923db15c4a77f04ec3fbce947f0684c4e27073836583ef8a5eaf5be05612e564172170740c2a6e3 SHA512 3facac26e06e254cbf244841824b35ec211859123f6ba9f095dc980292c10d9cf1d11de62cc6372cf77e92ee1cd2358bbd794b3ff25cb7172e1b21c02c8ce6c2 DIST pypy3.6-v7.1.0-src.tar.bz2 23167216 BLAKE2B 12a085c2d4820289643818d8bc1c17304e4cf4f4687054452d878c6f26fd36802bbbe5baee73f0ce2f0322e126dbccbcf7b48ca6569bb7eb8d59f473bd80d4b1 SHA512 1a0a9e9de31c63114c0537747c4a718504a28b780a2ef1f76bff6051a1ec68b496b574989f0b729c07611cd81e199135dd268834dfa6f9664e1e119db8ae20e4 DIST pypy3.6-v7.1.1-src.tar.bz2 23171982 BLAKE2B be43528bc6f3e02d146016a4969bd8c7a9e880a3bd3b77f441aac6d22ef67700f71e0171ec000066bd2c0bd506db64af69d6b75b59a92222dd0353ee70e6629b SHA512 17e78f9c7080d597a6283d8e8247d1ca78f09a14ff221db8c3d90d255b5befc73102b317ca34a80979e544d5ee72f3e5e649f89d185a085f4cc15012da4d0473 +DIST pypy3.6-v7.2.0-src.tar.bz2 21850076 BLAKE2B 756ea3034fe8971c979ec83c9cbfac55a680f3ef03b276475aa4318f3480ae5ede609b8413412df64db553a33979670498b1f97184f3b57406619c9db7f01127 SHA512 bcbb53062a473d504bcc082cf6286f6169c83d1f38d22c4d7c4e46ddc32bca9d91e71194637e6650db5bec02b29fe262b22fe236d627b6bc3e6e0c59c66c07cc diff --git a/dev-binpkg/pypy3/pypy3-7.2.0.ebuild b/dev-binpkg/pypy3/pypy3-7.2.0.ebuild new file mode 100644 index 0000000..5937d67 --- /dev/null +++ b/dev-binpkg/pypy3/pypy3-7.2.0.ebuild @@ -0,0 +1,196 @@ +# Copyright 1999-2019 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 pypy ) +inherit check-reqs 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="http://pypy.org/" +SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2" + +LICENSE="MIT" +# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))' +SLOT="0/71" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="bzip2 +jit low-memory ncurses sandbox cpu_flags_x86_sse2" + +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 + low-memory? ( virtual/pypy:0 ) + !low-memory? ( ${PYTHON_DEPS} )" +# doc? ( dev-python/sphinx ) + +S="${WORKDIR}/${MY_P}-src" + +pkg_pretend() { + if [[ ${MERGE_TYPE} != binary ]]; then + 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 + fi +} + +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]]; then + pkg_pretend + + # unset to allow forcing pypy below :) + use low-memory && local EPYTHON= + if python_is_installed pypy && [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]]; then + einfo "Using PyPy to perform the translation." + local 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 "virtual/pypy and ensure that EPYTHON variable is unset." + 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/{pypy3-c,libpypy3-c.so} . || die + pax-mark m pypy3-c libpypy3-c.so + + #use doc && emake -C pypy/doc html +} + +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=pypy3-bin-${PV} + + einfo "Zipping PyPy ..." + mkdir "${BIN_P}${suffix}"{,/include} || die + mv pypy3-c libpypy3-c.so "${BIN_P}${suffix}"/ || die + mv include/pypy_* "${BIN_P}${suffix}"/include/ || die + chmod +x "${BIN_P}${suffix}"/pypy3-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 +} -- cgit v1.2.3-65-gdbad