summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2023-05-11 22:40:41 -0400
committerMatt Turner <mattst88@gentoo.org>2023-05-12 13:18:42 -0400
commite509d02ff6ca4d4bd36bd601201f47ae1405dec4 (patch)
treefbfa3fe0c70906d44c74775b82ee65332641c357 /media-libs/mesa
parentmedia-libs/mesa: Simplify LLVM dependencies (diff)
downloadgentoo-e509d02ff6ca4d4bd36bd601201f47ae1405dec4.tar.gz
gentoo-e509d02ff6ca4d4bd36bd601201f47ae1405dec4.tar.bz2
gentoo-e509d02ff6ca4d4bd36bd601201f47ae1405dec4.zip
media-libs/mesa: Generate LLVM_DEPSTR
This reduces a lot of copy-and-paste, which will help when other dependencies that are tied to the llvm major version are added here. Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'media-libs/mesa')
-rw-r--r--media-libs/mesa/mesa-9999.ebuild31
1 files changed, 16 insertions, 15 deletions
diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild
index e5976cb09708..dba9e680f61f 100644
--- a/media-libs/mesa/mesa-9999.ebuild
+++ b/media-libs/mesa/mesa-9999.ebuild
@@ -103,29 +103,30 @@ RDEPEND="${RDEPEND}
# simultaneously.
#
# How to use it:
-# 1. List all the working slots (with min versions) in ||, newest first.
-# 2. Update the := to specify *max* version, e.g. < 10.
-# 3. Specify LLVM_MAX_SLOT, e.g. 9.
+# 1. Specify LLVM_MAX_SLOT (inclusive), e.g. 16.
+# 2. Specify LLVM_MIN_SLOT (inclusive), e.g. 15.
LLVM_MAX_SLOT="16"
+LLVM_MIN_SLOT="15"
LLVM_USE_DEPS="llvm_targets_AMDGPU(+),${MULTILIB_USEDEP}"
+PER_SLOT_DEPSTR="
+ (
+ !opencl? ( sys-devel/llvm:@SLOT@[${LLVM_USE_DEPS}] )
+ opencl? ( sys-devel/clang:@SLOT@[${LLVM_USE_DEPS}] )
+ )
+"
LLVM_DEPSTR="
|| (
- sys-devel/@@@@:16[${LLVM_USE_DEPS}]
- sys-devel/@@@@:15[${LLVM_USE_DEPS}]
+ $(for ((slot=LLVM_MAX_SLOT; slot>=LLVM_MIN_SLOT; slot--)); do
+ echo "${PER_SLOT_DEPSTR//@SLOT@/${slot}}"
+ done)
)
- <sys-devel/@@@@-$((LLVM_MAX_SLOT + 1)):=[${LLVM_USE_DEPS}]
+ !opencl? ( <sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${LLVM_USE_DEPS}] )
+ opencl? ( <sys-devel/clang-$((LLVM_MAX_SLOT + 1)):=[${LLVM_USE_DEPS}] )
"
RDEPEND="${RDEPEND}
- llvm? (
- opencl? (
- ${LLVM_DEPSTR//@@@@/clang}
- )
- !opencl? (
- ${LLVM_DEPSTR//@@@@/llvm}
- )
- )
+ llvm? ( ${LLVM_DEPSTR} )
"
-unset LLVM_DEPSTR
+unset LLVM_MIN_SLOT {LLVM,PER_SLOT}_DEPSTR
DEPEND="${RDEPEND}
video_cards_d3d12? ( dev-util/directx-headers[${MULTILIB_USEDEP}] )