eclass/multilib-build: Sync with Gentoo

It's from Gentoo commit d7317785d04e7de172de3bff05852fca3cd15af2.
This commit is contained in:
Krzesimir Nowak 2022-06-30 09:56:27 +02:00
parent f93ba14494
commit 9828aaf6e7

View File

@ -1,14 +1,12 @@
# Copyright 2013-2021 Gentoo Authors
# Copyright 2013-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Support EAPI 4.
# @ECLASS: multilib-build.eclass
# @MAINTAINER:
# Michał Górny <mgorny@gentoo.org>
# @AUTHOR:
# Author: Michał Górny <mgorny@gentoo.org>
# @SUPPORTED_EAPIS: 4 5 6 7 8
# @SUPPORTED_EAPIS: 6 7 8
# @PROVIDES: multibuild
# @BLURB: flags and utility functions for building multilib packages
# @DESCRIPTION:
@ -21,17 +19,16 @@
# to properly request multilib enabled.
case ${EAPI} in
4|5|6|7|8) ;;
6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_MULTILIB_BUILD} ]]; then
_MULTILIB_BUILD=1
if [[ -z ${_MULTILIB_BUILD_ECLASS} ]]; then
_MULTILIB_BUILD_ECLASS=1
[[ ${EAPI} == [45] ]] && inherit eutils
inherit multibuild multilib
# @ECLASS-VARIABLE: _MULTILIB_FLAGS
# @ECLASS_VARIABLE: _MULTILIB_FLAGS
# @INTERNAL
# @DESCRIPTION:
# The list of multilib flags and corresponding ABI values. If the same
@ -55,7 +52,7 @@ _MULTILIB_FLAGS=(
)
readonly _MULTILIB_FLAGS
# @ECLASS-VARIABLE: MULTILIB_COMPAT
# @ECLASS_VARIABLE: MULTILIB_COMPAT
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of multilib ABIs supported by the ebuild. If unset, defaults to
@ -79,7 +76,7 @@ readonly _MULTILIB_FLAGS
# MULTILIB_COMPAT=( abi_x86_{32,64} )
# @CODE
# @ECLASS-VARIABLE: MULTILIB_USEDEP
# @ECLASS_VARIABLE: MULTILIB_USEDEP
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The USE-dependency to be used on dependencies (libraries) needing
@ -91,7 +88,7 @@ readonly _MULTILIB_FLAGS
# net-libs/libbar[ssl,${MULTILIB_USEDEP}]"
# @CODE
# @ECLASS-VARIABLE: MULTILIB_ABI_FLAG
# @ECLASS_VARIABLE: MULTILIB_ABI_FLAG
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# The complete ABI name. Resembles the USE flag name.
@ -246,23 +243,6 @@ multilib_parallel_foreach_abi() {
multibuild_foreach_variant _multilib_multibuild_wrapper "${@}"
}
# @FUNCTION: multilib_for_best_abi
# @USAGE: <argv>...
# @DESCRIPTION:
# Runs the given command with setup for the 'best' (usually native) ABI.
multilib_for_best_abi() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}, use multilib_is_native_abi() instead"
eqawarn "QA warning: multilib_for_best_abi() function is deprecated and should"
eqawarn "not be used. The multilib_is_native_abi() check may be used instead."
local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abi_pairs) )
multibuild_for_best_variant _multilib_multibuild_wrapper "${@}"
}
# @FUNCTION: multilib_check_headers
# @DESCRIPTION:
# Check whether the header files are consistent between ABIs.
@ -321,7 +301,7 @@ multilib_copy_sources() {
multibuild_copy_sources
}
# @ECLASS-VARIABLE: MULTILIB_WRAPPED_HEADERS
# @ECLASS_VARIABLE: MULTILIB_WRAPPED_HEADERS
# @DEFAULT_UNSET
# @DESCRIPTION:
# A list of headers to wrap for multilib support. The listed headers
@ -344,7 +324,7 @@ multilib_copy_sources() {
# )
# @CODE
# @ECLASS-VARIABLE: MULTILIB_CHOST_TOOLS
# @ECLASS_VARIABLE: MULTILIB_CHOST_TOOLS
# @DEFAULT_UNSET
# @DESCRIPTION:
# A list of tool executables to preserve for each multilib ABI.
@ -585,20 +565,6 @@ multilib_is_native_abi() {
[[ ${COMPLETE_MULTILIB} == yes || ${ABI} == ${DEFAULT_ABI} ]]
}
# @FUNCTION: multilib_build_binaries
# @DESCRIPTION:
# Deprecated synonym for multilib_is_native_abi
multilib_build_binaries() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}, use multilib_is_native_abi() instead"
eqawarn "QA warning: multilib_build_binaries is deprecated. Please use the equivalent"
eqawarn "multilib_is_native_abi function instead."
multilib_is_native_abi "${@}"
}
# @FUNCTION: multilib_native_use_with
# @USAGE: <flag> [<opt-name> [<opt-value>]]
# @DESCRIPTION:
@ -666,7 +632,6 @@ multilib_native_with() {
# of <false1> (or 'no' if unspecified) and <false2>. Arguments
# are the same as for usex in the EAPI.
#
# Note: in EAPI 4 you need to inherit eutils to use this function.
multilib_native_usex() {
if multilib_is_native_abi; then
usex "${@}"