mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-15 17:06:58 +02:00
eclass/multilib-build: Sync with gentoo
It's from gentoo commit 63636277fcee0a5fd90299253aa870af989f895d.
This commit is contained in:
parent
325657cc4a
commit
9898cbdf5d
@ -1,12 +1,13 @@
|
|||||||
# Copyright 2013-2019 Gentoo Authors
|
# Copyright 2013-2021 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
# @ECLASS: multilib-build.eclass
|
# @ECLASS: multilib-build.eclass
|
||||||
# @MAINTAINER:
|
# @MAINTAINER:
|
||||||
# gx86-multilib team <multilib@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
|
# @SUPPORTED_EAPIS: 5 6 7 8
|
||||||
|
# @PROVIDES: multibuild
|
||||||
# @BLURB: flags and utility functions for building multilib packages
|
# @BLURB: flags and utility functions for building multilib packages
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# The multilib-build.eclass exports USE flags and utility functions
|
# The multilib-build.eclass exports USE flags and utility functions
|
||||||
@ -17,15 +18,15 @@
|
|||||||
# dependencies shall use the USE dependency string in ${MULTILIB_USEDEP}
|
# dependencies shall use the USE dependency string in ${MULTILIB_USEDEP}
|
||||||
# to properly request multilib enabled.
|
# to properly request multilib enabled.
|
||||||
|
|
||||||
if [[ ! ${_MULTILIB_BUILD} ]]; then
|
case ${EAPI} in
|
||||||
|
5|6|7|8) ;;
|
||||||
# EAPI=4 is required for meaningful MULTILIB_USEDEP.
|
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||||
case ${EAPI:-0} in
|
|
||||||
4|5|6|7) ;;
|
|
||||||
*) die "EAPI=${EAPI} is not supported" ;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[[ ${EAPI} == [45] ]] && inherit eutils
|
if [[ -z ${_MULTILIB_BUILD} ]]; then
|
||||||
|
_MULTILIB_BUILD=1
|
||||||
|
|
||||||
|
[[ ${EAPI} == 5 ]] && inherit eutils
|
||||||
inherit multibuild multilib
|
inherit multibuild multilib
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: _MULTILIB_FLAGS
|
# @ECLASS-VARIABLE: _MULTILIB_FLAGS
|
||||||
@ -47,8 +48,6 @@ _MULTILIB_FLAGS=(
|
|||||||
abi_mips_o32:o32
|
abi_mips_o32:o32
|
||||||
# abi_ppc_32:ppc,ppc_aix,ppc_macos
|
# abi_ppc_32:ppc,ppc_aix,ppc_macos
|
||||||
# abi_ppc_64:ppc64
|
# abi_ppc_64:ppc64
|
||||||
abi_riscv_lp64d:lp64d
|
|
||||||
abi_riscv_lp64:lp64
|
|
||||||
abi_s390_32:s390
|
abi_s390_32:s390
|
||||||
abi_s390_64:s390x
|
abi_s390_64:s390x
|
||||||
)
|
)
|
||||||
@ -79,6 +78,7 @@ readonly _MULTILIB_FLAGS
|
|||||||
# @CODE
|
# @CODE
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: MULTILIB_USEDEP
|
# @ECLASS-VARIABLE: MULTILIB_USEDEP
|
||||||
|
# @OUTPUT_VARIABLE
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# The USE-dependency to be used on dependencies (libraries) needing
|
# The USE-dependency to be used on dependencies (libraries) needing
|
||||||
# to support multilib as well.
|
# to support multilib as well.
|
||||||
@ -90,7 +90,7 @@ readonly _MULTILIB_FLAGS
|
|||||||
# @CODE
|
# @CODE
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: MULTILIB_ABI_FLAG
|
# @ECLASS-VARIABLE: MULTILIB_ABI_FLAG
|
||||||
# @DEFAULT_UNSET
|
# @OUTPUT_VARIABLE
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# The complete ABI name. Resembles the USE flag name.
|
# The complete ABI name. Resembles the USE flag name.
|
||||||
#
|
#
|
||||||
@ -251,7 +251,7 @@ multilib_parallel_foreach_abi() {
|
|||||||
multilib_for_best_abi() {
|
multilib_for_best_abi() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "${@}"
|
||||||
|
|
||||||
[[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}, use multilib_is_native_abi() instead"
|
[[ ${EAPI} == 5 ]] || 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 "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."
|
eqawarn "not be used. The multilib_is_native_abi() check may be used instead."
|
||||||
@ -320,6 +320,7 @@ multilib_copy_sources() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: MULTILIB_WRAPPED_HEADERS
|
# @ECLASS-VARIABLE: MULTILIB_WRAPPED_HEADERS
|
||||||
|
# @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
|
||||||
# will be moved to a non-standard location and replaced with a file
|
# will be moved to a non-standard location and replaced with a file
|
||||||
@ -342,6 +343,7 @@ multilib_copy_sources() {
|
|||||||
# @CODE
|
# @CODE
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: MULTILIB_CHOST_TOOLS
|
# @ECLASS-VARIABLE: MULTILIB_CHOST_TOOLS
|
||||||
|
# @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.
|
||||||
# The listed executables will be renamed to ${CHOST}-${basename},
|
# The listed executables will be renamed to ${CHOST}-${basename},
|
||||||
@ -369,8 +371,8 @@ multilib_copy_sources() {
|
|||||||
# MULTILIB_CHOST_TOOLS=(
|
# MULTILIB_CHOST_TOOLS=(
|
||||||
# /usr/bin/foo-config
|
# /usr/bin/foo-config
|
||||||
# )
|
# )
|
||||||
|
|
||||||
# @CODE
|
# @CODE
|
||||||
|
|
||||||
# @FUNCTION: multilib_prepare_wrappers
|
# @FUNCTION: multilib_prepare_wrappers
|
||||||
# @USAGE: [<install-root>]
|
# @USAGE: [<install-root>]
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
@ -488,14 +490,6 @@ multilib_prepare_wrappers() {
|
|||||||
# elif(_MIPS_SIM == _ABIO32) /* o32 */
|
# elif(_MIPS_SIM == _ABIO32) /* o32 */
|
||||||
# error "abi_mips_o32 not supported by the package."
|
# error "abi_mips_o32 not supported by the package."
|
||||||
# endif
|
# endif
|
||||||
#elif defined(__riscv)
|
|
||||||
# if defined(__riscv_float_abi_double)
|
|
||||||
# error "abi_riscv_lp64d not supported by the package."
|
|
||||||
# elif defined(__riscv_float_abi_single)
|
|
||||||
# error "abi_riscv_lp64f not supported by the package."
|
|
||||||
# else
|
|
||||||
# error "abi_riscv_lp64 not supported by the package."
|
|
||||||
# endif
|
|
||||||
#elif defined(__sparc__)
|
#elif defined(__sparc__)
|
||||||
# if defined(__arch64__)
|
# if defined(__arch64__)
|
||||||
# error "abi_sparc_64 not supported by the package."
|
# error "abi_sparc_64 not supported by the package."
|
||||||
@ -595,7 +589,7 @@ multilib_is_native_abi() {
|
|||||||
multilib_build_binaries() {
|
multilib_build_binaries() {
|
||||||
debug-print-function ${FUNCNAME} "${@}"
|
debug-print-function ${FUNCNAME} "${@}"
|
||||||
|
|
||||||
[[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}, use multilib_is_native_abi() instead"
|
[[ ${EAPI} == 5 ]] || 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 "QA warning: multilib_build_binaries is deprecated. Please use the equivalent"
|
||||||
eqawarn "multilib_is_native_abi function instead."
|
eqawarn "multilib_is_native_abi function instead."
|
||||||
@ -670,7 +664,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 "${@}"
|
||||||
@ -679,5 +672,4 @@ multilib_native_usex() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_MULTILIB_BUILD=1
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user