From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 12A46138334 for ; Fri, 18 Oct 2019 06:30:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 60E95E08C4; Fri, 18 Oct 2019 06:30:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2EF46E08C4 for ; Fri, 18 Oct 2019 06:30:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BFABD34BFF2 for ; Fri, 18 Oct 2019 06:30:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D124D76A for ; Fri, 18 Oct 2019 06:30:30 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1571380179.3caa819a54ff26fb54f4a1f55b292222d721ddfc.mgorny@gentoo> Subject: [gentoo-commits] repo/dev/mgorny:master commit in: dev-binpkg/pypy/ X-VCS-Repository: repo/dev/mgorny X-VCS-Files: dev-binpkg/pypy/Manifest dev-binpkg/pypy/pypy-7.2.0.ebuild X-VCS-Directories: dev-binpkg/pypy/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 3caa819a54ff26fb54f4a1f55b292222d721ddfc X-VCS-Branch: master Date: Fri, 18 Oct 2019 06:30:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 751a388c-ce56-4911-b0f7-f8cd385f5ffd X-Archives-Hash: f4106453a6c8613869fdcaefda17ea29 commit: 3caa819a54ff26fb54f4a1f55b292222d721ddfc Author: Michał Górny gentoo org> AuthorDate: Fri Oct 18 06:29:39 2019 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Oct 18 06:29:39 2019 +0000 URL: https://gitweb.gentoo.org/repo/dev/mgorny.git/commit/?id=3caa819a dev-binpkg/pypy: Bump to 7.2.0 Signed-off-by: Michał Górny gentoo.org> dev-binpkg/pypy/Manifest | 1 + dev-binpkg/pypy/pypy-7.2.0.ebuild | 206 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 207 insertions(+) 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 +}