diff options
Diffstat (limited to 'eclass/python-r1.eclass')
-rw-r--r-- | eclass/python-r1.eclass | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index fbc6082a1d92..9b03a269e88b 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: python-r1.eclass @@ -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,10 +586,12 @@ _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} + local PYTHON_USEDEP="python_targets_${MULTIBUILD_VARIANT}(-)" + local PYTHON_SINGLE_USEDEP="python_single_target_${MULTIBUILD_VARIANT}(-)" _python_export "${MULTIBUILD_VARIANT}" EPYTHON PYTHON _python_wrapper_setup @@ -614,7 +612,8 @@ _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 if has "${EBUILD_PHASE}" prepare configure compile test install && @@ -705,7 +704,8 @@ python_foreach_impl() { # } # @CODE python_setup() { - debug-print-function ${FUNCNAME} "${@}" + debug-print-function ${FUNCNAME} "$@" + _python_sanity_checks local has_check_deps declare -f python_check_deps >/dev/null && has_check_deps=1 @@ -770,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 @@ -785,7 +785,7 @@ python_replicate_script() { ) python_fix_shebang -q \ - "${files[@]/*\//${D%/}/${PYTHON_SCRIPTDIR}/}" + "${files[@]/*\//${D}${PYTHON_SCRIPTDIR}/}" } local files=( "${@}" ) |