diff options
author | V3n3RiX <venerix@koprulu.sector> | 2025-02-08 00:11:30 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2025-02-08 00:11:30 +0000 |
commit | 8b3c41ecef8a1cdd270ce3aabcfdfb991839699c (patch) | |
tree | ece43c29d9163f887ef99c43aad6f2f568961231 /dev-lang/pypy3-exe | |
parent | 1b2360e7bab42e4045232887cb4f6c4a24ca3975 (diff) |
Diffstat (limited to 'dev-lang/pypy3-exe')
-rw-r--r-- | dev-lang/pypy3-exe/Manifest | 4 | ||||
-rw-r--r-- | dev-lang/pypy3-exe/metadata.xml | 16 | ||||
-rw-r--r-- | dev-lang/pypy3-exe/pypy3-exe-3.11.7.3.18.ebuild | 136 |
3 files changed, 156 insertions, 0 deletions
diff --git a/dev-lang/pypy3-exe/Manifest b/dev-lang/pypy3-exe/Manifest new file mode 100644 index 000000000000..9eff854f84a0 --- /dev/null +++ b/dev-lang/pypy3-exe/Manifest @@ -0,0 +1,4 @@ +DIST pypy3.11-gentoo-patches-7.3.18.tar.xz 3688 BLAKE2B 9cb19493eb9b9cb38f17d59931a9cd84328e69a85bc8c0c76cdbcf92a5990d50ffe8b7d4b605f7fbab314d40b8afdb6824ffbe5f51df628404421dc842ed5986 SHA512 07ee93108d13546fe1323cf1c2bffa9335646592a83f0ddb5f69e2e4bd31f5349d611ee569d2ab6e3cfa70d91dbaea8feced562aa868583ca5c623b0ab8d1555 +DIST pypy3.11-v7.3.18-src.tar.bz2 24908760 BLAKE2B e467d0b9ad254382bc727be0d2eea61573857a9638f0f7c896069bc2db9052876a1c9c77f12672728754287e0f69fc38a6cd8d7235e9be82de87292e409e85a4 SHA512 d4337a69c46c86594ae3eae09b8ab83db073eb4955f4e04bb8168ac412e8e55698938c2045f3e5d3c6a459a19cdf45a08af63e7587922a5d879fba373c6c9faf +EBUILD pypy3-exe-3.11.7.3.18.ebuild 2775 BLAKE2B bf3a43fb34d96eb6969950247682335acd0c35c01c8f72928b238058a625625ea89509446f8f47dfaa82319a740fdd65f8f2b9193e0dbfbdcdb1146d6eadc724 SHA512 c12f40652fa4b15206b7ae5b1e436331a2997ecede608326d05297700b228af02e9c77ccf1f741f0af9e43cd8f501c6ac89730a926d5472cfd9bf9bf20129624 +MISC metadata.xml 572 BLAKE2B cfcd1422ec312338fd876bc4747a962ac3c4bd06e28a3891489b065fba4c7be2daa6955f51e8136d9b8cf7b68bb7eb887b6f419ee9fd626ebd6db204acb7995d SHA512 c79250d47e3d5c99c2c903bfc185449cc41f88e2b923b8eae1401e83c0f23fa1a12ad85f50b6e25844e805e543ae897ccf43185a1bdf9f992dff765249e55bc1 diff --git a/dev-lang/pypy3-exe/metadata.xml b/dev-lang/pypy3-exe/metadata.xml new file mode 100644 index 000000000000..3f2aeb55aa5e --- /dev/null +++ b/dev-lang/pypy3-exe/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>python@gentoo.org</email> + <name>Python</name> + </maintainer> + <upstream> + <remote-id type="github">pypy/pypy</remote-id> + </upstream> + <use> + <flag name="low-memory">Build using PyPy with the engine configured towards low memory footprint. + This makes it possible to build PyPy using ~3.5G of RAM on amd64 and ~half of that on x86, + at the cost of lengthened build time.</flag> + </use> +</pkgmetadata> diff --git a/dev-lang/pypy3-exe/pypy3-exe-3.11.7.3.18.ebuild b/dev-lang/pypy3-exe/pypy3-exe-3.11.7.3.18.ebuild new file mode 100644 index 000000000000..9766feaccfc6 --- /dev/null +++ b/dev-lang/pypy3-exe/pypy3-exe-3.11.7.3.18.ebuild @@ -0,0 +1,136 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit check-reqs pax-utils toolchain-funcs + +PYVER=$(ver_cut 1-2) +PATCHSET_PV=$(ver_cut 3-) +PYPY_PV=${PATCHSET_PV%_p*} + +MY_P="pypy${PYVER}-v${PYPY_PV/_}" +PATCHSET="pypy${PYVER}-gentoo-patches-${PATCHSET_PV/_rc/rc}" + +DESCRIPTION="PyPy3.11 executable (build from source)" +HOMEPAGE=" + https://pypy.org/ + https://github.com/pypy/pypy/ +" +SRC_URI=" + https://downloads.python.org/pypy/${MY_P}-src.tar.bz2 + 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="${PV%_p*}" +IUSE="+jit low-memory ncurses cpu_flags_x86_sse2" + +RDEPEND=" + app-arch/bzip2:0= + dev-libs/expat:0= + dev-libs/libffi:0= + >=sys-libs/zlib-1.1.3:0= + virtual/libintl:0= + ncurses? ( sys-libs/ncurses:0= ) + !dev-lang/pypy3-exe-bin:${SLOT} +" +DEPEND=" + ${RDEPEND} +" +BDEPEND=" + || ( + dev-lang/pypy:2.7 + dev-python/pypy + ) + virtual/pkgconfig +" + +check_env() { + if use low-memory; then + 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() { + [[ ${MERGE_TYPE} != binary ]] && check_env +} + +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 + --withmod-bz2 + $(usex ncurses --with{,out}mod-_minimal_curses) + ) + + local interp=( pypy ) + if use low-memory; then + local -x PYPY_GC_MAX_DELTA=200MB + interp+=( --jit loop_longevity=300 ) + 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() { + cd "${T}"/usession*-0 || die + newbin "testing_1/pypy${PYVER}-c" "pypy${PYVER}-c-${PYPY_PV}" + insinto "/usr/include/pypy${PYVER}/${PYPY_PV}" + doins *.h + pax-mark m "${ED}/usr/bin/pypy${PYVER}-c-${PYPY_PV}" +} |