eclass/llvm: Sync with Gentoo

It's from Gentoo commit 1f9f1999cdc8ccb94054dec2d2951c7e486aa996.
This commit is contained in:
Flatcar Buildbot 2025-01-13 07:07:50 +00:00 committed by Krzesimir Nowak
parent 6bb0a257ce
commit 4fe74bda38

View File

@ -24,11 +24,11 @@
# inherit cmake llvm
#
# RDEPEND="
# <sys-devel/llvm-11:=
# <llvm-core/llvm-11:=
# || (
# sys-devel/llvm:9
# sys-devel/llvm:10
# sys-devel/llvm:11
# llvm-core/llvm:9
# llvm-core/llvm:10
# llvm-core/llvm:11
# )
# "
# DEPEND=${RDEPEND}
@ -49,12 +49,12 @@
# # note: do not use := on both clang and llvm, it can match different
# # slots then. clang pulls llvm in, so we can skip the latter.
# RDEPEND="
# >=sys-devel/clang-9:=[llvm_targets_AMDGPU(+)]
# >=llvm-core/clang-9:=[llvm_targets_AMDGPU(+)]
# "
# DEPEND=${RDEPEND}
#
# llvm_check_deps() {
# has_version -d "sys-devel/clang:${LLVM_SLOT}[llvm_targets_AMDGPU(+)]"
# has_version -d "llvm-core/clang:${LLVM_SLOT}[llvm_targets_AMDGPU(+)]"
# }
# @CODE
@ -70,7 +70,7 @@ inherit llvm-utils
# make sure that the versions installing straight into /usr/bin
# are uninstalled
DEPEND="!!sys-devel/llvm:0"
DEPEND="!!llvm-core/llvm:0"
# @ECLASS_VARIABLE: LLVM_MAX_SLOT
# @DEFAULT_UNSET
@ -116,7 +116,7 @@ declare -g -r _LLVM_KNOWN_SLOTS=( {19..8} )
# the function scope, LLVM_SLOT will be defined to the SLOT value
# (0, 4, 5...). The function should return a true status if the slot
# is acceptable, false otherwise. If llvm_check_deps() is not defined,
# the function defaults to checking whether sys-devel/llvm:${LLVM_SLOT}
# the function defaults to checking whether llvm-core/llvm:${LLVM_SLOT}
# is installed.
get_llvm_slot() {
debug-print-function ${FUNCNAME} "$@"
@ -147,7 +147,7 @@ get_llvm_slot() {
llvm_check_deps || continue
else
# check if LLVM package is installed
has_version ${hv_switch} "sys-devel/llvm:${slot}" || continue
has_version ${hv_switch} "llvm-core/llvm:${slot}" || continue
fi
echo "${slot}"