From 5087f37a4d9063896fce9cf625aa2479bc540b94 Mon Sep 17 00:00:00 2001 From: Crucible Date: Thu, 15 Oct 2026 17:23:01 -0500 Subject: Publish srcux candidate 0000000660-20261015-172104 --- dev-lang/pypy/Manifest | 6 + dev-lang/pypy/pypy-2.7.8.0.0-r1.ebuild | 316 +++++++++++++++++++++ dev-lang/pypy/pypy-2.7.8.0.1.ebuild | 316 +++++++++++++++++++++ dev-lang/pypy/pypy-3.11.8.0.1.ebuild | 236 +++++++++++++++ dev-lang/pypy/pypy-3.12.8.0.1.ebuild | 235 +++++++++++++++ dev-lang/pypy3-exe-bin/Manifest | 16 ++ .../pypy3-exe-bin/pypy3-exe-bin-3.11.8.0.1.ebuild | 78 +++++ .../pypy3-exe-bin/pypy3-exe-bin-3.12.8.0.1.ebuild | 78 +++++ dev-lang/pypy3-exe/Manifest | 4 + dev-lang/pypy3-exe/pypy3-exe-3.11.8.0.1.ebuild | 133 +++++++++ dev-lang/pypy3-exe/pypy3-exe-3.12.8.0.1.ebuild | 133 +++++++++ 11 files changed, 1551 insertions(+) create mode 100644 dev-lang/pypy/pypy-2.7.8.0.0-r1.ebuild create mode 100644 dev-lang/pypy/pypy-2.7.8.0.1.ebuild create mode 100644 dev-lang/pypy/pypy-3.11.8.0.1.ebuild create mode 100644 dev-lang/pypy/pypy-3.12.8.0.1.ebuild create mode 100644 dev-lang/pypy3-exe-bin/pypy3-exe-bin-3.11.8.0.1.ebuild create mode 100644 dev-lang/pypy3-exe-bin/pypy3-exe-bin-3.12.8.0.1.ebuild create mode 100644 dev-lang/pypy3-exe/pypy3-exe-3.11.8.0.1.ebuild create mode 100644 dev-lang/pypy3-exe/pypy3-exe-3.12.8.0.1.ebuild (limited to 'dev-lang') diff --git a/dev-lang/pypy/Manifest b/dev-lang/pypy/Manifest index 966eab69b6f6..43a0755a3683 100644 --- a/dev-lang/pypy/Manifest +++ b/dev-lang/pypy/Manifest @@ -1,10 +1,16 @@ DIST pypy2.7-gentoo-patches-7.3.23.tar.xz 5316 BLAKE2B 923494c49ef09b1929ba1986891a08f23e4343c44eac792a688ac88b48d21770101ca50fcdf3986c686adefb24fbf58aef674ec608feea775984ab8a16385cb6 SHA512 c1d07caef19b77cb4950d56c1de8079900fc21728061f8620210932d2cd85f701407ce7b9947d2ef044211d1ffe8b77ce445da3c5aef69321b45e7ab8550dee3 DIST pypy2.7-gentoo-patches-8.0.0.tar.xz 988 BLAKE2B 6bd236da38a45c50891758f6446fa70c81358141b8904062d2d1e27a7a938ee970c592108a081c8e9c83c869415b235e0202eae93ccf8d050866567976ed1fcd SHA512 a365d070448374777e7b2a7f5f7226e7ade89fd427c44b01f1cd8acaa215095de91a85321f9ca8283d04ed1d9aeaa5d191f5b2e33e44a831e38912d56a7a970e +DIST pypy2.7-gentoo-patches-8.0.1.tar.xz 2208 BLAKE2B 2251d777ac4b454fcbf8b179a2b14d172946986df5cb33de85fb0faec73756e93c7727f3f70e3f3b62b3219110ce34027ac38dfb31c216937e5f1c36e28d1b99 SHA512 d50c17ab3d3cb1207f2556229f592d66a0f6d6f7c61a8bdd2b7690303dd2fdc7ec5b9e7fbd0637ab93e6793b057b155d1b428d6663ee07ede78aa942159fbc42 DIST pypy2.7-v7.3.23-src.tar.bz2 21023543 BLAKE2B 7638e5aecd30d9c2c9ab22b1ab9a43331685885ee90ebfda8d2a88da34e4b0b998bd967eed30b309110b9d40b14df75f24a7e9219c7383b542602869ee1a12d9 SHA512 3750fc9c5309baa7627d00a77b4b2b1e0d755b75841acd0fcee484bc332f1e9ed9c1f33d2f4800777f20ea8849356f39c84167f96b9ebfdd7e479798d62eac06 DIST pypy2.7-v8.0.0-src.tar.gz 21312909 BLAKE2B 5ee9800c5399b1af82fde2f729fc63f6523e345b070176c4c13c9bd2cc0537baa6d04875042d4bd96ecec0c3bc5e8e79c08add1443b9c99ae40d396b91178ef7 SHA512 e0ae52034b5e03d413c47e1ddd9a7bde3549c70b4519c1630367c314ebce58638af78d5936c89943de1907477eb4bec8c149d850836991af14a50c9e643dfa63 +DIST pypy2.7-v8.0.1-src.tar.gz 21696939 BLAKE2B 48fd3769a7d7ebfd851b2b577aa99b7bdfd0023bdec4e1168d184a2df9f43f96d4dd3ed2e08931c2a9c2ac3054725e3db65a3e41ffac3df13018349d648c32b5 SHA512 18455b0509117e742ee29dfe3b8ae4fbde6fa5ed9f8271c7220995775a4f570134809b62a1ff25402d1275aae67b8ec3bfc5bd80a83e95f0058ca18d0eb6f994 DIST pypy3.11-gentoo-patches-7.3.23.tar.xz 3096 BLAKE2B d0852f8c9f715359487e07f5c80c4f3ac48da7eb650fd328535c40d8ec6318cf4c9f4b08838e976e2f88723472a42ccfcaf61d3a1b4af8319a44b476202b8c05 SHA512 81d6bb2e25a387bfe805263e7ecfb927a2292824e03b58ff4942b52bf4057d13ddf5d7944f8ee2e6c1553bde5650ac5d7af8689ab586a33ab5c58e4565da126a DIST pypy3.11-gentoo-patches-8.0.0.tar.xz 1392 BLAKE2B 1324f7a4f4950359b929835c1f0cfcb99022bf0098a0515a08ae24d811c2bdc5bd64e877d6c7e5b0b9dd33523c1b93f556bbec68c92fdad0670eb4e44a20c5b9 SHA512 c8e1a9eeb4ca44adb113477ce1bced9d3e3a7f693852dcc3b83b588b113fb1f1ca7a1c24151c31f321bdc763dd2fcdeea03031e3bb9d0d3f899ca083bc33df72 +DIST pypy3.11-gentoo-patches-8.0.1.tar.xz 2600 BLAKE2B e83fda134f8e77ed8f15067b6deba05d222661590484aec0578c5eaa29c342a58d74bca7a1a1c97b115ce9413dd91c9d305b8d53d653e4e77cf4b84ac5f4b050 SHA512 82b8bc380087432870eefb09b3369c4483c92855f4511e45fe166df54ff1e97905a5687000b9fcbaad6aac28714e2eef6ea43dead6a839472974d3852ac3dd48 DIST pypy3.11-v7.3.23-src.tar.bz2 25005650 BLAKE2B d0976c47fb04d1c96d7b4c1202ba43e586c8585f0c770c313c61407dc9c91245b6d4b07371d004646f43765f997f1deadcd938033bcc3429d848af63dbc75714 SHA512 4351cf30227af06ece5d69fe86a17355eadf2dcdbddf8119c04a720a4f9f388c6ae45a3496feb623950fb4a4a9f70c1910502adb325a12b1b0e34a7ba35563c2 DIST pypy3.11-v8.0.0-src.tar.gz 25897899 BLAKE2B 80e41af342fde7676990b1ea7aa689fcbbe5000d59cc41dc112597dba9f20a7ba5d1dd09feef130b78fa62f91fdf92c212ae9d796ecb3ea863983ff70b672398 SHA512 3e29f2bc76dc2db6d2409d580299c16e54927c1d7f06d697c0550d55a6fec2570e41f283d72730a19ad9166121a01cc5e380c33858a86b96356d4fd9d1780ade +DIST pypy3.11-v8.0.1-src.tar.gz 26304747 BLAKE2B 23aaa53b40f20a3dec88412bb7c8a6abd73d92e7a3cf08193691c5d9e1cc26fcb16feb8d1b937782654cc3d5d1e25e79240aae7c3166945baba8a8fb21e0be35 SHA512 63ee2790bef7b165615cada25ae444a293f7b99dafc135f9714c029b31a14c89f6d5fe6e09e11e7d720ad25cf6544528e98e1da8f375ec49ba45ca009fe3410a DIST pypy3.12-gentoo-patches-8.0.0.tar.xz 1876 BLAKE2B e9754805a5ddd980d299bb653f8fac58140a1f75c165c4309cd648d7fec63d3c6225673132bf641189dd501bab11263fa29723482bf7a13ca81700e090cca1bd SHA512 933eabf8a0e508e06c31514e9cae219877969ad0c41fd8d1307698714834efdcc7991341f71cab900b71b8fd6cf6af80e51f9b417b2081af52f6dab859eac1ba +DIST pypy3.12-gentoo-patches-8.0.1.tar.xz 2592 BLAKE2B 2aff55d9110ddbbc4ed47c3389f322eee0679478ee83cda1fca45edffac4659839a168437a01def0e58449e39611b115a41f186307b6f9b9d8dfb961781aaa4a SHA512 39708af70b9dc31289191d6984164f82609e4b755e8bf57606497264eb946447869984c893d989f26afa621c72a6f263e97fb91778e19deca9d9aec253f207b1 DIST pypy3.12-v8.0.0-src.tar.gz 25838522 BLAKE2B cfff5bf17a47ab308d27f935e82d13afdda43d817f7a0b3fd842f6ffaf8a75a35c3df4e3be62c6d520928878330328e93ea86d73d245ded28ce12c04286ae6ab SHA512 7eb576fdec8d46e5889dd265951ad49985c7d25ff1f998be83d8f34a011bd2369e00f1e48f93767bcb503b92849d549ce41c97338d65708da42b9833aefb8a2f +DIST pypy3.12-v8.0.1-src.tar.gz 26249138 BLAKE2B aa12063d61252339727168983a9fca69ded8df3494ef3f84766890918428ee5eaee2418078c0a44c262a3a6955179b1dc7e1ccb398b13658bfdf863f5239aa5a SHA512 bb60f8107079188b9214907c1bdd8d8aebb912cf4beb55f6c8cf80e16029d5e677f18a2f13d3fe3bd11676944e8dca7335a0f52ae1d47dec9b6b4312ac6c1604 diff --git a/dev-lang/pypy/pypy-2.7.8.0.0-r1.ebuild b/dev-lang/pypy/pypy-2.7.8.0.0-r1.ebuild new file mode 100644 index 000000000000..8ff14aa6694e --- /dev/null +++ b/dev-lang/pypy/pypy-2.7.8.0.0-r1.ebuild @@ -0,0 +1,316 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit 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="A fast, compliant alternative implementation of the Python (${PYVER}) language" +HOMEPAGE=" + https://pypy.org/ + https://github.com/pypy/pypy/ +" +SRC_URI=" + https://downloads.python.org/pypy/${MY_P}-src.tar.gz + https://distfiles.gentoo.org/pub/proj/python/patchsets/pypy${PYVER}/${PATCHSET}.tar.xz +" +S="${WORKDIR}/${MY_P}-src" + +LICENSE="MIT" +# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")' +SLOT="${PYVER}/pypy-80" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" +IUSE="bzip2 full-stdlib gdbm +jit ncurses sqlite tk" +RESTRICT="test" + +RDEPEND=" + || ( + >=dev-python/pypy-exe-bin-${PYPY_PV}:${PYPY_PV} + >=dev-python/pypy-exe-${PYPY_PV}:${PYPY_PV}[bzip2?,ncurses?] + ) + dev-libs/openssl:0= + gdbm? ( sys-libs/gdbm:0= ) + sqlite? ( dev-db/sqlite:3= ) + tk? ( + dev-lang/tk:0= + dev-tcltk/tix:0= + ) + !dev-python/pypy +" +DEPEND=" + ${RDEPEND} +" + +src_prepare() { + local PATCHES=( + "${WORKDIR}/${PATCHSET}" + ) + + default +} + +src_configure() { + tc-export CC +} + +src_compile() { + # copy over to make sys.prefix happy + cp -p "${BROOT}/usr/lib/pypy${PYVER}/pypy-c-${PYPY_PV}" pypy-c || die + cp -p "${BROOT}/usr/lib/pypy${PYVER}/include/${PYPY_PV}"/* include/ || die + # (not installed by pypy) + rm pypy/module/cpyext/include/_numpypy/numpy/README || die + mv pypy/module/cpyext/include/* include/ || die + mv pypy/module/cpyext/parse/*.h include/ || die + pax-mark m pypy-c + + # verify the subslot + local soabi=$( + ./pypy-c - <<-EOF + import sysconfig + print sysconfig.get_config_var("SOABI") + EOF + ) + [[ ${soabi} == ${SLOT#*/} ]] || die "update subslot to ${soabi}" + + einfo "Generating caches and CFFI modules ..." + + if use full-stdlib; then + # Generate Grammar and PatternGrammar pickles. + ./pypy-c - <<-EOF || die "Generation of Grammar and PatternGrammar pickles failed" + import lib2to3.pygram + import lib2to3.patcomp + lib2to3.patcomp.PatternCompiler() + EOF + + # Generate cffi modules + # Please keep in sync with pypy/tool/build_cffi_imports.py! + cffi_targets=( pypy_util ssl audioop syslog pwdgrp resource ) + use gdbm && cffi_targets+=( gdbm ) + use ncurses && cffi_targets+=( curses ) + use sqlite && cffi_targets+=( sqlite3 ) + use tk && cffi_targets+=( tkinter/tklib ) + + local t + # all modules except tkinter output to . + # tkinter outputs to the correct dir ... + cd lib_pypy || die + for t in "${cffi_targets[@]}"; do + # tkinter doesn't work via -m + ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}" + done + + # Verify that CFFI module list is up-to-date + local expected_cksum=-7df4eab0 + local local_cksum=$( + ../pypy-c - <<-EOF + import binascii + import json + from pypy_tools.build_cffi_imports import cffi_build_scripts as x + print("%08x" % (binascii.crc32(json.dumps(x)),)) + EOF + ) + if [[ ${local_cksum} != ${expected_cksum} ]]; then + die "Please verify cffi_targets and update checksum to ${local_cksum}" + fi + + # Cleanup temporary objects + find -name "_cffi_*.[co]" -delete || die + find -type d -empty -delete || die + fi +} + +src_test() { + # (unset) + local -x PYTHONDONTWRITEBYTECODE= + local -x COLUMNS=80 + + local ignored_tests=( + # network + --ignore=lib-python/${PYVER}/test/test_urllibnet.py + --ignore=lib-python/${PYVER}/test/test_urllib2net.py + # lots of free space + --ignore=lib-python/${PYVER}/test/test_zipfile64.py + + # broken by expat-2.4.5 + --ignore=lib-python/${PYVER}/test/test_minidom.py + --ignore=lib-python/${PYVER}/test/test_xml_etree.py + --ignore=lib-python/${PYVER}/test/test_xml_etree_c.py + ) + + ./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \ + "${ignored_tests[@]}" lib-python || die +} + +src_install() { + local dest="/usr/lib/pypy${PYVER}" + einfo "Installing PyPy ..." + dosym "pypy-c-${PYPY_PV}" "${dest}/pypy-c" + insinto "${dest}" + # preserve mtimes to avoid obsoleting caches + insopts -p + if use full-stdlib; then + doins -r include lib_pypy lib-python + + # replace copied headers with symlinks + for x in "${BROOT}/usr/lib/pypy${PYVER}/include/${PYPY_PV}"/*; do + dosym "${PYPY_PV}/${x##*/}" "${dest}/include/${x##*/}" + done + + if ! use gdbm; then + rm -r "${ED}${dest}"/lib_pypy/gdbm.py \ + "${ED}${dest}"/lib-python/*${PYVER}/test/test_gdbm.py || die + fi + if ! use sqlite; then + rm -r "${ED}${dest}"/lib-python/*${PYVER}/sqlite3 \ + "${ED}${dest}"/lib_pypy/_sqlite3.py \ + "${ED}${dest}"/lib-python/*${PYVER}/test/test_sqlite.py || die + fi + if ! use tk; then + rm -r "${ED}${dest}"/lib-python/*${PYVER}/{idlelib,lib-tk} \ + "${ED}${dest}"/lib_pypy/_tkinter \ + "${ED}${dest}"/lib-python/*${PYVER}/test/test_{tcl,tk,ttk*}.py || die + fi + else + # install only the absolutely minimal subset of modules needed + # for pypy3 build + local lib_py_modules=( + # base modules needed to even start pypy (and import site) + __future__.py + codecs.py + copy_reg.py + encodings + genericpath.py + linecache.py + os.py + pkgutil.py + posixpath.py + re.py + runpy.py + site.py + sre_compile.py + sre_constants.py + sre_parse.py + stat.py + string.py + sysconfig.py + traceback.py + warnings.py + UserDict.py + + # needed for python_optimize + compileall.py + getopt.py + py_compile.py + struct.py + + # needed for rpython + argparse.py + atexit.py + base64.py + bdb.py + bisect.py + cmd.py + code.py + codeop.py + collections.py + colorsys.py + contextlib.py + copy.py + ctypes + dis.py + fnmatch.py + functools.py + gettext.py + hashlib.py + heapq.py + inspect.py + io.py + json + keyword.py + locale.py + logging + new.py + opcode.py + optparse.py + pdb.py + pickle.py + platform.py + pprint.py + random.py + repr.py + shlex.py + shutil.py + StringIO.py + subprocess.py + tempfile.py + textwrap.py + threading.py + tokenize.py + uuid.py + weakref.py + zipfile.py + ) + + local distutils_modules=( + # needed by site + __init__.py + errors.py + sysconfig.py + sysconfig_cpython.py + sysconfig_pypy.py + ) + + local lib_pypy_modules=( + # needed by site + _sysconfigdata.py + + # needed by rpython + cffi + _ctypes + _ffi.py + _functools.py + _sha.py + _sha256.py + _sha512.py + + # NB: we're deliberately skipping _hashlib to avoid some deps + ) + + cd "lib-python/${PYVER}" || die + insinto "${dest}/lib-python/${PYVER}" + doins -r "${lib_py_modules[@]}" + cd - >/dev/null || die + + cd "lib-python/${PYVER}/distutils" || die + insinto "${dest}/lib-python/${PYVER}/distutils" + doins -r "${distutils_modules[@]}" + cd - >/dev/null || die + + cd lib_pypy || die + insinto "${dest}/lib_pypy" + doins -r "${lib_pypy_modules[@]}" + cd - >/dev/null || die + fi + + dosym "../lib/pypy${PYVER}/pypy-c" /usr/bin/pypy + dodoc README.rst + + local -x PYTHON="${ED}${dest}/pypy-c-${PYPY_PV}" + # temporarily copy to build tree to facilitate module builds + cp -p "${BROOT}${dest}/pypy-c-${PYPY_PV}" "${PYTHON}" || die + + einfo "Byte-compiling Python standard library..." + "${PYTHON}" -m compileall \ + -x 'bad_coding|badsyntax|make_ssl_data|lib2to3/tests/data' \ + -q -f -d "${dest}" "${ED}/${dest}" || die + + # remove to avoid collisions + rm "${PYTHON}" || die +} diff --git a/dev-lang/pypy/pypy-2.7.8.0.1.ebuild b/dev-lang/pypy/pypy-2.7.8.0.1.ebuild new file mode 100644 index 000000000000..8ff14aa6694e --- /dev/null +++ b/dev-lang/pypy/pypy-2.7.8.0.1.ebuild @@ -0,0 +1,316 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit 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="A fast, compliant alternative implementation of the Python (${PYVER}) language" +HOMEPAGE=" + https://pypy.org/ + https://github.com/pypy/pypy/ +" +SRC_URI=" + https://downloads.python.org/pypy/${MY_P}-src.tar.gz + https://distfiles.gentoo.org/pub/proj/python/patchsets/pypy${PYVER}/${PATCHSET}.tar.xz +" +S="${WORKDIR}/${MY_P}-src" + +LICENSE="MIT" +# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")' +SLOT="${PYVER}/pypy-80" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" +IUSE="bzip2 full-stdlib gdbm +jit ncurses sqlite tk" +RESTRICT="test" + +RDEPEND=" + || ( + >=dev-python/pypy-exe-bin-${PYPY_PV}:${PYPY_PV} + >=dev-python/pypy-exe-${PYPY_PV}:${PYPY_PV}[bzip2?,ncurses?] + ) + dev-libs/openssl:0= + gdbm? ( sys-libs/gdbm:0= ) + sqlite? ( dev-db/sqlite:3= ) + tk? ( + dev-lang/tk:0= + dev-tcltk/tix:0= + ) + !dev-python/pypy +" +DEPEND=" + ${RDEPEND} +" + +src_prepare() { + local PATCHES=( + "${WORKDIR}/${PATCHSET}" + ) + + default +} + +src_configure() { + tc-export CC +} + +src_compile() { + # copy over to make sys.prefix happy + cp -p "${BROOT}/usr/lib/pypy${PYVER}/pypy-c-${PYPY_PV}" pypy-c || die + cp -p "${BROOT}/usr/lib/pypy${PYVER}/include/${PYPY_PV}"/* include/ || die + # (not installed by pypy) + rm pypy/module/cpyext/include/_numpypy/numpy/README || die + mv pypy/module/cpyext/include/* include/ || die + mv pypy/module/cpyext/parse/*.h include/ || die + pax-mark m pypy-c + + # verify the subslot + local soabi=$( + ./pypy-c - <<-EOF + import sysconfig + print sysconfig.get_config_var("SOABI") + EOF + ) + [[ ${soabi} == ${SLOT#*/} ]] || die "update subslot to ${soabi}" + + einfo "Generating caches and CFFI modules ..." + + if use full-stdlib; then + # Generate Grammar and PatternGrammar pickles. + ./pypy-c - <<-EOF || die "Generation of Grammar and PatternGrammar pickles failed" + import lib2to3.pygram + import lib2to3.patcomp + lib2to3.patcomp.PatternCompiler() + EOF + + # Generate cffi modules + # Please keep in sync with pypy/tool/build_cffi_imports.py! + cffi_targets=( pypy_util ssl audioop syslog pwdgrp resource ) + use gdbm && cffi_targets+=( gdbm ) + use ncurses && cffi_targets+=( curses ) + use sqlite && cffi_targets+=( sqlite3 ) + use tk && cffi_targets+=( tkinter/tklib ) + + local t + # all modules except tkinter output to . + # tkinter outputs to the correct dir ... + cd lib_pypy || die + for t in "${cffi_targets[@]}"; do + # tkinter doesn't work via -m + ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}" + done + + # Verify that CFFI module list is up-to-date + local expected_cksum=-7df4eab0 + local local_cksum=$( + ../pypy-c - <<-EOF + import binascii + import json + from pypy_tools.build_cffi_imports import cffi_build_scripts as x + print("%08x" % (binascii.crc32(json.dumps(x)),)) + EOF + ) + if [[ ${local_cksum} != ${expected_cksum} ]]; then + die "Please verify cffi_targets and update checksum to ${local_cksum}" + fi + + # Cleanup temporary objects + find -name "_cffi_*.[co]" -delete || die + find -type d -empty -delete || die + fi +} + +src_test() { + # (unset) + local -x PYTHONDONTWRITEBYTECODE= + local -x COLUMNS=80 + + local ignored_tests=( + # network + --ignore=lib-python/${PYVER}/test/test_urllibnet.py + --ignore=lib-python/${PYVER}/test/test_urllib2net.py + # lots of free space + --ignore=lib-python/${PYVER}/test/test_zipfile64.py + + # broken by expat-2.4.5 + --ignore=lib-python/${PYVER}/test/test_minidom.py + --ignore=lib-python/${PYVER}/test/test_xml_etree.py + --ignore=lib-python/${PYVER}/test/test_xml_etree_c.py + ) + + ./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \ + "${ignored_tests[@]}" lib-python || die +} + +src_install() { + local dest="/usr/lib/pypy${PYVER}" + einfo "Installing PyPy ..." + dosym "pypy-c-${PYPY_PV}" "${dest}/pypy-c" + insinto "${dest}" + # preserve mtimes to avoid obsoleting caches + insopts -p + if use full-stdlib; then + doins -r include lib_pypy lib-python + + # replace copied headers with symlinks + for x in "${BROOT}/usr/lib/pypy${PYVER}/include/${PYPY_PV}"/*; do + dosym "${PYPY_PV}/${x##*/}" "${dest}/include/${x##*/}" + done + + if ! use gdbm; then + rm -r "${ED}${dest}"/lib_pypy/gdbm.py \ + "${ED}${dest}"/lib-python/*${PYVER}/test/test_gdbm.py || die + fi + if ! use sqlite; then + rm -r "${ED}${dest}"/lib-python/*${PYVER}/sqlite3 \ + "${ED}${dest}"/lib_pypy/_sqlite3.py \ + "${ED}${dest}"/lib-python/*${PYVER}/test/test_sqlite.py || die + fi + if ! use tk; then + rm -r "${ED}${dest}"/lib-python/*${PYVER}/{idlelib,lib-tk} \ + "${ED}${dest}"/lib_pypy/_tkinter \ + "${ED}${dest}"/lib-python/*${PYVER}/test/test_{tcl,tk,ttk*}.py || die + fi + else + # install only the absolutely minimal subset of modules needed + # for pypy3 build + local lib_py_modules=( + # base modules needed to even start pypy (and import site) + __future__.py + codecs.py + copy_reg.py + encodings + genericpath.py + linecache.py + os.py + pkgutil.py + posixpath.py + re.py + runpy.py + site.py + sre_compile.py + sre_constants.py + sre_parse.py + stat.py + string.py + sysconfig.py + traceback.py + warnings.py + UserDict.py + + # needed for python_optimize + compileall.py + getopt.py + py_compile.py + struct.py + + # needed for rpython + argparse.py + atexit.py + base64.py + bdb.py + bisect.py + cmd.py + code.py + codeop.py + collections.py + colorsys.py + contextlib.py + copy.py + ctypes + dis.py + fnmatch.py + functools.py + gettext.py + hashlib.py + heapq.py + inspect.py + io.py + json + keyword.py + locale.py + logging + new.py + opcode.py + optparse.py + pdb.py + pickle.py + platform.py + pprint.py + random.py + repr.py + shlex.py + shutil.py + StringIO.py + subprocess.py + tempfile.py + textwrap.py + threading.py + tokenize.py + uuid.py + weakref.py + zipfile.py + ) + + local distutils_modules=( + # needed by site + __init__.py + errors.py + sysconfig.py + sysconfig_cpython.py + sysconfig_pypy.py + ) + + local lib_pypy_modules=( + # needed by site + _sysconfigdata.py + + # needed by rpython + cffi + _ctypes + _ffi.py + _functools.py + _sha.py + _sha256.py + _sha512.py + + # NB: we're deliberately skipping _hashlib to avoid some deps + ) + + cd "lib-python/${PYVER}" || die + insinto "${dest}/lib-python/${PYVER}" + doins -r "${lib_py_modules[@]}" + cd - >/dev/null || die + + cd "lib-python/${PYVER}/distutils" || die + insinto "${dest}/lib-python/${PYVER}/distutils" + doins -r "${distutils_modules[@]}" + cd - >/dev/null || die + + cd lib_pypy || die + insinto "${dest}/lib_pypy" + doins -r "${lib_pypy_modules[@]}" + cd - >/dev/null || die + fi + + dosym "../lib/pypy${PYVER}/pypy-c" /usr/bin/pypy + dodoc README.rst + + local -x PYTHON="${ED}${dest}/pypy-c-${PYPY_PV}" + # temporarily copy to build tree to facilitate module builds + cp -p "${BROOT}${dest}/pypy-c-${PYPY_PV}" "${PYTHON}" || die + + einfo "Byte-compiling Python standard library..." + "${PYTHON}" -m compileall \ + -x 'bad_coding|badsyntax|make_ssl_data|lib2to3/tests/data' \ + -q -f -d "${dest}" "${ED}/${dest}" || die + + # remove to avoid collisions + rm "${PYTHON}" || die +} diff --git a/dev-lang/pypy/pypy-3.11.8.0.1.ebuild b/dev-lang/pypy/pypy-3.11.8.0.1.ebuild new file mode 100644 index 000000000000..2bca80190456 --- /dev/null +++ b/dev-lang/pypy/pypy-3.11.8.0.1.ebuild @@ -0,0 +1,236 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit multiprocessing pax-utils python-utils-r1 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="A fast, compliant alternative implementation of the Python (${PYVER}) language" +HOMEPAGE=" + https://pypy.org/ + https://github.com/pypy/pypy/ +" +SRC_URI=" + https://downloads.python.org/pypy/${MY_P}-src.tar.gz + https://distfiles.gentoo.org/pub/proj/python/patchsets/pypy${PYVER}/${PATCHSET}.tar.xz +" +S="${WORKDIR}/${MY_P}-src" + +LICENSE="MIT" +# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))' +# also check pypy/interpreter/pycode.py -> pypy_incremental_magic +SLOT="${PYVER}/pypy311-pp80-432" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" +IUSE="+ensurepip gdbm +jit ncurses sqlite symlink +test-install tk" +# many tests are failing upstream +# see https://buildbot.pypy.org/summary?branch=py${PYVER} +RESTRICT="test" + +RDEPEND=" + || ( + dev-lang/pypy3-exe:${PV%_p*}[bzip2(+),ncurses?] + dev-lang/pypy3-exe-bin:${PV%_p*} + ) + dev-libs/openssl:0= + dev-python/gentoo-common + gdbm? ( sys-libs/gdbm:0= ) + sqlite? ( dev-db/sqlite:3= ) + tk? ( + dev-lang/tk:0= + dev-tcltk/tix:0= + ) + symlink? ( + !dev-lang/pypy:3.10[symlink(-)] + ! lib-python/3/epython.py || die + + einfo "Generating caches and CFFI modules ..." + + # Generate Grammar and PatternGrammar pickles. + "./pypy${PYVER}-c" - <<-EOF || die "Generation of Grammar and PatternGrammar pickles failed" + import lib2to3.pygram + import lib2to3.patcomp + lib2to3.patcomp.PatternCompiler() + EOF + + # Generate cffi modules + # Please keep in sync with lib_pypy/pypy_tools/build_cffi_imports.py! + # (NB: we build CFFI modules first to avoid error log when importing + # build_cffi_imports). + cffi_targets=( + pypy_util blake2/_blake2 sha3/_sha3 ssl + audioop syslog pwdgrp resource lzma posixshmem + ctypes_test testmultiphase + ) + use gdbm && cffi_targets+=( gdbm ) + use ncurses && cffi_targets+=( curses ) + use sqlite && cffi_targets+=( sqlite3 ) + use tk && cffi_targets+=( tkinter/tklib ) + + local t + # all modules except tkinter output to . + # tkinter outputs to the correct dir ... + cd lib_pypy || die + for t in "${cffi_targets[@]}"; do + # tkinter doesn't work via -m + "../pypy${PYVER}-c" "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}" + done + # testcapi does not have a "build" script + "../pypy${PYVER}-c" -c "import _testcapi" || die + + # Verify that CFFI module list is up-to-date + local expected_cksum=46dc6ae7 + local local_cksum=$( + "../pypy${PYVER}-c" - <<-EOF + import binascii + import json + from pypy_tools.build_cffi_imports import cffi_build_scripts as x + print("%08x" % (binascii.crc32(json.dumps(x).encode()),)) + EOF + ) + if [[ ${local_cksum} != ${expected_cksum} ]]; then + die "Please verify cffi_targets and update checksum to ${local_cksum}" + fi + + # Cleanup temporary objects + find \( -name "*_cffi.c" -o -name '*.o' \) -delete || die + find -type d -empty -delete || die + cd .. || die + + # Generate sysconfig data + local host_gnu_type=$(sh pypy/tool/release/config.guess) + local overrides=( + HOST_GNU_TYPE "${host_gnu_type:-unknown}" + INCLUDEPY "${EPREFIX}/usr/include/pypy${PYVER}" + LIBDIR "${EPREFIX}/usr/$(get_libdir)" + TZPATH "${EPREFIX}/usr/share/zoneinfo" + WHEEL_PKG_DIR "${EPREFIX}/usr/lib/python/ensurepip" + ) + "./pypy${PYVER}-c" -m sysconfig --generate-posix-vars "${overrides[@]}" || die + local outdir + outdir=$( pypy_incremental_magic +SLOT="${PYVER}/pypy312-pp80-448" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" +IUSE="+ensurepip gdbm +jit ncurses sqlite symlink +test-install tk" +# many tests are failing upstream +# see https://buildbot.pypy.org/summary?branch=py${PYVER} +RESTRICT="test" + +RDEPEND=" + || ( + dev-lang/pypy3-exe:${PV%_p*}[bzip2(+),ncurses?] + dev-lang/pypy3-exe-bin:${PV%_p*} + ) + dev-libs/openssl:0= + dev-python/gentoo-common + gdbm? ( sys-libs/gdbm:0= ) + sqlite? ( dev-db/sqlite:3= ) + tk? ( + dev-lang/tk:0= + dev-tcltk/tix:0= + ) + symlink? ( + !dev-lang/pypy:3.10[symlink(-)] + ! lib-python/3/epython.py || die + + einfo "Generating caches and CFFI modules ..." + + # Generate Grammar and PatternGrammar pickles. + "./pypy${PYVER}-c" - <<-EOF || die "Generation of Grammar and PatternGrammar pickles failed" + import lib2to3.pygram + import lib2to3.patcomp + lib2to3.patcomp.PatternCompiler() + EOF + + # Generate cffi modules + # Please keep in sync with lib_pypy/pypy_tools/build_cffi_imports.py! + # (NB: we build CFFI modules first to avoid error log when importing + # build_cffi_imports). + cffi_targets=( + pypy_util blake2/_blake2 sha3/_sha3 ssl + audioop syslog pwdgrp resource lzma posixshmem + ctypes_test testmultiphase testsinglephase + ) + use gdbm && cffi_targets+=( gdbm ) + use ncurses && cffi_targets+=( curses ) + use sqlite && cffi_targets+=( sqlite3 ) + use tk && cffi_targets+=( tkinter/tklib ) + + local t + # all modules except tkinter output to . + # tkinter outputs to the correct dir ... + cd lib_pypy || die + for t in "${cffi_targets[@]}"; do + # tkinter doesn't work via -m + "../pypy${PYVER}-c" "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}" + done + # testcapi does not have a "build" script + "../pypy${PYVER}-c" -c "import _testcapi" || die + + # Verify that CFFI module list is up-to-date + local expected_cksum=46dc6ae7 + local local_cksum=$( + "../pypy${PYVER}-c" - <<-EOF + import binascii + import json + from pypy_tools.build_cffi_imports import cffi_build_scripts as x + print("%08x" % (binascii.crc32(json.dumps(x).encode()),)) + EOF + ) + if [[ ${local_cksum} != ${expected_cksum} ]]; then + die "Please verify cffi_targets and update checksum to ${local_cksum}" + fi + + # Cleanup temporary objects + find \( -name "*_cffi.c" -o -name '*.o' \) -delete || die + find -type d -empty -delete || die + cd .. || die + + # Generate sysconfig data + local host_gnu_type=$(sh pypy/tool/release/config.guess) + local overrides=( + HOST_GNU_TYPE "${host_gnu_type:-unknown}" + INCLUDEPY "${EPREFIX}/usr/include/pypy${PYVER}" + LIBDIR "${EPREFIX}/usr/$(get_libdir)" + TZPATH "${EPREFIX}/usr/share/zoneinfo" + WHEEL_PKG_DIR "${EPREFIX}/usr/lib/python/ensurepip" + ) + "./pypy${PYVER}-c" -m sysconfig --generate-posix-vars "${overrides[@]}" || die + local outdir + outdir=$(