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 AD561138334 for ; Wed, 27 Mar 2019 12:48:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BB882E0916; Wed, 27 Mar 2019 12:48:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 7D742E0916 for ; Wed, 27 Mar 2019 12:48:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 BEE3A335D0F for ; Wed, 27 Mar 2019 12:48:40 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 365E0520 for ; Wed, 27 Mar 2019 12:48:39 +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: <1553690888.d986989a4c3a04095b4596f52d1dcc164f4f2a76.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.1.0.ebuild X-VCS-Directories: dev-binpkg/pypy/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: d986989a4c3a04095b4596f52d1dcc164f4f2a76 X-VCS-Branch: master Date: Wed, 27 Mar 2019 12:48:39 +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: bf312c97-435a-4aa9-acb8-e35eb761acb0 X-Archives-Hash: 06a81e146d5ba0e40deb79a3ea493bb6 commit: d986989a4c3a04095b4596f52d1dcc164f4f2a76 Author: Michał Górny gentoo org> AuthorDate: Wed Mar 27 12:48:08 2019 +0000 Commit: Michał Górny gentoo org> CommitDate: Wed Mar 27 12:48:08 2019 +0000 URL: https://gitweb.gentoo.org/repo/dev/mgorny.git/commit/?id=d986989a dev-binpkg/pypy: Bump to 7.1.0 Signed-off-by: Michał Górny gentoo.org> dev-binpkg/pypy/Manifest | 1 + dev-binpkg/pypy/pypy-7.1.0.ebuild | 208 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 209 insertions(+) diff --git a/dev-binpkg/pypy/Manifest b/dev-binpkg/pypy/Manifest index 26499c9..e663c92 100644 --- a/dev-binpkg/pypy/Manifest +++ b/dev-binpkg/pypy/Manifest @@ -13,3 +13,4 @@ DIST pypy2-v5.8.0-src.tar.bz2 19163498 BLAKE2B 377971cf9e9a5ea75966937e9f22fe24d DIST pypy2-v5.9.0-src.tar.bz2 19175394 BLAKE2B 0d5fa0d013d8cdb9765bf0f535877894d7a3544c19481973f788187251d1bd2ba11f88950430e85c7608ea394cc952ae7dd7275b9843397ab098e153cf96ec7f SHA512 3170747e81088043c6a4885bd0bc92e911556420b6c2539a4ed7e62956f1c741651f772def0fb00d8826a1bef9d6f4e79a13682a4456a31d987f7c9bd8608a4d DIST pypy2-v6.0.0-src.tar.bz2 19741694 BLAKE2B 55f5000e590613b516b12c3682a658fe6a17fbe264be3d61a81698cdf098b39177cf4355eb3f28980209c7a0e005498201cbad8884e3aa02cc86a228d1552046 SHA512 d3bdcd65fc83f2fda3203a604733fe6765049a17cca2715cd6045dc302a6159b4741a821c53fa4c97acf7297cef4c62e941a6a6eb7f8a253a93a28dcf2aa2ca0 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 diff --git a/dev-binpkg/pypy/pypy-7.1.0.ebuild b/dev-binpkg/pypy/pypy-7.1.0.ebuild new file mode 100644 index 0000000..1d8d127 --- /dev/null +++ b/dev-binpkg/pypy/pypy-7.1.0.ebuild @@ -0,0 +1,208 @@ +# 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 libressl 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= ) + !libressl? ( dev-libs/openssl:0=[-bindist] ) + libressl? ( dev-libs/libressl: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 libressl 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 +}