eclass/distutils-r1: Sync with Gentoo

It's from Gentoo commit 8cc7354d298d9906237e696831ddbcbcc898fc5e.
This commit is contained in:
Flatcar Buildbot 2023-08-07 07:11:33 +00:00 committed by Krzesimir Nowak
parent fae45d64b3
commit dfb5b24d68

View File

@ -191,6 +191,7 @@ esac
if [[ -z ${_DISTUTILS_R1_ECLASS} ]]; then
_DISTUTILS_R1_ECLASS=1
inherit flag-o-matic
inherit multibuild multilib multiprocessing ninja-utils toolchain-funcs
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
@ -271,8 +272,7 @@ _distutils_set_globals() {
;;
setuptools)
bdep+='
>=dev-python/setuptools-67.7.2[${PYTHON_USEDEP}]
>=dev-python/wheel-0.40.0[${PYTHON_USEDEP}]
>=dev-python/setuptools-67.8.0-r1[${PYTHON_USEDEP}]
'
;;
sip)
@ -292,7 +292,7 @@ _distutils_set_globals() {
eqawarn "is enabled."
fi
else
local setuptools_dep='>=dev-python/setuptools-67.7.2[${PYTHON_USEDEP}]'
local setuptools_dep='>=dev-python/setuptools-67.8.0-r1[${PYTHON_USEDEP}]'
case ${DISTUTILS_USE_SETUPTOOLS:-bdepend} in
no|manual)
@ -1718,7 +1718,7 @@ distutils-r1_python_install() {
# python likes to compile any module it sees, which triggers sandbox
# failures if some packages haven't compiled their modules yet.
addpredict "${EPREFIX}/usr/lib/${EPYTHON}"
addpredict "${EPREFIX}/usr/lib/pypy3.9"
addpredict "${EPREFIX}/usr/lib/pypy3.10"
addpredict "${EPREFIX}/usr/local" # bug 498232
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
@ -1836,6 +1836,12 @@ distutils-r1_run_phase() {
local -x CYTHON_FORCE_REGEN=1
fi
# Rust extensions are incompatible with C/C++ LTO compiler
# see e.g. https://bugs.gentoo.org/910220
if has cargo ${INHERITED}; then
filter-lto
fi
# How to build Python modules in different worlds...
local ldopts
case "${CHOST}" in
@ -1974,7 +1980,7 @@ _distutils-r1_post_python_compile() {
die "${rscriptdir} should not exist!"
if [[ -d ${bindir} ]]; then
mkdir -p "${rscriptdir}" || die
cp -a --reflink=auto "${bindir}"/. "${rscriptdir}"/ || die
cp -a "${bindir}"/. "${rscriptdir}"/ || die
fi
# enable venv magic inside the install tree