eclass/distutils-r1: Sync with Gentoo

It's from Gentoo commit 3900e6f2244e545c211959ab7e89347640b9828c.
This commit is contained in:
Flatcar Buildbot 2023-05-22 07:13:28 +00:00 committed by Krzesimir Nowak
parent bc7c58567f
commit ee6f15f7bf

View File

@ -107,7 +107,7 @@ esac
# The variable specifies the build system used. Currently, # The variable specifies the build system used. Currently,
# the following values are supported: # the following values are supported:
# #
# - flit - flit_core backend # - flit - flit-core backend
# #
# - flit_scm - flit_scm backend # - flit_scm - flit_scm backend
# #
@ -210,7 +210,7 @@ _distutils_set_globals() {
case ${DISTUTILS_USE_PEP517} in case ${DISTUTILS_USE_PEP517} in
flit) flit)
bdep+=' bdep+='
>=dev-python/flit_core-3.8.0[${PYTHON_USEDEP}] >=dev-python/flit-core-3.8.0[${PYTHON_USEDEP}]
' '
;; ;;
flit_scm) flit_scm)
@ -225,7 +225,7 @@ _distutils_set_globals() {
;; ;;
jupyter) jupyter)
bdep+=' bdep+='
>=dev-python/jupyter_packaging-0.12.3[${PYTHON_USEDEP}] >=dev-python/jupyter-packaging-0.12.3[${PYTHON_USEDEP}]
' '
;; ;;
maturin) maturin)
@ -330,9 +330,12 @@ _distutils_set_globals() {
if [[ ${DISTUTILS_EXT} ]]; then if [[ ${DISTUTILS_EXT} ]]; then
DEPEND="${PYTHON_DEPS}" DEPEND="${PYTHON_DEPS}"
IUSE="debug"
fi fi
fi fi
if [[ ${DISTUTILS_EXT} ]]; then
IUSE="debug"
fi
} }
_distutils_set_globals _distutils_set_globals
unset -f _distutils_set_globals unset -f _distutils_set_globals
@ -918,12 +921,12 @@ _distutils-r1_print_package_versions() {
case ${DISTUTILS_USE_PEP517} in case ${DISTUTILS_USE_PEP517} in
flit) flit)
packages+=( packages+=(
dev-python/flit_core dev-python/flit-core
) )
;; ;;
flit_scm) flit_scm)
packages+=( packages+=(
dev-python/flit_core dev-python/flit-core
dev-python/flit_scm dev-python/flit_scm
dev-python/setuptools-scm dev-python/setuptools-scm
) )
@ -937,7 +940,7 @@ _distutils-r1_print_package_versions() {
;; ;;
jupyter) jupyter)
packages+=( packages+=(
dev-python/jupyter_packaging dev-python/jupyter-packaging
dev-python/setuptools dev-python/setuptools
dev-python/setuptools-scm dev-python/setuptools-scm
dev-python/wheel dev-python/wheel
@ -1305,6 +1308,7 @@ distutils_pep517_install() {
fi fi
local root=${1} local root=${1}
export BUILD_DIR
local -x WHEEL_BUILD_DIR=${BUILD_DIR}/wheel local -x WHEEL_BUILD_DIR=${BUILD_DIR}/wheel
mkdir -p "${WHEEL_BUILD_DIR}" || die mkdir -p "${WHEEL_BUILD_DIR}" || die
@ -1316,6 +1320,7 @@ distutils_pep517_install() {
case ${DISTUTILS_USE_PEP517} in case ${DISTUTILS_USE_PEP517} in
meson-python) meson-python)
local -x NINJAOPTS=$(get_NINJAOPTS) local -x NINJAOPTS=$(get_NINJAOPTS)
if has_version -b '>=dev-python/meson-python-0.13'; then
config_settings=$( config_settings=$(
"${EPYTHON}" - "${DISTUTILS_ARGS[@]}" <<-EOF || die "${EPYTHON}" - "${DISTUTILS_ARGS[@]}" <<-EOF || die
import json import json
@ -1325,6 +1330,23 @@ distutils_pep517_install() {
ninjaopts = shlex.split(os.environ["NINJAOPTS"]) ninjaopts = shlex.split(os.environ["NINJAOPTS"])
print(json.dumps({ print(json.dumps({
"builddir": "${BUILD_DIR}",
"setup-args": sys.argv[1:],
"compile-args": ["-v"] + ninjaopts,
}))
EOF
)
else
config_settings=$(
"${EPYTHON}" - "${DISTUTILS_ARGS[@]}" <<-EOF || die
import json
import os
import shlex
import sys
ninjaopts = shlex.split(os.environ["NINJAOPTS"])
print(json.dumps({
"builddir": "${BUILD_DIR}",
"setup-args": sys.argv[1:], "setup-args": sys.argv[1:],
"compile-args": [ "compile-args": [
"-v", "-v",
@ -1333,6 +1355,7 @@ distutils_pep517_install() {
})) }))
EOF EOF
) )
fi
;; ;;
setuptools) setuptools)
if [[ -n ${DISTUTILS_ARGS[@]} ]]; then if [[ -n ${DISTUTILS_ARGS[@]} ]]; then