git: c638dc3a4dc4 - main - devel/spirv-llvm-translator: flavorize for supported LLVM versions
Jan Beich
jbeich at FreeBSD.org
Mon Aug 9 19:48:43 UTC 2021
The branch main has been updated by jbeich:
URL: https://cgit.FreeBSD.org/ports/commit/?id=c638dc3a4dc4449127a787b549fce7cf94789ae9
commit c638dc3a4dc4449127a787b549fce7cf94789ae9
Author: Jan Beich <jbeich at FreeBSD.org>
AuthorDate: 2021-08-09 16:40:04 +0000
Commit: Jan Beich <jbeich at FreeBSD.org>
CommitDate: 2021-08-09 19:47:44 +0000
devel/spirv-llvm-translator: flavorize for supported LLVM versions
Allow co-installation by moving under PREFIX/llvm*
---
devel/opencl-clang/Makefile | 5 ++-
devel/spirv-llvm-translator/Makefile | 39 +++++++++++++++++++---
devel/spirv-llvm-translator/distinfo.llvm10 | 3 ++
.../{distinfo => distinfo.llvm11} | 0
devel/spirv-llvm-translator/distinfo.llvm12 | 3 ++
devel/spirv-llvm-translator/distinfo.llvm70 | 3 ++
devel/spirv-llvm-translator/distinfo.llvm80 | 3 ++
devel/spirv-llvm-translator/distinfo.llvm90 | 3 ++
8 files changed, 51 insertions(+), 8 deletions(-)
diff --git a/devel/opencl-clang/Makefile b/devel/opencl-clang/Makefile
index 85d81b6eccc2..f4978c6c162b 100644
--- a/devel/opencl-clang/Makefile
+++ b/devel/opencl-clang/Makefile
@@ -1,6 +1,7 @@
PORTNAME= opencl-clang
DISTVERSIONPREFIX= v
DISTVERSION= 11.0.0
+PORTREVISION= 1
CATEGORIES= devel
MAINTAINER= jbeich at FreeBSD.org
@@ -10,14 +11,12 @@ LICENSE= NCSA
LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libLLVM-${DISTVERSION:R:R}.so:devel/llvm${DISTVERSION:R:R} \
- libLLVMSPIRVLib.so.${DISTVERSION:R:R}:devel/spirv-llvm-translator
+ libLLVMSPIRVLib.so.${DISTVERSION:R:R}:devel/spirv-llvm-translator at llvm${DISTVERSION:R:R}
USES= cmake compiler:c++11-lib
USE_GITHUB= yes
USE_LDCONFIG= yes
GH_ACCOUNT= intel
-CMAKE_OFF= LLVMSPIRV_INCLUDED_IN_LLVM
-CMAKE_ARGS= -DSPIRV_TRANSLATOR_DIR:PATH="${LOCALBASE}"
PLIST_FILES= include/cclang/common_clang.h \
lib/libopencl-clang.so \
lib/libopencl-clang.so.${DISTVERSION:R:R}
diff --git a/devel/spirv-llvm-translator/Makefile b/devel/spirv-llvm-translator/Makefile
index 9dfb30aa7abc..83f1af0658a8 100644
--- a/devel/spirv-llvm-translator/Makefile
+++ b/devel/spirv-llvm-translator/Makefile
@@ -1,8 +1,14 @@
PORTNAME= spirv-llvm-translator
DISTVERSIONPREFIX= v
-DISTVERSION= 11.0.0
-PORTREVISION= 1
+DISTVERSION= ${DISTVERSION_${FLAVOR}}
+DISTVERSION_llvm12= 12.0.0
+DISTVERSION_llvm11= 11.0.0
+DISTVERSION_llvm10= 10.0.0
+DISTVERSION_llvm90= 9.0.1-1
+DISTVERSION_llvm80= 8.0.1-3
+DISTVERSION_llvm70= 7.0.1-1
CATEGORIES= devel
+PKGNAMESUFFIX= -${FLAVOR}
MAINTAINER= jbeich at FreeBSD.org
COMMENT= Bi-directional translation between SPIR-V and LLVM IR
@@ -10,25 +16,48 @@ COMMENT= Bi-directional translation between SPIR-V and LLVM IR
LICENSE= NCSA
LICENSE_FILE= ${WRKSRC}/LICENSE.TXT
-LIB_DEPENDS= libLLVM-${DISTVERSION:R:R}.so:devel/llvm${DISTVERSION:R:R}
+LIB_DEPENDS= libLLVM-${DISTVERSION:R:R}.so:devel/${FLAVOR}
+
+FLAVORS= ${12 11 10 90 80 70:L:S/^/llvm/}
USES= cmake compiler:c++11-lib
USE_GITHUB= yes
-USE_LDCONFIG= yes
+USE_LDCONFIG= ${PREFIX}/${FLAVOR}/lib
GH_ACCOUNT= KhronosGroup
GH_PROJECT= SPIRV-LLVM-Translator
+DISTINFO_FILE= ${.CURDIR}/distinfo.${FLAVOR}
CMAKE_ON= BUILD_SHARED_LIBS LLVM_BUILD_TOOLS
-PLIST_FILES= bin/llvm-spirv \
+CMAKE_ARGS= -DLLVM_DIR:PATH="${LOCALBASE}/${FLAVOR}"
+CMAKE_INSTALL_PREFIX= ${PREFIX}/${FLAVOR}
+_PLIST_FILES= bin/llvm-spirv \
include/LLVMSPIRVLib/LLVMSPIRVExtensions.inc \
include/LLVMSPIRVLib/LLVMSPIRVLib.h \
include/LLVMSPIRVLib/LLVMSPIRVOpts.h \
lib/libLLVMSPIRVLib.so \
lib/libLLVMSPIRVLib.so.${DISTVERSION:R:R} \
libdata/pkgconfig/LLVMSPIRVLib.pc
+.if ${FLAVOR:U:Mllvm[78]0}
+_PLIST_FILES:= ${_PLIST_FILES:N*Extensions*}
+.endif
+.if ${FLAVOR:U:Mllvm70}
+_PLIST_FILES:= ${_PLIST_FILES:N*Opts*}
+.endif
+PLIST_FILES= ${_PLIST_FILES:S,^,${FLAVOR}/,}
.if exists(/usr/bin/ld.lld) && ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld
# undefined reference to `llvm::cfg::Update<llvm::BasicBlock*>::dump() const'
LDFLAGS+= -fuse-ld=lld
.endif
+post-patch:
+ @${REINPLACE_CMD} -e '/pkgconfig/s/lib/&data/' \
+ ${WRKSRC}/CMakeLists.txt
+
+.if !defined(DEFAULT_MAKESUM)
+makesum:
+. for f in ${FLAVORS}
+ ${MAKE} -C${.CURDIR} FLAVOR=$f DEFAULT_MAKESUM=1 ${.TARGET}
+. endfor
+.endif
+
.include <bsd.port.mk>
diff --git a/devel/spirv-llvm-translator/distinfo.llvm10 b/devel/spirv-llvm-translator/distinfo.llvm10
new file mode 100644
index 000000000000..5e2bc85ac55a
--- /dev/null
+++ b/devel/spirv-llvm-translator/distinfo.llvm10
@@ -0,0 +1,3 @@
+TIMESTAMP = 1584733962
+SHA256 (KhronosGroup-SPIRV-LLVM-Translator-v10.0.0_GH0.tar.gz) = 7ccde52bac4c9ad967a362a3c5ec7261aa5b7b34d28cef0f3dec38d77c923049
+SIZE (KhronosGroup-SPIRV-LLVM-Translator-v10.0.0_GH0.tar.gz) = 535828
diff --git a/devel/spirv-llvm-translator/distinfo b/devel/spirv-llvm-translator/distinfo.llvm11
similarity index 100%
rename from devel/spirv-llvm-translator/distinfo
rename to devel/spirv-llvm-translator/distinfo.llvm11
diff --git a/devel/spirv-llvm-translator/distinfo.llvm12 b/devel/spirv-llvm-translator/distinfo.llvm12
new file mode 100644
index 000000000000..67e0b51d5d2a
--- /dev/null
+++ b/devel/spirv-llvm-translator/distinfo.llvm12
@@ -0,0 +1,3 @@
+TIMESTAMP = 1620982143
+SHA256 (KhronosGroup-SPIRV-LLVM-Translator-v12.0.0_GH0.tar.gz) = 6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+SIZE (KhronosGroup-SPIRV-LLVM-Translator-v12.0.0_GH0.tar.gz) = 1378222
diff --git a/devel/spirv-llvm-translator/distinfo.llvm70 b/devel/spirv-llvm-translator/distinfo.llvm70
new file mode 100644
index 000000000000..191a093eeaff
--- /dev/null
+++ b/devel/spirv-llvm-translator/distinfo.llvm70
@@ -0,0 +1,3 @@
+TIMESTAMP = 1545672929
+SHA256 (KhronosGroup-SPIRV-LLVM-Translator-v7.0.1-1_GH0.tar.gz) = 8595a964aee35baa73ff1d41eeec08e582f1ac82e63ec261f8900154a39d9f17
+SIZE (KhronosGroup-SPIRV-LLVM-Translator-v7.0.1-1_GH0.tar.gz) = 428932
diff --git a/devel/spirv-llvm-translator/distinfo.llvm80 b/devel/spirv-llvm-translator/distinfo.llvm80
new file mode 100644
index 000000000000..6d6e67859946
--- /dev/null
+++ b/devel/spirv-llvm-translator/distinfo.llvm80
@@ -0,0 +1,3 @@
+TIMESTAMP = 1581002385
+SHA256 (KhronosGroup-SPIRV-LLVM-Translator-v8.0.1-3_GH0.tar.gz) = ec56af9734788d1d83f1bef15be288bec2aa74861c539ee07e80b9f49a92cddd
+SIZE (KhronosGroup-SPIRV-LLVM-Translator-v8.0.1-3_GH0.tar.gz) = 472853
diff --git a/devel/spirv-llvm-translator/distinfo.llvm90 b/devel/spirv-llvm-translator/distinfo.llvm90
new file mode 100644
index 000000000000..5bc411d4dcc7
--- /dev/null
+++ b/devel/spirv-llvm-translator/distinfo.llvm90
@@ -0,0 +1,3 @@
+TIMESTAMP = 1581002360
+SHA256 (KhronosGroup-SPIRV-LLVM-Translator-v9.0.1-1_GH0.tar.gz) = 44b3c4fdb640ac9b1072784f8c0e2e126ccc46a1c170c5f0a1a384c2942d9de6
+SIZE (KhronosGroup-SPIRV-LLVM-Translator-v9.0.1-1_GH0.tar.gz) = 498803
More information about the dev-commits-ports-all
mailing list