eclass/multibuild: Sync with Gentoo

It's from Gentoo commit c8af7eb1285a2683460618b71e2e9a14ca6badcd.
This commit is contained in:
Flatcar Buildbot 2024-10-21 07:06:51 +00:00
parent fafb1d9195
commit c3780924d0

View File

@ -6,21 +6,17 @@
# Michał Górny <mgorny@gentoo.org>
# @AUTHOR:
# Author: Michał Górny <mgorny@gentoo.org>
# @SUPPORTED_EAPIS: 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @BLURB: A generic eclass for building multiple variants of packages.
# @DESCRIPTION:
# The multibuild eclass aims to provide a generic framework for building
# multiple 'variants' of a package (e.g. multilib, Python
# implementations).
if [[ ! ${_MULTIBUILD_ECLASS} ]]; then
if [[ -z ${_MULTIBUILD_ECLASS} ]]; then
_MULTIBUILD_ECLASS=1
case ${EAPI} in
6)
ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated EAPI ${EAPI}!"
ewarn "${CATEGORY}/${PF}: Support will be removed on 2024-10-08. Please port to newer EAPI."
;;
7|8)
# backwards compatibility for run_in_build_dir
inherit out-of-source-utils
@ -99,7 +95,7 @@ esac
# nevertheless. It is preferred to call 'die' inside of the passed
# function.
multibuild_foreach_variant() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
[[ ${MULTIBUILD_VARIANTS} ]] \
|| die "MULTIBUILD_VARIANTS need to be set"
@ -150,7 +146,7 @@ multibuild_foreach_variant() {
#
# The function returns command exit status.
multibuild_for_best_variant() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
[[ ${MULTIBUILD_VARIANTS} ]] \
|| die "MULTIBUILD_VARIANTS need to be set"
@ -166,7 +162,7 @@ multibuild_for_best_variant() {
# be placed in directories matching BUILD_DIRs used by
# multibuild_foreach().
multibuild_copy_sources() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
local _MULTIBUILD_INITIAL_BUILD_DIR=${BUILD_DIR:-${S}}
@ -188,7 +184,7 @@ multibuild_copy_sources() {
# (the real root). Both directories have to be real, absolute paths
# (i.e. including ${D}). Source root will be removed.
multibuild_merge_root() {
debug-print-function ${FUNCNAME} "${@}"
debug-print-function ${FUNCNAME} "$@"
local src=${1}
local dest=${2}