From 40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 28 Apr 2021 20:21:43 +0100 Subject: gentoo resync : 28.04.2021 --- dev-python/pypy-exe/Manifest | 3 + dev-python/pypy-exe/pypy-exe-7.3.4.ebuild | 178 ++++++++++++++++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 dev-python/pypy-exe/pypy-exe-7.3.4.ebuild (limited to 'dev-python/pypy-exe') diff --git a/dev-python/pypy-exe/Manifest b/dev-python/pypy-exe/Manifest index 740f422025a5..3c2dde5ecec8 100644 --- a/dev-python/pypy-exe/Manifest +++ b/dev-python/pypy-exe/Manifest @@ -1,4 +1,7 @@ DIST pypy2.7-gentoo-patches-7.3.3_p2.tar.xz 11184 BLAKE2B b2b9b94478609372d616c65a87cbb12a07e217928beef9fac26c428f81c662ef390db3fd85bf368ffcc8c6fa3802e506412b7bebd14bdc453009008bc3459d25 SHA512 9ab8ed99b42b36e9c212683ef93f7f1fb99caecf056293ab9a5734f8b52eedec192860702baa121630558530cb5c4652f8542300ecaaaa282377ea6456618b95 +DIST pypy2.7-gentoo-patches-7.3.4.tar.xz 7844 BLAKE2B d06694fa085667e40ef8805c29f7ccf95b49f9de4e99e3ebfa3d69c4202a0ddcebb54c524d7d9f9ec67573a8d2ebe38fb7023d4d3ecef67afc907ecef5c16c02 SHA512 aa8ffefb5d30070ae86c1c14c55c277e39d3da66aea3a0951319158fb65e716e7fa7864e8bf5d26314d4b2a8030c766b63cad6a3663822d2875cd8cc1f3f2de5 DIST pypy2.7-v7.3.3-src.tar.bz2 20881821 BLAKE2B ce1ecdd1fffe40574c7662da6038b84d2bca47ab168939ef0c12be2c6348317f17a94a3026e7fa53c71601edc153aefd98f770bd148e7af07ca751c0a5fc1252 SHA512 c2b6c44fdcac5f9445fab01572f859228fc286891fd09a4ddb95d283683d805276c853ec8e61fcd04cb9ee811d0e959d19bb03fdd7442c044f28a773633122e7 +DIST pypy2.7-v7.3.4-src.tar.bz2 21571561 BLAKE2B d0ac56fadec63fe7e65728c36c2aaf96fc5f54919dddbca9571a24c42a9e3e21f672f84555a18a384c4715f0489bd7aef009c0a47b635de88c472a93e2ae8d71 SHA512 4c18c2dbfbf0cc1034bea773828204df77aec7ef82119fb94e5cb762ce1783e00ad70e99d1432b4948dc132e726bdc6015f4a5bf10a5b10415bcfe99da2ecd17 EBUILD pypy-exe-7.3.3_p2.ebuild 4300 BLAKE2B 0b02d3c04a0921c1a0de139ce1ea6990c923931641567e57a5827e40f87d8538ca2d0f500ef062260b43ded984f8ec6063d72ded50600b3a8b643224b5d67a7d SHA512 d3b388afb00117df5c739fdf6a27e9dfe1e8b892b0e248e8ad915bc4661ad24da3119340e5a32fa4c09b9800329461760b0a17b3eb37f6fc294912ec06b9fb08 +EBUILD pypy-exe-7.3.4.ebuild 4302 BLAKE2B 1b66c71c7584d3b80d686740727c92fe64a4f81360451da4212e5f6618c8368f93df16488ed50bbc94f9472374fac48b7028054b3266c2e01d5826c642f38239 SHA512 b95a9a2558758835ec6302d02fada4b02f3c711ddc55df8728ec9f6b64cf3846ce63f910df458dd47a6a7a17a22abbc7029bacc7527a12233fecb55b260211f9 MISC metadata.xml 497 BLAKE2B 02040ea95327971e16090c00e5771bc684710e90000ca07b366226fedbae8973a1f4bdd9d37506446a2fe3caea4fdf83ca186d2706747adccd14ea24a19486b3 SHA512 816621f5288b822fc1c7b360ac6f1e5f7b464a60c9b6e58fc464860bb8a4f44be932fe6562625006925ddda2b5cc14feeaef587303642d894494ddea6472cd2a diff --git a/dev-python/pypy-exe/pypy-exe-7.3.4.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.4.ebuild new file mode 100644 index 000000000000..b76695a82c8b --- /dev/null +++ b/dev-python/pypy-exe/pypy-exe-7.3.4.ebuild @@ -0,0 +1,178 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) +inherit check-reqs pax-utils python-any-r1 toolchain-funcs + +PYPY_PV=${PV%_p*} +MY_P=pypy2.7-v${PYPY_PV} +PATCHSET="pypy2.7-gentoo-patches-${PV}" + +DESCRIPTION="PyPy executable (build from source)" +HOMEPAGE="https://www.pypy.org/" +SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2 + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz" +S="${WORKDIR}/${MY_P}-src" + +LICENSE="MIT" +SLOT="${PYPY_PV}" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux" +IUSE="bzip2 +jit low-memory ncurses cpu_flags_x86_sse2" + +RDEPEND=">=sys-libs/zlib-1.1.3:0= + dev-libs/libffi:0= + virtual/libintl:0= + dev-libs/expat:0= + bzip2? ( app-arch/bzip2:0= ) + ncurses? ( sys-libs/ncurses:0= ) + !dev-python/pypy-exe-bin:${PYPY_PV}" +# don't enforce the dep on pypy with USE=low-memory since it's going +# to cause either collisions or circular dep on itself +DEPEND="${RDEPEND}" +BDEPEND=" + !low-memory? ( + || ( + dev-python/pypy + dev-lang/python:2.7 + ) + )" + +check_env() { + if use low-memory; then + if ! has_version -b dev-python/pypy && + ! has_version -b dev-python/pypy-bin + then + eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy" + eerror "being installed. Please install it using e.g.:" + eerror + eerror " $ emerge -1v dev-python/pypy dev-python/pypy-exe-bin" + eerror + eerror "before attempting to build dev-python/pypy-exe[low-memory]." + die "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 +} + +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && check_env +} + +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]]; then + check_env + + use low-memory && EPYTHON= + if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] && + { has_version -b dev-python/pypy || + has_version -b dev-python/pypy-bin; } + then + einfo "Using already-installed PyPy to perform the translation." + 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." + python-any-r1_pkg_setup + fi + fi +} + +src_prepare() { + local PATCHES=( + "${WORKDIR}/${PATCHSET}" + ) + default +} + +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=( + --no-shared + $(usex jit -Ojit -O2) + + ${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=( "${EPYTHON}" ) + if use low-memory; then + interp=( env PYPY_GC_MAX_DELTA=200MB + "${EPYTHON}" --jit loop_longevity=300 ) + fi + + if [[ ${EPYTHON} != pypy ]]; then + # reuse bundled pycparser to avoid external dep + mkdir -p "${T}"/pymod/cffi || die + : > "${T}"/pymod/cffi/__init__.py || die + cp -r lib_pypy/cffi/_pycparser "${T}"/pymod/cffi/ || die + local -x PYTHONPATH=${T}/pymod:${PYTHONPATH} + fi + + # translate into the C sources + # we're going to build 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 +} + +src_install() { + local dest=/usr/lib/pypy2.7 + exeinto "${dest}" + newexe "${T}"/usession*-0/testing_1/pypy-c pypy-c-${PYPY_PV} + insinto "${dest}"/include/${PYPY_PV} + doins include/pypy_* + pax-mark m "${ED}${dest}/pypy-c-${PYPY_PV}" +} -- cgit v1.2.3