git: 49940028250a - main - devel/llvm18: PLIST_SUB improvements [NFC]

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Fri, 22 Mar 2024 17:45:09 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/ports/commit/?id=49940028250a4fb4beffc5a332fa9c0b612d0a3a

commit 49940028250a4fb4beffc5a332fa9c0b612d0a3a
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2024-03-21 23:21:27 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-03-22 17:44:59 +0000

    devel/llvm18: PLIST_SUB improvements [NFC]
    
    Chase changes in library suffixes and fix an overly pesimistic
    substitution.  No functional change, but will reduce plist churn when 19
    comes out assuming there aren't further upstream changes in suffixes.
---
 devel/llvm18/Makefile  |  9 ++++++---
 devel/llvm18/pkg-plist | 30 +++++++++++++++---------------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/devel/llvm18/Makefile b/devel/llvm18/Makefile
index 7a6e0abfd807..cd0eea7defa2 100644
--- a/devel/llvm18/Makefile
+++ b/devel/llvm18/Makefile
@@ -28,7 +28,8 @@ FLAVOR?=	${FLAVORS:[1]}
 lite_PKGNAMESUFFIX=	${LLVM_SUFFIX}-lite
 
 LLVM_RELEASE=	${DISTVERSION:C/rc.*//}
-LLVM_MAJOR=	${LLVM_RELEASE:C/\.[0-9]\.[0-9]$//}
+LLVM_MAJOR_MINOR=${LLVM_RELEASE:C/\.[0-9]$//}
+LLVM_MAJOR=	${LLVM_MAJOR_MINOR:C/\.[0-9]$//}
 LLVM_SUFFIX=	${LLVM_MAJOR}
 PRE_=		${DISTVERSION:C/.*rc.*/pre/:N*[0-9]*}
 RCDIR=		${DISTVERSION:S/${LLVM_RELEASE}//:C|(rc.*)|/\1|}
@@ -218,7 +219,8 @@ CMAKE_BUILD_TYPE=	RelWithDebInfo
 STRIP=
 .endif
 
-PLIST_SUB+=	LLVM_MAJOR=${LLVM_MAJOR} \
+PLIST_SUB+=	LLVM_MAJOR_MINOR=${LLVM_MAJOR_MINOR} \
+		LLVM_MAJOR=${LLVM_MAJOR} \
 		LLVM_RELEASE=${LLVM_RELEASE} \
 		LLVM_SUFFIX=${LLVM_SUFFIX}
 
@@ -623,8 +625,9 @@ build-plist:
 	    -e 's|release.cmake|%%CMAKE_BUILD_TYPE%%.cmake|' \
 	    -e 's|${LLVM_RELEASE:C/\./\\./g}|%%LLVM_RELEASE%%|' \
 	    -e 's|${LLVM_SUFFIX:C/\./\\./g}|%%LLVM_SUFFIX%%|' \
+	    -e 's|${LLVM_MAJOR_MINOR:C/\./\\./}|%%LLVM_MAJOR_MINOR%%|' \
 	    -e 's|/${LLVM_MAJOR}/|/%%LLVM_MAJOR%%/|' \
-	    -e 's|\([-./]\)${LLVM_MAJOR:C/\./\\./}$$|\1%%LLVM_MAJOR%%|' \
+	    -e 's|\([-./]\)${LLVM_MAJOR}|\1%%LLVM_MAJOR%%|' \
 	    | ${SORT} >> ${PLIST}.tmp
 	${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR}/lit${LLVM_SUFFIX} -type f | \
 	    ${SED} -e 's|${STAGEDIR}${PYTHON_SITELIBDIR}|%%LIT%%%%PYTHON_SITELIBDIR%%|' \
diff --git a/devel/llvm18/pkg-plist b/devel/llvm18/pkg-plist
index 5cfdf33712f4..106d46fe6187 100644
--- a/devel/llvm18/pkg-plist
+++ b/devel/llvm18/pkg-plist
@@ -6207,9 +6207,9 @@ llvm%%LLVM_SUFFIX%%/lib/cmake/llvm/llvm-driver-template.cpp.in
 %%STATIC_LIBS%%%%FLANG%%llvm%%LLVM_SUFFIX%%/lib/libFortran_main.a
 %%STATIC_LIBS%%%%FLANG%%llvm%%LLVM_SUFFIX%%/lib/libHLFIRDialect.a
 %%STATIC_LIBS%%%%FLANG%%llvm%%LLVM_SUFFIX%%/lib/libHLFIRTransforms.a
-llvm%%LLVM_SUFFIX%%/lib/libLLVM-18.so
+llvm%%LLVM_SUFFIX%%/lib/libLLVM-%%LLVM_MAJOR%%.so
 llvm%%LLVM_SUFFIX%%/lib/libLLVM.so
-llvm%%LLVM_SUFFIX%%/lib/libLLVM.so.18.1
+llvm%%LLVM_SUFFIX%%/lib/libLLVM.so.%%LLVM_MAJOR_MINOR%%
 %%STATIC_LIBS%%llvm%%LLVM_SUFFIX%%/lib/libLLVMAggressiveInstCombine.a
 %%STATIC_LIBS%%llvm%%LLVM_SUFFIX%%/lib/libLLVMAnalysis.a
 %%STATIC_LIBS%%llvm%%LLVM_SUFFIX%%/lib/libLLVMAsmParser.a
@@ -6301,9 +6301,9 @@ llvm%%LLVM_SUFFIX%%/lib/libLLVM.so.18.1
 %%STATIC_LIBS%%llvm%%LLVM_SUFFIX%%/lib/libLLVMXRay.a
 %%STATIC_LIBS%%llvm%%LLVM_SUFFIX%%/lib/libLLVMipo.a
 llvm%%LLVM_SUFFIX%%/lib/libLTO.so
-llvm%%LLVM_SUFFIX%%/lib/libLTO.so.18.1
+llvm%%LLVM_SUFFIX%%/lib/libLTO.so.%%LLVM_MAJOR_MINOR%%
 %%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libMLIR.so
-%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libMLIR.so.18.1
+%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libMLIR.so.%%LLVM_MAJOR_MINOR%%
 %%STATIC_LIBS%%%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libMLIRAMDGPUDialect.a
 %%STATIC_LIBS%%%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libMLIRAMDGPUToROCDL.a
 %%STATIC_LIBS%%%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libMLIRAMDGPUTransforms.a
@@ -6640,14 +6640,14 @@ llvm%%LLVM_SUFFIX%%/lib/libLTO.so.18.1
 %%STATIC_LIBS%%%%POLLY%%llvm%%LLVM_SUFFIX%%/lib/libPolly.a
 %%STATIC_LIBS%%%%POLLY%%llvm%%LLVM_SUFFIX%%/lib/libPollyISL.a
 llvm%%LLVM_SUFFIX%%/lib/libRemarks.so
-llvm%%LLVM_SUFFIX%%/lib/libRemarks.so.18.1
+llvm%%LLVM_SUFFIX%%/lib/libRemarks.so.%%LLVM_MAJOR_MINOR%%
 %%OPENMP%%llvm%%LLVM_SUFFIX%%/lib/libarcher.so
 %%STATIC_LIBS%%%%OPENMP%%llvm%%LLVM_SUFFIX%%/lib/libarcher_static.a
 %%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libclang-cpp.so
-%%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libclang-cpp.so.18.1
+%%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libclang-cpp.so.%%LLVM_MAJOR_MINOR%%
 %%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libclang.so
+%%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libclang.so.%%LLVM_MAJOR_MINOR%%
 %%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libclang.so.%%LLVM_RELEASE%%
-%%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libclang.so.18.1
 %%STATIC_LIBS%%%%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libclangAPINotes.a
 %%STATIC_LIBS%%%%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libclangARCMigrate.a
 %%STATIC_LIBS%%%%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libclangAST.a
@@ -6751,23 +6751,23 @@ llvm%%LLVM_SUFFIX%%/lib/libRemarks.so.18.1
 %%STATIC_LIBS%%%%LLD%%llvm%%LLVM_SUFFIX%%/lib/liblldMinGW.a
 %%STATIC_LIBS%%%%LLD%%llvm%%LLVM_SUFFIX%%/lib/liblldWasm.a
 %%LLDB%%llvm%%LLVM_SUFFIX%%/lib/liblldb.so
+%%LLDB%%llvm%%LLVM_SUFFIX%%/lib/liblldb.so.%%LLVM_MAJOR_MINOR%%
 %%LLDB%%llvm%%LLVM_SUFFIX%%/lib/liblldb.so.%%LLVM_RELEASE%%
-%%LLDB%%llvm%%LLVM_SUFFIX%%/lib/liblldb.so.18.1
 %%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_arm_runner_utils.so
-%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_arm_runner_utils.so.18.1
+%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_arm_runner_utils.so.%%LLVM_MAJOR_MINOR%%
 %%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_arm_sme_abi_stubs.so
-%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_arm_sme_abi_stubs.so.18.1
+%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_arm_sme_abi_stubs.so.%%LLVM_MAJOR_MINOR%%
 %%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_async_runtime.so
-%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_async_runtime.so.18.1
+%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_async_runtime.so.%%LLVM_MAJOR_MINOR%%
 %%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_c_runner_utils.so
-%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_c_runner_utils.so.18.1
+%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_c_runner_utils.so.%%LLVM_MAJOR_MINOR%%
 %%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_float16_utils.so
-%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_float16_utils.so.18.1
+%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_float16_utils.so.%%LLVM_MAJOR_MINOR%%
 %%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_runner_utils.so
-%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_runner_utils.so.18.1
+%%MLIR%%llvm%%LLVM_SUFFIX%%/lib/libmlir_runner_utils.so.%%LLVM_MAJOR_MINOR%%
 %%OPENMP%%llvm%%LLVM_SUFFIX%%/lib/libomp.so
 %%OPENMP%%llvm%%LLVM_SUFFIX%%/lib/libomptarget.so
-%%OPENMP%%llvm%%LLVM_SUFFIX%%/lib/libomptarget.so.18.1
+%%OPENMP%%llvm%%LLVM_SUFFIX%%/lib/libomptarget.so.%%LLVM_MAJOR_MINOR%%
 %%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libscanbuild/__init__.py
 %%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libscanbuild/analyze.py
 %%CLANG%%llvm%%LLVM_SUFFIX%%/lib/libscanbuild/arguments.py