PORTNAME= spirv-llvm-translator DISTVERSIONPREFIX= v DISTVERSION= ${DISTVERSION_${FLAVOR}} DISTVERSION_llvm19= 19.1.2 DISTVERSION_llvm18= 18.1.7 DISTVERSION_llvm17= 17.0.7 DISTVERSION_llvm16= 16.0.7 DISTVERSION_llvm15= 15.0.7 DISTVERSION_llvm14= 14.0.7 DISTVERSION_llvm13= 13.0.1 DISTVERSION_llvm12= 12.0.1 DISTVERSION_llvm11= 11.0.1 CATEGORIES= devel PKGNAMESUFFIX= -${FLAVOR} MAINTAINER= jbeich@FreeBSD.org COMMENT= Bi-directional translation between SPIR-V and LLVM IR WWW= https://github.com/KhronosGroup/SPIRV-LLVM-Translator LICENSE= NCSA LICENSE_FILE= ${WRKSRC}/LICENSE.TXT LIB_DEPENDS= libLLVM-${FLAVOR:S/llvm//}.so:devel/${FLAVOR} FLAVORS= ${19 18 17 16 15 14 13 12 11:L:S/^/llvm/} CONFLICTS_BUILD=${FLAVOR}-lite USES= cmake compiler:c++11-lib USE_GITHUB= yes USE_LDCONFIG= ${PREFIX}/${FLAVOR}/lib GH_ACCOUNT= KhronosGroup GH_PROJECT= SPIRV-LLVM-Translator .if !defined(FLAVOR) || ${FLAVOR} == llvm19 # https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2415#issuecomment-2358890668 GH_TUPLE= KhronosGroup:SPIRV-Headers:1.5.4.raytracing.fixed-350-gb73e168:headers/projects/SPIRV-Headers .else GH_TUPLE= ${${FLAVOR:S/llvm//}<13:?:KhronosGroup:SPIRV-Headers:1.5.4.raytracing.fixed-332-g1c6bb27:headers/projects/SPIRV-Headers} .endif DISTINFO_FILE= ${.CURDIR}/distinfo.${FLAVOR} CXXFLAGS+= ${${FLAVOR:S/llvm//} < 16 && ${COMPILER_TYPE} == clang:?-Wno-enum-constexpr-conversion:} CMAKE_ON= BUILD_SHARED_LIBS LLVM_BUILD_TOOLS LLVM_TOOL_SPIRV_HEADERS_BUILD CMAKE_ARGS= -DLLVM_DIR:PATH="${LOCALBASE}/${FLAVOR}" CMAKE_ARGS+= ${${FLAVOR:S/llvm//}==11:?-DBASE_LLVM_VERSION=11.0:} 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.${SOVERSION} \ libdata/pkgconfig/LLVMSPIRVLib.pc PLIST_FILES= ${_PLIST_FILES:S,^,${FLAVOR}/,} SOVERSION= ${${FLAVOR:S/llvm//}<18:?${DISTVERSION:R:R}:${DISTVERSION:R}} 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