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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D9BD5158020 for ; Thu, 24 Nov 2022 16:47:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2F200E0907; Thu, 24 Nov 2022 16:47:39 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0A8A7E0907 for ; Thu, 24 Nov 2022 16:47:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2A8E9340D4C for ; Thu, 24 Nov 2022 16:47:38 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8391821 for ; Thu, 24 Nov 2022 16:47:36 +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: <1669308451.1e1b2e96b1ece78f0bad39255d58316bbd16a56c.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy-exe/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/pypy-exe/Manifest dev-python/pypy-exe/pypy-exe-7.3.10_rc3.ebuild X-VCS-Directories: dev-python/pypy-exe/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 1e1b2e96b1ece78f0bad39255d58316bbd16a56c X-VCS-Branch: master Date: Thu, 24 Nov 2022 16:47:36 +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: b021af31-9725-4904-88af-740c78b5b343 X-Archives-Hash: 47a5b2112b0c2dcb41bb0023c29e70a6 commit: 1e1b2e96b1ece78f0bad39255d58316bbd16a56c Author: Michał Górny gentoo org> AuthorDate: Thu Nov 24 16:07:42 2022 +0000 Commit: Michał Górny gentoo org> CommitDate: Thu Nov 24 16:47:31 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e1b2e96 dev-python/pypy-exe: Bump to 7.3.10_rc3 Signed-off-by: Michał Górny gentoo.org> dev-python/pypy-exe/Manifest | 2 + dev-python/pypy-exe/pypy-exe-7.3.10_rc3.ebuild | 185 +++++++++++++++++++++++++ 2 files changed, 187 insertions(+) diff --git a/dev-python/pypy-exe/Manifest b/dev-python/pypy-exe/Manifest index d80989cc20f1..a571f5ad08ae 100644 --- a/dev-python/pypy-exe/Manifest +++ b/dev-python/pypy-exe/Manifest @@ -1,2 +1,4 @@ +DIST pypy2.7-gentoo-patches-7.3.10rc3.tar.xz 5324 BLAKE2B 83675b7d2aa0eaace337308e9d818e1d745471a72bd67f269265b06b40a2fb62e26aedd2489ceaf02eb15dd655277dcf8fc3fe280d83d636afb0a69eb2b35795 SHA512 7fdf4fc2f7fdd8accd8af6f8713c6db55510be7a129e608ef0a7c30cd8db74f2711ded41daae3d2d698e394a146996cf699d87147a5d433a2321bcb7682c15b7 DIST pypy2.7-gentoo-patches-7.3.9_p1.tar.xz 7832 BLAKE2B d04fc46ab9dc8b212ed3783c1ce49d72f96dfde754da67cc97ea0c193e7ad7f5f8fdd68561b93ef0b22dde86ec3f848ee8ec8a3d78d925b6d96abd2d88d34c14 SHA512 b9d2ccccab34a5027f68e1429ff6862a0172cf8cc9eaef5e4eaa3eb091d9c2751701dbe1f61481fd84d08cb3d5bafb40a5c753906c17dc2a57bfc28acd673e1a +DIST pypy2.7-v7.3.10rc3-src.tar.bz2 19776339 BLAKE2B a6866a0ff7a7b4bb3e1815fdc741cc95ff7945f6271e0189b6d16d1efc64c72a75a1400c3859a5b8c5f5b176217463a446b3449093572df59e13df15a207828f SHA512 097d57862728197e648cf38380ce4a60d6192bc9f2c0c2cf6840717af0320acd8cf42e344513428be60f60e136d830a0bb5d6295e7909cd7f3a42bac992c780a DIST pypy2.7-v7.3.9-src.tar.bz2 23328628 BLAKE2B 50d015439b6a6f15dd24eb4524726a2054f0d8e7ef209b54dc4eb9365b41b333f3dad525422316af3ff19e6ffb5866859db4455e05fc1529a81ce3b6e7c621db SHA512 8d7513d4efe924f2456dd65a45a82dd16171f7962c81ba90f2a168c332cdad78ceffa3ed1af379c09e61082b39d5c2a8385cd77c89b698c47cc75e9df1bb4d2a diff --git a/dev-python/pypy-exe/pypy-exe-7.3.10_rc3.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.10_rc3.ebuild new file mode 100644 index 000000000000..e5db7a520127 --- /dev/null +++ b/dev-python/pypy-exe/pypy-exe-7.3.10_rc3.ebuild @@ -0,0 +1,185 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +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="" +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}" +}