commit:     59d389e33aef580b4d5ae2aa9acde86dc0081042
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Fri Sep 15 07:29:55 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 27 09:12:32 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59d389e3

llvm.eclass: add option to skip llvm_pkg_setup

To be used during prefix bootstrap using LLVM toolchain. Without this,
several LLVM packages don't build.

Bug: https://bugs.gentoo.org/758167
Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/llvm.eclass | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass
index 8198650aad9a..57faa48819db 100644
--- a/eclass/llvm.eclass
+++ b/eclass/llvm.eclass
@@ -80,6 +80,13 @@ DEPEND="!!sys-devel/llvm:0"
 # Correct values of LLVM slots, newest first.
 declare -g -r _LLVM_KNOWN_SLOTS=( {18..8} )
 
+# @ECLASS_VARIABLE: LLVM_ECLASS_SKIP_PKG_SETUP
+# @INTERNAL
+# @DESCRIPTION:
+# If set to a non-empty value, llvm_pkg_setup will not perform LLVM version
+# check, nor set PATH.  Useful for bootstrap-prefix.sh, where AppleClang has
+# unparseable version numbers, which are irrelevant anyway.
+
 # @FUNCTION: get_llvm_slot
 # @USAGE: [-b|-d] [<max_slot>]
 # @DESCRIPTION:
@@ -242,6 +249,10 @@ llvm_fix_tool_path() {
 llvm_pkg_setup() {
        debug-print-function ${FUNCNAME} "${@}"
 
+       if [[ ${LLVM_ECLASS_SKIP_PKG_SETUP} ]]; then
+               return
+       fi
+
        if [[ ${MERGE_TYPE} != binary ]]; then
                LLVM_SLOT=$(get_llvm_slot "${LLVM_MAX_SLOT}")
 

Reply via email to