From e509d02ff6ca4d4bd36bd601201f47ae1405dec4 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 11 May 2023 22:40:41 -0400 Subject: [PATCH] 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 --- media-libs/mesa/mesa-9999.ebuild | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild index e5976cb09708d..dba9e680f61f0 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) ) -