mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-lang/pypy: Remove old
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -1,10 +1,4 @@
|
||||
DIST pypy2.7-gentoo-patches-7.3.19.tar.xz 5328 BLAKE2B c997c0e7f39a4a6a9ec34811b38fc8f9b90ccae8c958ca420074013d63a4f1b453b6331be79a2df299efe177cc99d91038ae56156d37b5f9b9f8715ccd2cb75d SHA512 7bac5331fa868c60b376e405df212a29d406f117035fbc1ad8bd6d81212ab2ea4ce5b6b40e8dbbb6303fe941152e37aae17608a2eca9efd16767c8844f6f5fdb
|
||||
DIST pypy2.7-gentoo-patches-7.3.20.tar.xz 5324 BLAKE2B d2ac71ae4360292d1f4661e10ec817bebdaceb00c6deb92eb8ffaf023d7f0e511c10f10aac6c60d436f9b0f34185e989a87780c99913d011a679df8cdb6f255d SHA512 69839ed3c5cba8983661da8719b06a3054b94fc1a3eca9ccf3546c523745811cd91963afb39ea9551fe98e8f71fab6c9344ccbb0378c2b51f0dca8aef7f04ac4
|
||||
DIST pypy2.7-v7.3.19-src.tar.bz2 21011665 BLAKE2B b8e205927c829753dd3e5aba0868923efff73f62e5338d6200aab2470857fff9cf38763ab8b63a74a39299d4956d4794eedf5d474d083875bbb9cee9ea757e64 SHA512 8ab8d9c0fa94ec96ebfae30b7f97eb8dff6ad4ee17fa688df123927c45f3ffea2c7f5dbb98bd2f8a49f7db6baf0ba3e98fd230df0bdc8602e407fb2bc33144e3
|
||||
DIST pypy2.7-v7.3.20-src.tar.bz2 21016441 BLAKE2B 382830a4e2511b77861a96a52038f0f6ca69fd3a938cdc0434285dac217bbeacacb71a5566edad0240e7e7723924ee449b2237b3a84008e80922b19df8880638 SHA512 f23a065efc7f4ab4020de554ff1411b21d05364e19dd49f7026a9a1f90761342bdf5606f1522094991c189df449387ebf0f79240902b6836235cb3a4e89d6d3a
|
||||
DIST pypy3.10-gentoo-patches-7.3.19_p5.tar.xz 26284 BLAKE2B 726121c69c24ef8d5c812842cc5b76d517cb6495530ea82f5379f6ed376f9e9afd613dff90af03cb72a01aa590e7ab7c3ed0de3f9fa45988b17ed49e0a34b12f SHA512 646fe0610b2ec32ea895c968b388febc8634f7ff92b772dcd7732ef1bf7e7ffad23c2df47a695298284122780fb8f0ea4160901b3be16211428080e67af25a09
|
||||
DIST pypy3.10-v7.3.19-src.tar.bz2 24547353 BLAKE2B 975de34c7e01117c74e184693b6659ba0e3d8d488d724c03737dbd64533452c954e045e45058e1e77b9bee68e01060e74e30d7898d29f1adce417ce4b46579b8 SHA512 8fa24d3556bcf9cd0e2facd697827a5001fcfae9bf7874957843e4751b259f85a8b36166921282d71f39bb468d1706bb669373aebbc52486b683fcc824fb30ad
|
||||
DIST pypy3.11-gentoo-patches-7.3.19_p11.tar.xz 29804 BLAKE2B 23a6a82f0ab21540d24bf23771161616f2e10022ecb3d6948ca837705410e930c1ea9b83f233145a55fe2091149dbc4d5d63a8970e5f9e32d1486f28f41f533a SHA512 cde1fb6df55f5c24ec41e7a02204fa5e520f14f52cf1224557b22b1fe6448e7eca22568424ed23da9bffb81c1dae85cefc1aecdf2c8c33b4c38c32342ff03666
|
||||
DIST pypy3.11-gentoo-patches-7.3.20_p1.tar.xz 3552 BLAKE2B 539117cb61e7ab44a957b87099fa1d2eacc995b7dcd1a3a683f84a28e12bf257e7769cad1f7499b30764fb97c9467c148f8f35df0edd627c56704d7a96218607 SHA512 894a8b3a36a26b5aaa8958d7428c5476cc04102db40e83bc0e161a94e952a3f207f4ebbf51af3a2c0113956b9eae46f932d7c7d2a98129c705f974e7a5eb19ce
|
||||
DIST pypy3.11-v7.3.19-src.tar.bz2 24916380 BLAKE2B febc61b3a1c5055b5ab92e7f3af2c307605c8510131437b12df27b58a13b29f6fd0a4bf82d101f7f8f441ca93b20cf70dbd540af11578be297ea871d59304ea3 SHA512 ab078e81e5eefe16823350bdc9adcc444e0ef6835ff2234197f9e5cb0903c5208deb6df60722e99aa529ffff703c5dcbc08eaa7f753c2e5c1185afea6358395a
|
||||
DIST pypy3.11-v7.3.20-src.tar.bz2 24907202 BLAKE2B eef877362365908b665cbd0ea266daebe5fa7a3f224ac0d133664244b712214e2ae93ab655e2f82257beef125c3cef301e50810c97ba4c035efa4930902aed32 SHA512 b957adeca5d5bd33cf1e9769459282488fdd9b1ec9398d20b35681ca88492bc01bdee91bb2c212e75fb946555f9be9869b7944b20207aef5a63c7035702b8cfa
|
||||
|
||||
@@ -1,315 +0,0 @@
|
||||
# Copyright 1999-2025 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.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"
|
||||
# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
|
||||
SLOT="${PYVER}/73"
|
||||
KEYWORDS="amd64 ~arm64 ~ppc64 x86 ~amd64-linux ~x86-linux"
|
||||
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#pypy-} == ${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)
|
||||
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
|
||||
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
|
||||
}
|
||||
@@ -1,227 +0,0 @@
|
||||
# Copyright 1999-2025 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.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"
|
||||
# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
|
||||
# also check pypy/interpreter/pycode.py -> pypy_incremental_magic
|
||||
SLOT="${PYVER}/pypy310-pp73-384"
|
||||
KEYWORDS="amd64 ~arm64 ~ppc64 x86 ~amd64-linux ~x86-linux"
|
||||
IUSE="+ensurepip gdbm +jit ncurses sqlite +test-install tk"
|
||||
# many tests are failing upstream
|
||||
# see https://buildbot.pypy.org/summary?branch=py${PYVER}
|
||||
RESTRICT="test"
|
||||
|
||||
RDEPEND="
|
||||
|| (
|
||||
>=dev-python/pypy3_10-exe-${PYPY_PV}:${PYPY_PV}[bzip2(+),ncurses?]
|
||||
>=dev-python/pypy3_10-exe-bin-${PYPY_PV}:${PYPY_PV}
|
||||
)
|
||||
dev-libs/openssl:0=
|
||||
dev-python/gentoo-common
|
||||
ensurepip? (
|
||||
dev-python/ensurepip-pip
|
||||
dev-python/ensurepip-setuptools
|
||||
)
|
||||
gdbm? ( sys-libs/gdbm:0= )
|
||||
sqlite? ( dev-db/sqlite:3= )
|
||||
tk? (
|
||||
dev-lang/tk:0=
|
||||
dev-tcltk/tix:0=
|
||||
)
|
||||
!dev-python/pypy3_10
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
"
|
||||
|
||||
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")
|
||||
magic = importlib.util._RAW_MAGIC_NUMBER & 0xffff
|
||||
print(f"{soabi}-{magic}")
|
||||
EOF
|
||||
)
|
||||
[[ ${soabi} == ${SLOT#*/} ]] || die "update subslot to ${soabi}"
|
||||
|
||||
# Add epython.py to the distribution
|
||||
echo 'EPYTHON="pypy3"' > 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=a4138e48
|
||||
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,sqlite3,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_sqlite.py || 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|lib2to3/tests/data' \
|
||||
--hardlink-dupes -q -f -d "${dest}" "${ED}${dest}" || die
|
||||
|
||||
# remove to avoid collisions
|
||||
rm "${PYTHON}" || die
|
||||
}
|
||||
@@ -1,242 +0,0 @@
|
||||
# Copyright 1999-2025 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.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"
|
||||
# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
|
||||
# also check pypy/interpreter/pycode.py -> pypy_incremental_magic
|
||||
SLOT="${PYVER}/pypy311-pp73-416"
|
||||
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-lang/python-exec[python_targets_pypy${PYVER/./_}(-)]
|
||||
dev-libs/openssl:0=
|
||||
dev-python/gentoo-common
|
||||
ensurepip? (
|
||||
dev-python/ensurepip-pip
|
||||
dev-python/ensurepip-setuptools
|
||||
)
|
||||
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}
|
||||
"
|
||||
|
||||
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")
|
||||
magic = importlib.util._RAW_MAGIC_NUMBER & 0xffff
|
||||
print(f"{soabi}-{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
|
||||
)
|
||||
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=a4138e48
|
||||
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|lib2to3/tests/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
|
||||
|
||||
# install symlinks for python-exec
|
||||
local EPYTHON=pypy${PYVER}
|
||||
local scriptdir=${D}$(python_get_scriptdir)
|
||||
mkdir -p "${scriptdir}" || die
|
||||
ln -s "../../../bin/pypy3" "${scriptdir}/python3" || die
|
||||
ln -s python3 "${scriptdir}/python" || die
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user