git: 845dc5c968bf - main - graphics/openshadinglanguage: unbreak build with llvm14 (+)

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Sat, 28 May 2022 12:53:50 UTC
The branch main has been updated by fluffy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=845dc5c968bf59fc1625ca1cc9c178d2094d877c

commit 845dc5c968bf59fc1625ca1cc9c178d2094d877c
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2022-05-28 12:51:29 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2022-05-28 12:51:29 +0000

    graphics/openshadinglanguage: unbreak build with llvm14 (+)
    
    LLVM14 bundle have moved TargetRegistry.h from Support to MC subdir
    
    Obtained from:  upstream
    Approved by:    portmgr blanket
---
 graphics/openshadinglanguage/files/patch-llvm14 | 29 +++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/graphics/openshadinglanguage/files/patch-llvm14 b/graphics/openshadinglanguage/files/patch-llvm14
new file mode 100644
index 000000000000..c8912440145a
--- /dev/null
+++ b/graphics/openshadinglanguage/files/patch-llvm14
@@ -0,0 +1,29 @@
+diff --git src/build-scripts/build_llvm.bash src/build-scripts/build_llvm.bash
+index 2e8f49fca..3b375e543 100755
+--- src/build-scripts/build_llvm.bash
++++ src/build-scripts/build_llvm.bash
+@@ -29,7 +29,7 @@ if [[ `uname` == "Linux" ]] ; then
+     fi
+     LLVMTAR=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-${LLVM_DISTRO_NAME}.tar.xz
+     echo LLVMTAR = $LLVMTAR
+-    if [[ "$LLVM_VERSION" == "10.0.0" ]] || [[ "$LLVM_VERSION" == "11.0.0" ]] || [[ "$LLVM_VERSION" == "11.1.0" ]] || [[ "$LLVM_VERSION" == "12.0.0" ]] ; then
++    if [[ "$LLVM_VERSION" == "10.0.0" ]] || [[ "$LLVM_VERSION" == "11.0.0" ]] || [[ "$LLVM_VERSION" == "11.1.0" ]] || [[ "$LLVM_VERSION" == "12.0.0" ]] || [[ "$LLVM_VERSION" == "13.0.0" ]]  || [[ "$LLVM_VERSION" == "14.0.0" ]]  || [[ "$LLVM_VERSION" == "14.0.1" ]] ; then
+         # new
+         curl --location https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
+     else
+diff --git src/liboslexec/llvm_util.cpp src/liboslexec/llvm_util.cpp
+index b30c89318..22d4134ba 100644
+--- src/liboslexec/llvm_util.cpp
++++ src/liboslexec/llvm_util.cpp
+@@ -45,7 +45,11 @@
+ #include <llvm/Support/raw_os_ostream.h>
+ #include <llvm/IR/LegacyPassManager.h>
+ #include <llvm/IR/ValueSymbolTable.h>
++#if OSL_LLVM_VERSION < 140
+ #include <llvm/Support/TargetRegistry.h>
++#else
++#include <llvm/MC/TargetRegistry.h>
++#endif
+ 
+ #include <llvm/Bitcode/BitcodeReader.h>
+ #include <llvm/Bitcode/BitcodeWriter.h>