mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-22 10:57:07 -08:00
dev-lang/pypy: Bump to 3.12.8.0.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -6,3 +6,5 @@ DIST pypy3.11-gentoo-patches-7.3.23.tar.xz 3096 BLAKE2B d0852f8c9f715359487e07f5
|
||||
DIST pypy3.11-gentoo-patches-8.0.0.tar.xz 1392 BLAKE2B 1324f7a4f4950359b929835c1f0cfcb99022bf0098a0515a08ae24d811c2bdc5bd64e877d6c7e5b0b9dd33523c1b93f556bbec68c92fdad0670eb4e44a20c5b9 SHA512 c8e1a9eeb4ca44adb113477ce1bced9d3e3a7f693852dcc3b83b588b113fb1f1ca7a1c24151c31f321bdc763dd2fcdeea03031e3bb9d0d3f899ca083bc33df72
|
||||
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.12-gentoo-patches-8.0.0.tar.xz 1876 BLAKE2B e9754805a5ddd980d299bb653f8fac58140a1f75c165c4309cd648d7fec63d3c6225673132bf641189dd501bab11263fa29723482bf7a13ca81700e090cca1bd SHA512 933eabf8a0e508e06c31514e9cae219877969ad0c41fd8d1307698714834efdcc7991341f71cab900b71b8fd6cf6af80e51f9b417b2081af52f6dab859eac1ba
|
||||
DIST pypy3.12-v8.0.0-src.tar.gz 25838522 BLAKE2B cfff5bf17a47ab308d27f935e82d13afdda43d817f7a0b3fd842f6ffaf8a75a35c3df4e3be62c6d520928878330328e93ea86d73d245ded28ce12c04286ae6ab SHA512 7eb576fdec8d46e5889dd265951ad49985c7d25ff1f998be83d8f34a011bd2369e00f1e48f93767bcb503b92849d549ce41c97338d65708da42b9833aefb8a2f
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
# 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}/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(-)]
|
||||
!<dev-python/pypy3-7.3.17-r100
|
||||
)
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
"
|
||||
|
||||
PDEPEND="
|
||||
ensurepip? (
|
||||
dev-python/ensurepip-pip
|
||||
dev-python/ensurepip-setuptools
|
||||
)
|
||||
"
|
||||
|
||||
src_prepare() {
|
||||
local PATCHES=(
|
||||
"${WORKDIR}/${PATCHSET}"
|
||||
)
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
tc-export CC
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
mkdir bin || die
|
||||
# switch to the layout expected for cffi module builds
|
||||
mkdir "include/pypy${PYVER}" || die
|
||||
# copy over to make sys.prefix happy
|
||||
cp -p "${BROOT}/usr/bin/pypy${PYVER}-c-${PYPY_PV}" pypy${PYVER}-c || die
|
||||
cp -p "${BROOT}/usr/include/pypy${PYVER}/${PYPY_PV}"/* include/pypy${PYVER}/ || die
|
||||
# (not installed by pypy-exe)
|
||||
rm pypy/module/cpyext/include/_numpypy/numpy/README || die
|
||||
mv pypy/module/cpyext/include/* "include/pypy${PYVER}/" || die
|
||||
mv pypy/module/cpyext/parse/*.h "include/pypy${PYVER}/" || die
|
||||
pax-mark m "pypy${PYVER}-c"
|
||||
|
||||
# verify the subslot
|
||||
local soabi=$(
|
||||
"./pypy${PYVER}-c" - <<-EOF
|
||||
import importlib.util
|
||||
import sysconfig
|
||||
soabi = sysconfig.get_config_var("SOABI")
|
||||
wo_plat = "-".join(soabi.split("-", 2)[:2])
|
||||
magic = importlib.util._RAW_MAGIC_NUMBER & 0xffff
|
||||
print(f"{wo_plat}-{magic}")
|
||||
EOF
|
||||
)
|
||||
[[ ${soabi} == ${SLOT#*/} ]] || die "update subslot to ${soabi}"
|
||||
|
||||
# Add epython.py to the distribution
|
||||
echo "EPYTHON=\"pypy${PYVER}\"" > 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=$(<pybuilddir.txt) || die
|
||||
cp "${outdir}"/_sysconfigdata__*.py lib-python/3/ || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local dest="/usr/lib/pypy${PYVER}"
|
||||
einfo "Installing PyPy ..."
|
||||
dodir /usr/bin
|
||||
dosym "pypy${PYVER}-c-${PYPY_PV}" "/usr/bin/pypy${PYVER}"
|
||||
insinto "${dest}"
|
||||
# preserve mtimes to avoid obsoleting caches
|
||||
insopts -p
|
||||
doins -r lib-python/3/. lib_pypy/.
|
||||
insinto /usr/include
|
||||
doins -r "include/pypy${PYVER}"
|
||||
|
||||
# replace copied headers with symlinks
|
||||
for x in "${BROOT}/usr/include/pypy${PYVER}/${PYPY_PV}"/*; do
|
||||
dosym "${PYPY_PV}/${x##*/}" "/usr/include/pypy${PYVER}/${x##*/}"
|
||||
done
|
||||
|
||||
dodoc README.rst
|
||||
|
||||
rm -r "${ED}${dest}"/ensurepip/_bundled || die
|
||||
if ! use ensurepip; then
|
||||
rm -r "${ED}${dest}"/ensurepip || die
|
||||
fi
|
||||
if ! use gdbm; then
|
||||
rm -r "${ED}${dest}"/_gdbm* || die
|
||||
fi
|
||||
if ! use test-install; then
|
||||
rm -r "${ED}${dest}"/{ctypes,tkinter,unittest}/test \
|
||||
"${ED}${dest}"/{distutils,lib2to3}/tests \
|
||||
"${ED}${dest}"/idlelib/idle_test || die
|
||||
fi
|
||||
if ! use sqlite; then
|
||||
rm -r "${ED}${dest}"/sqlite3 \
|
||||
"${ED}${dest}"/_sqlite3* \
|
||||
"${ED}${dest}"/test/test_sqlite3 || die
|
||||
fi
|
||||
if ! use tk; then
|
||||
rm -r "${ED}${dest}"/{idlelib,tkinter} \
|
||||
"${ED}${dest}"/_tkinter \
|
||||
"${ED}${dest}"/test/test_{tcl,tk,ttk*}.py || die
|
||||
fi
|
||||
# remove test last since we have some file removals above
|
||||
if ! use test-install; then
|
||||
rm -r "${ED}${dest}"/test || die
|
||||
fi
|
||||
dosym ../python/EXTERNALLY-MANAGED "${dest}/EXTERNALLY-MANAGED"
|
||||
|
||||
local -x PYTHON="${ED}/usr/bin/pypy${PYVER}-c-${PYPY_PV}"
|
||||
# temporarily copy to build tree to facilitate module builds
|
||||
cp -p "${BROOT}/usr/bin/pypy${PYVER}-c-${PYPY_PV}" "${PYTHON}" || die
|
||||
|
||||
einfo "Byte-compiling Python standard library..."
|
||||
# exclude list from CPython Makefile.pre.in
|
||||
"${PYTHON}" -m compileall -j "$(makeopts_jobs)" -o 0 -o 1 -o 2 \
|
||||
-x 'bad_coding|badsyntax|site-packages|test/test_lib2to3/data' \
|
||||
--hardlink-dupes -q -f -d "${dest}" "${ED}${dest}" || die
|
||||
|
||||
# remove to avoid collisions
|
||||
rm "${PYTHON}" || die
|
||||
|
||||
if use symlink; then
|
||||
dosym pypy${PYVER} /usr/bin/pypy3
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user