From a787ab90ec79d5832c41c649015de01c2a87f050 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Wed, 7 Sep 2016 16:42:46 +0200 Subject: dev-binpkg/pypy: Bump to 5.4.1 --- dev-binpkg/pypy/Manifest | 1 + dev-binpkg/pypy/pypy-5.4.1.ebuild | 193 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 194 insertions(+) create mode 100644 dev-binpkg/pypy/pypy-5.4.1.ebuild diff --git a/dev-binpkg/pypy/Manifest b/dev-binpkg/pypy/Manifest index 712061e..93a57ca 100644 --- a/dev-binpkg/pypy/Manifest +++ b/dev-binpkg/pypy/Manifest @@ -6,3 +6,4 @@ DIST pypy-5.1.1-src.tar.bz2 17328934 SHA256 ca3d943d7fbd78bb957ee9e5833ada4bb850 DIST pypy2-v5.3.0-src.tar.bz2 17361429 SHA256 4142eb8f403810bc88a4911792bb5a502e152df95806e33e69050c828cd160d5 SHA512 6387987b93bebf8ca6d820bde6c42c1a7427a778ff01cf93766df34be792cb1a8d927b3e402f90159df75f68aa1c913a28e9d453e3b13b28489cb68670ef121d WHIRLPOOL 57b9718b1ed72f13005a6d5a60b24d0fdab522ff63b3f91264433cf17f0bb4c5f36e3121d8d92744386fa5d31fbce14711689c85f87a53b68bfdbddaa19a3edd DIST pypy2-v5.3.1-src.tar.bz2 17361760 SHA256 31a52bab584abf3a0f0defd1bf9a29131dab08df43885e7eeddfc7dc9b71836e SHA512 3138dde3cb1a155e389a2be615601e22f468d2bc77dd219a35b310052fa06f68f80c3ff62fa4d0a9179eae014ace18620d0a076a0528cb155b1c33cc94d6b397 WHIRLPOOL 518b73ec649673fb1fc333b5d0e7669f06e9569624e2f8b55dbbf24b5f109a3b9680ed1d45c6401eb62ee8761043ec9c38a33e6d396c39c3f2fb5ba30f15e93a DIST pypy2-v5.4.0-src.tar.bz2 17414795 SHA256 d9568ebe9a14d0eaefde887d78f3cba63d665e95c0d234bb583932341f55a655 SHA512 a989393f75ff45d6a8b8b2597c0a208559b3188ffdf65205ad491332f1836a86bbb419a3dfba67f80e5ab8d075aa97f44c63316f805a51d7ce1481e81b461373 WHIRLPOOL 623bbaed02214cbc2092abd163e102c11405f12b73dd2ace8098e08a415bd43a0bf13809913b56c378a8a688ff6ff561dc9a90bcd479de85bb301aa67c670d26 +DIST pypy2-v5.4.1-src.tar.bz2 17412285 SHA256 45dbc50c81498f6f1067201b8fc887074b43b84ee32cc47f15e7db17571e9352 SHA512 a366457f5d1fc06dfb256256350b5f2e8e107fe9bc587acc291500ae8b03083788128681ebd5ae272a87b5b7c95abda0210ed7b5594e15f8f0a96a9ff4953375 WHIRLPOOL 1b84ed9a5df88f4ec7beebf75f86d02ddab2349e34c5516bf4ea21e0374dbb5520ca0c6c429b83262c63e6bc452a3270a4d79fec6b2caff7bc884d8103989acc diff --git a/dev-binpkg/pypy/pypy-5.4.1.ebuild b/dev-binpkg/pypy/pypy-5.4.1.ebuild new file mode 100644 index 0000000..63dc8fe --- /dev/null +++ b/dev-binpkg/pypy/pypy-5.4.1.ebuild @@ -0,0 +1,193 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 pypy ) +inherit check-reqs eutils multilib multiprocessing pax-utils python-any-r1 toolchain-funcs versionator + +MY_P=pypy2-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" +SLOT="0/$(get_version_component_range 1-2 ${PV})" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="bzip2 +jit low-memory ncurses sandbox shadowstack sqlite cpu_flags_x86_sse2" + +DEPEND=">=sys-libs/zlib-1.1.3:0= + virtual/libffi:0= + virtual/libintl:0= + dev-libs/expat:0= + dev-libs/openssl:0=[-bindist] + bzip2? ( app-arch/bzip2:0= ) + ncurses? ( sys-libs/ncurses:0= ) + app-arch/lzip + ${PYTHON_DEPS}" + +S="${WORKDIR}/${MY_P}-src" + +pkg_pretend() { + 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 + + [[ ${PYPY_BINPKG_STORE} ]] || die 'PYPY_BINPKG_STORE unset, wtf?!' +} + +pkg_setup() { + 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}" +} + +src_prepare() { + epatch "${FILESDIR}"/2.5.0-shared-lib.patch # 517002 + + epatch_user +} + +src_compile() { + 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 shadowstack --gcrootfinder=shadowstack '') + $(usex sandbox --sandbox '') + + ${jit_backend} + --make-jobs=$(makeopts_jobs) + + 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 + + set -- "${interp[@]}" rpython/bin/rpython --batch "${args[@]}" + echo -e "\033[1m${@}\033[0m" + "${@}" || die "compile error" + + pax-mark m "${ED%/}${INSDESTTREE}/pypy-c" +} + +src_install() { + local flags=( bzip2 jit ncurses sandbox shadowstack ) + 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 +} -- cgit v1.2.3-65-gdbad