coreos-cargo.eclass: Introduce variable to skip inherit

Gentoo's cargo based ebuilds don't cross-compile well, so we need a way
to inject coreos-cargo.eclass into them. Otherwise we'd need to fork the
ebuilds into coreos-overlay and maintain them ourselves.

The way we can do this is by sourcing the eclass from cros hooks and
overriding src_unpack to call the eclass implementation. Inheriting an
eclass is not allowed from hooks. Since we can't call any of the
inherits a variable is introduced to skip them and EXPORT_FUNCTIONS.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2024-03-21 09:57:29 +00:00
parent dd9e0303c4
commit 0dbf112cf5

View File

@ -12,10 +12,12 @@ if [[ -z ${_COREOS_CARGO_ECLASS} ]]; then
_COREOS_CARGO_ECLASS=1
# XXX: Don't require host dependencies to also be in the sysroot.
CATEGORY=dev-util PN=cargo inherit cargo
inherit toolchain-funcs
if [[ -z ${_COREOS_CARGO_SKIP_INHERIT} ]]; then
CATEGORY=dev-util PN=cargo inherit cargo
inherit toolchain-funcs
EXPORT_FUNCTIONS src_unpack
EXPORT_FUNCTIONS src_unpack
fi
# @FUNCTION: coreos-cargo_src_unpack
# @DESCRIPTION: