eclass/python-single-r1: Sync with Gentoo

It's from Gentoo commit 3d67b1ccfacc37308a7236625035dff1156b025c.
This commit is contained in:
Krzesimir Nowak 2023-01-24 10:48:34 +01:00
parent 179cb46a1d
commit f65ddb0fa4

View File

@ -7,7 +7,7 @@
# @AUTHOR:
# Author: Michał Górny <mgorny@gentoo.org>
# Based on work of: Krzysztof Pawlik <nelchael@gentoo.org>
# @SUPPORTED_EAPIS: 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @PROVIDES: python-utils-r1
# @BLURB: An eclass for Python packages not installed for multiple implementations.
# @DESCRIPTION:
@ -37,31 +37,22 @@
# For more information, please see the Python Guide:
# https://projects.gentoo.org/python/guide/
case "${EAPI:-0}" in
[0-5])
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
[6-8])
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
;;
case ${EAPI} in
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
if [[ ! ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
_PYTHON_SINGLE_R1_ECLASS=1
if [[ ${_PYTHON_R1} ]]; then
if [[ ${_PYTHON_R1_ECLASS} ]]; then
die 'python-single-r1.eclass can not be used with python-r1.eclass.'
elif [[ ${_PYTHON_ANY_R1} ]]; then
elif [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then
die 'python-single-r1.eclass can not be used with python-any-r1.eclass.'
fi
inherit python-utils-r1
fi
EXPORT_FUNCTIONS pkg_setup
# @ECLASS_VARIABLE: PYTHON_COMPAT
# @REQUIRED
# @DESCRIPTION:
@ -257,8 +248,6 @@ _python_single_set_globals() {
_python_single_set_globals
unset -f _python_single_set_globals
if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
# @FUNCTION: python_gen_useflags
# @USAGE: [<pattern>...]
# @DESCRIPTION:
@ -463,5 +452,6 @@ python-single-r1_pkg_setup() {
[[ ${MERGE_TYPE} != binary ]] && python_setup
}
_PYTHON_SINGLE_R1=1
fi
EXPORT_FUNCTIONS pkg_setup