eclass/python-r1: Sync with Gentoo

It's from Gentoo commit 227c0ab8ffc9e8a048e329f11359e0d13341f74e.
This commit is contained in:
Flatcar Buildbot 2024-10-21 07:07:09 +00:00
parent c4f1021fa4
commit c786af0b1b

View File

@ -30,14 +30,14 @@
# For more information, please see the Python Guide:
# https://projects.gentoo.org/python/guide/
if [[ -z ${_PYTHON_R1_ECLASS} ]]; then
_PYTHON_R1_ECLASS=1
case ${EAPI} in
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_PYTHON_R1_ECLASS} ]]; then
_PYTHON_R1_ECLASS=1
if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
die 'python-r1.eclass can not be used with python-single-r1.eclass.'
elif [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then
@ -129,10 +129,6 @@ inherit multibuild python-utils-r1
# depend on another Python package being built for the same Python
# implementations.
#
# The generate USE-flag list is compatible with packages using python-r1
# and python-distutils-ng eclasses. It must not be used on packages
# using python.eclass.
#
# Example use:
# @CODE
# RDEPEND="dev-python/foo[${PYTHON_USEDEP}]"
@ -242,7 +238,7 @@ unset -f _python_set_globals
# Enforce the proper setting of PYTHON_TARGETS, if PYTHON_COMPAT_OVERRIDE
# is not in effect. If it is, just warn that the flags will be ignored.
_python_validate_useflags() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then
@ -282,7 +278,7 @@ _python_validate_useflags() {
#
# This is an internal function used to implement python_gen_cond_dep.
_python_gen_usedep() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
local impl matches=()
@ -322,7 +318,7 @@ _python_gen_usedep() {
# REQUIRED_USE="doc? ( || ( python_targets_python2_7 ) )"
# @CODE
python_gen_useflags() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
local impl matches=()
@ -366,7 +362,7 @@ python_gen_useflags() {
# dev-python/unittest2[python_targets_pypy?] )"
# @CODE
python_gen_cond_dep() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
local impl matches=()
local dep=${1}
@ -428,7 +424,7 @@ python_gen_cond_dep() {
# dev-python/pypy[xml(+)] ) )"
# @CODE
python_gen_impl_dep() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
local impl matches=()
local PYTHON_REQ_USE=${1}
@ -506,7 +502,7 @@ python_gen_impl_dep() {
# )
# @CODE
python_gen_any_dep() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
local depstr=${1}
shift
@ -554,7 +550,7 @@ python_gen_any_dep() {
# to implementation-specific build directory matching BUILD_DIR used by
# python_foreach_abi().
python_copy_sources() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
local MULTIBUILD_VARIANTS
_python_obtain_impls
@ -590,7 +586,7 @@ _python_obtain_impls() {
# Initialize the environment for Python implementation selected
# for multibuild.
_python_multibuild_wrapper() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
local -x EPYTHON PYTHON
local -x PATH=${PATH} PKG_CONFIG_PATH=${PKG_CONFIG_PATH}
@ -616,7 +612,7 @@ _python_multibuild_wrapper() {
# For each command being run, EPYTHON, PYTHON and BUILD_DIR are set
# locally, and the former two are exported to the command environment.
python_foreach_impl() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
_python_sanity_checks
if [[ ${_DISTUTILS_R1_ECLASS} ]]; then
@ -708,7 +704,7 @@ python_foreach_impl() {
# }
# @CODE
python_setup() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
_python_sanity_checks
local has_check_deps
@ -774,7 +770,7 @@ python_setup() {
# All specified files must start with a 'python' shebang. A file not
# having a matching shebang will be refused.
python_replicate_script() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
_python_replicate_script() {
local _PYTHON_FIX_SHEBANG_QUIET=1
@ -789,7 +785,7 @@ python_replicate_script() {
)
python_fix_shebang -q \
"${files[@]/*\//${D%/}/${PYTHON_SCRIPTDIR}/}"
"${files[@]/*\//${D}${PYTHON_SCRIPTDIR}/}"
}
local files=( "${@}" )