summaryrefslogtreecommitdiff
path: root/eclass/llvm-r1.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/llvm-r1.eclass')
-rw-r--r--eclass/llvm-r1.eclass29
1 files changed, 17 insertions, 12 deletions
diff --git a/eclass/llvm-r1.eclass b/eclass/llvm-r1.eclass
index 658946a1ecbd..7b9f26e17b58 100644
--- a/eclass/llvm-r1.eclass
+++ b/eclass/llvm-r1.eclass
@@ -31,8 +31,8 @@
# DEPEND="
# dev-libs/libfoo[${LLVM_USEDEP}]
# $(llvm_gen_dep '
-# sys-devel/clang:${LLVM_SLOT}
-# sys-devel/llvm:${LLVM_SLOT}
+# sys-devel/clang:${LLVM_SLOT}=
+# sys-devel/llvm:${LLVM_SLOT}=
# ')
# "
# @CODE
@@ -42,7 +42,7 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ ! ${_LLVM_R1_ECLASS} ]]; then
+if [[ -z ${_LLVM_R1_ECLASS} ]]; then
_LLVM_R1_ECLASS=1
inherit llvm-utils
@@ -61,7 +61,7 @@ _LLVM_OLDEST_SLOT=15
# @DESCRIPTION:
# The newest stable LLVM version. Versions newer than that won't
# be automatically enabled via USE defaults.
-_LLVM_NEWEST_STABLE=17
+_LLVM_NEWEST_STABLE=18
# == control variables ==
@@ -101,7 +101,7 @@ _LLVM_NEWEST_STABLE=17
# packages using the same eclass, to enforce a LLVM slot match.
_llvm_set_globals() {
- debug-print-function ${FUNCNAME} "${@}"
+ debug-print-function ${FUNCNAME} "$@"
if [[ ${LLVM_COMPAT@a} != *a* ]]; then
die "LLVM_COMPAT must be set to an array before inheriting ${ECLASS}"
@@ -123,11 +123,16 @@ _llvm_set_globals() {
fi
if [[ ${stable[@]} ]]; then
+ # If there is at least one stable slot supported, then enable
+ # the newest stable slot by default.
IUSE="+llvm_slot_${stable[-1]}"
unset 'stable[-1]'
else
- IUSE="+llvm_slot_${unstable[-1]}"
- unset 'unstable[-1]'
+ # Otherwise, enable the "oldest" ~arch slot. We really only
+ # expect a single ~arch version, so this primarily prevents
+ # defaulting to non-keyworded slots.
+ IUSE="+llvm_slot_${unstable[0]}"
+ unset 'unstable[0]'
fi
local nondefault=( "${stable[@]}" "${unstable[@]}" )
IUSE+=" ${nondefault[*]/#/llvm_slot_}"
@@ -158,13 +163,13 @@ unset -f _llvm_set_globals
# @CODE
# DEPEND="
# $(llvm_gen_dep '
-# sys-devel/clang:${LLVM_SLOT}
-# sys-devel/llvm:${LLVM_SLOT}
+# sys-devel/clang:${LLVM_SLOT}=
+# sys-devel/llvm:${LLVM_SLOT}=
# ')
# "
# @CODE
llvm_gen_dep() {
- debug-print-function ${FUNCNAME} "${@}"
+ debug-print-function ${FUNCNAME} "$@"
[[ ${#} -ne 1 ]] && die "Usage: ${FUNCNAME} <dependency>"
@@ -189,7 +194,7 @@ llvm_gen_dep() {
# With "-b" option, the path is prefixed by BROOT. LLVM dependencies
# should be in BDEPEND then.
get_llvm_prefix() {
- debug-print-function ${FUNCNAME} "${@}"
+ debug-print-function ${FUNCNAME} "$@"
[[ ${#} -gt 1 ]] && die "Usage: ${FUNCNAME} [-b|-d]"
@@ -223,7 +228,7 @@ get_llvm_prefix() {
# Note that this function is not exported if LLVM_OPTIONAL is set.
# In that case, it needs to be called manually.
llvm-r1_pkg_setup() {
- debug-print-function ${FUNCNAME} "${@}"
+ debug-print-function ${FUNCNAME} "$@"
if [[ ${MERGE_TYPE} != binary ]]; then
[[ -z ${LLVM_SLOT} ]] && die "LLVM_SLOT unset (broken USE_EXPAND?)"