mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-30 18:12:08 +02:00
eclass/multilib-build: Sync with Gentoo
It's from Gentoo commit d7317785d04e7de172de3bff05852fca3cd15af2.
This commit is contained in:
parent
f93ba14494
commit
9828aaf6e7
@ -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
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
# Flatcar: Support EAPI 4.
|
|
||||||
|
|
||||||
# @ECLASS: multilib-build.eclass
|
# @ECLASS: multilib-build.eclass
|
||||||
# @MAINTAINER:
|
# @MAINTAINER:
|
||||||
# Michał Górny <mgorny@gentoo.org>
|
# Michał Górny <mgorny@gentoo.org>
|
||||||
# @AUTHOR:
|
# @AUTHOR:
|
||||||
# Author: Michał Górny <mgorny@gentoo.org>
|
# Author: Michał Górny <mgorny@gentoo.org>
|
||||||
# @SUPPORTED_EAPIS: 4 5 6 7 8
|
# @SUPPORTED_EAPIS: 6 7 8
|
||||||
# @PROVIDES: multibuild
|
# @PROVIDES: multibuild
|
||||||
# @BLURB: flags and utility functions for building multilib packages
|
# @BLURB: flags and utility functions for building multilib packages
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
@ -21,17 +19,16 @@
|
|||||||
# to properly request multilib enabled.
|
# to properly request multilib enabled.
|
||||||
|
|
||||||
case ${EAPI} in
|
case ${EAPI} in
|
||||||
4|5|6|7|8) ;;
|
6|7|8) ;;
|
||||||
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ -z ${_MULTILIB_BUILD} ]]; then
|
if [[ -z ${_MULTILIB_BUILD_ECLASS} ]]; then
|
||||||
_MULTILIB_BUILD=1
|
_MULTILIB_BUILD_ECLASS=1
|
||||||
|
|
||||||
[[ ${EAPI} == [45] ]] && inherit eutils
|
|
||||||
inherit multibuild multilib
|
inherit multibuild multilib
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: _MULTILIB_FLAGS
|
# @ECLASS_VARIABLE: _MULTILIB_FLAGS
|
||||||
# @INTERNAL
|
# @INTERNAL
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# The list of multilib flags and corresponding ABI values. If the same
|
# The list of multilib flags and corresponding ABI values. If the same
|
||||||
@ -55,7 +52,7 @@ _MULTILIB_FLAGS=(
|
|||||||
)
|
)
|
||||||
readonly _MULTILIB_FLAGS
|
readonly _MULTILIB_FLAGS
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: MULTILIB_COMPAT
|
# @ECLASS_VARIABLE: MULTILIB_COMPAT
|
||||||
# @DEFAULT_UNSET
|
# @DEFAULT_UNSET
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# List of multilib ABIs supported by the ebuild. If unset, defaults to
|
# 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} )
|
# MULTILIB_COMPAT=( abi_x86_{32,64} )
|
||||||
# @CODE
|
# @CODE
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: MULTILIB_USEDEP
|
# @ECLASS_VARIABLE: MULTILIB_USEDEP
|
||||||
# @OUTPUT_VARIABLE
|
# @OUTPUT_VARIABLE
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# The USE-dependency to be used on dependencies (libraries) needing
|
# The USE-dependency to be used on dependencies (libraries) needing
|
||||||
@ -91,7 +88,7 @@ readonly _MULTILIB_FLAGS
|
|||||||
# net-libs/libbar[ssl,${MULTILIB_USEDEP}]"
|
# net-libs/libbar[ssl,${MULTILIB_USEDEP}]"
|
||||||
# @CODE
|
# @CODE
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: MULTILIB_ABI_FLAG
|
# @ECLASS_VARIABLE: MULTILIB_ABI_FLAG
|
||||||
# @OUTPUT_VARIABLE
|
# @OUTPUT_VARIABLE
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# The complete ABI name. Resembles the USE flag name.
|
# The complete ABI name. Resembles the USE flag name.
|
||||||
@ -246,23 +243,6 @@ multilib_parallel_foreach_abi() {
|
|||||||
multibuild_foreach_variant _multilib_multibuild_wrapper "${@}"
|
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
|
# @FUNCTION: multilib_check_headers
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# Check whether the header files are consistent between ABIs.
|
# Check whether the header files are consistent between ABIs.
|
||||||
@ -321,7 +301,7 @@ multilib_copy_sources() {
|
|||||||
multibuild_copy_sources
|
multibuild_copy_sources
|
||||||
}
|
}
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: MULTILIB_WRAPPED_HEADERS
|
# @ECLASS_VARIABLE: MULTILIB_WRAPPED_HEADERS
|
||||||
# @DEFAULT_UNSET
|
# @DEFAULT_UNSET
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# A list of headers to wrap for multilib support. The listed headers
|
# A list of headers to wrap for multilib support. The listed headers
|
||||||
@ -344,7 +324,7 @@ multilib_copy_sources() {
|
|||||||
# )
|
# )
|
||||||
# @CODE
|
# @CODE
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: MULTILIB_CHOST_TOOLS
|
# @ECLASS_VARIABLE: MULTILIB_CHOST_TOOLS
|
||||||
# @DEFAULT_UNSET
|
# @DEFAULT_UNSET
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# A list of tool executables to preserve for each multilib ABI.
|
# 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} ]]
|
[[ ${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
|
# @FUNCTION: multilib_native_use_with
|
||||||
# @USAGE: <flag> [<opt-name> [<opt-value>]]
|
# @USAGE: <flag> [<opt-name> [<opt-value>]]
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
@ -666,7 +632,6 @@ multilib_native_with() {
|
|||||||
# of <false1> (or 'no' if unspecified) and <false2>. Arguments
|
# of <false1> (or 'no' if unspecified) and <false2>. Arguments
|
||||||
# are the same as for usex in the EAPI.
|
# 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() {
|
multilib_native_usex() {
|
||||||
if multilib_is_native_abi; then
|
if multilib_is_native_abi; then
|
||||||
usex "${@}"
|
usex "${@}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user