summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conikost@gentoo.org>2023-05-04 23:47:56 +0200
committerConrad Kostecki <conikost@gentoo.org>2023-05-04 23:47:56 +0200
commitd587eef9baa0bff2161ea2aae5b5b122f85c8a1e (patch)
treeca5d1513443b2309288dc701987fb71adef7066e /dev-libs/opencl-clang
parentapp-misc/logiops: add 0.3.1 (diff)
downloadgentoo-d587eef9baa0bff2161ea2aae5b5b122f85c8a1e.tar.gz
gentoo-d587eef9baa0bff2161ea2aae5b5b122f85c8a1e.tar.bz2
gentoo-d587eef9baa0bff2161ea2aae5b5b122f85c8a1e.zip
dev-libs/opencl-clang: add 16.0.0
Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'dev-libs/opencl-clang')
-rw-r--r--dev-libs/opencl-clang/Manifest1
-rw-r--r--dev-libs/opencl-clang/files/opencl-clang-16.0.0-clang_library_dir.patch36
-rw-r--r--dev-libs/opencl-clang/files/opencl-clang-16.0.0-cxx17.patch23
-rw-r--r--dev-libs/opencl-clang/files/opencl-clang-16.0.0-llvm.patch40
-rw-r--r--dev-libs/opencl-clang/files/opencl-clang-16.0.0-standalone-build.patch26
-rw-r--r--dev-libs/opencl-clang/opencl-clang-16.0.0.ebuild42
6 files changed, 168 insertions, 0 deletions
diff --git a/dev-libs/opencl-clang/Manifest b/dev-libs/opencl-clang/Manifest
index 4f4bdc9262d1..adacd90a7844 100644
--- a/dev-libs/opencl-clang/Manifest
+++ b/dev-libs/opencl-clang/Manifest
@@ -1,2 +1,3 @@
DIST opencl-clang-14.0.0.tar.gz 26109 BLAKE2B 2ae5e6d69e2f13b867712d03b52fce893aeb70566f7f97d54858639786276f49b0b6b5768aebfedeb7fe50d95511178d7dd9df7e80d3fd27df1fb3fe1d2ab955 SHA512 ab9a3fd40542283bdd2646d9ef8d3217420c82a41b183d705e48f48949505ecadc1fa435e23a7ceadf5a335200f5f3752b42715e2ac7f63173fc09637c5c609a
DIST opencl-clang-15.0.0.tar.gz 26212 BLAKE2B 02d3a8eb3964b6882bd94b676b4459412c753ac38e1e3012662021e98a8219225eaf6af4f62f4e0e97de428f55b0b698374dc39babff09a0fcc73213d5daacfe SHA512 a2ffce43493793524e9512be2e7bd46c0183b86b35a6f79018d355d07a83303a944e6dacebfb768e88ce75a7020a44939be872a2d4e754544198a9829f4febd4
+DIST opencl-clang-16.0.0.tar.gz 28413 BLAKE2B c99f043171186f5d9e44618d5d637d6a5c7997f22577491f544e78d93edd5afe74ba88eaaea92a931dd87af71fb630fdf03d27f1a9f55d7c3b8bdf53dee54b07 SHA512 bf723edab7dc7a028eb79d01fd2306690a2169472760bf2783d593ffec4eb788f28f184c66b204cc074cb95a4149fcc63a1dcbee5563c620a9dc2c76bb5a2d5a
diff --git a/dev-libs/opencl-clang/files/opencl-clang-16.0.0-clang_library_dir.patch b/dev-libs/opencl-clang/files/opencl-clang-16.0.0-clang_library_dir.patch
new file mode 100644
index 000000000000..227a7be30b50
--- /dev/null
+++ b/dev-libs/opencl-clang/files/opencl-clang-16.0.0-clang_library_dir.patch
@@ -0,0 +1,36 @@
+From 9f50367661bb6345bf7b18102f1e415378afda06 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <Zatloukal.Frantisek@gmail.com>
+Date: Fri, 21 Apr 2023 04:08:11 +0200
+Subject: [PATCH] Support llvm headers in
+ ${CLANG_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}/ (#419)
+
+Fedora places llvm include files into that directory instead of assumed
+${CLANG_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/
+
+Try both, fail horribly when none of them exist
+---
+ cl_headers/CMakeLists.txt | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt
+index 86df76f..0223d52 100644
+--- a/cl_headers/CMakeLists.txt
++++ b/cl_headers/CMakeLists.txt
+@@ -19,8 +19,15 @@ add_custom_command(
+ endfunction(copy_file)
+
+ if(USE_PREBUILT_LLVM)
+- set(OPENCL_HEADERS_DIR
+- "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/")
++ if(EXISTS "${CLANG_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/")
++ set(OPENCL_HEADERS_DIR
++ "${CLANG_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/")
++ elseif(EXISTS "${CLANG_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}/")
++ set(OPENCL_HEADERS_DIR
++ "${CLANG_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}/include/")
++ else()
++ message(FATAL_ERROR "[OPENCL-CLANG] Couldn't find prebuilt LLVM include directory.")
++ endif()
+ else(USE_PREBUILT_LLVM)
+ set(OPENCL_HEADERS_DIR "${CLANG_SOURCE_DIR}/lib/Headers")
+ endif(USE_PREBUILT_LLVM)
diff --git a/dev-libs/opencl-clang/files/opencl-clang-16.0.0-cxx17.patch b/dev-libs/opencl-clang/files/opencl-clang-16.0.0-cxx17.patch
new file mode 100644
index 000000000000..aa6c308630e8
--- /dev/null
+++ b/dev-libs/opencl-clang/files/opencl-clang-16.0.0-cxx17.patch
@@ -0,0 +1,23 @@
+From 5491ffa3fde5729074fe804023bd279c56684f77 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <Zatloukal.Frantisek@gmail.com>
+Date: Mon, 24 Apr 2023 10:29:36 +0200
+Subject: [PATCH] Bump CMAKE_CXX_STANDARD to 17 (#416)
+
+Fixes build issues
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index dc471d8..a7d1927 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -58,7 +58,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ ${CMAKE_MODULE_PATH}
+ ${LLVM_CMAKE_DIR})
+
+- set(CMAKE_CXX_STANDARD 14)
++ set(CMAKE_CXX_STANDARD 17)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+ option(LLVMSPIRV_INCLUDED_IN_LLVM
diff --git a/dev-libs/opencl-clang/files/opencl-clang-16.0.0-llvm.patch b/dev-libs/opencl-clang/files/opencl-clang-16.0.0-llvm.patch
new file mode 100644
index 000000000000..67759595b353
--- /dev/null
+++ b/dev-libs/opencl-clang/files/opencl-clang-16.0.0-llvm.patch
@@ -0,0 +1,40 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -335,36 +335,7 @@
+ target_link_libraries( ${TARGET_NAME}
+ LINK_PRIVATE
+ ${OPENCL_CLANG_LINK_LIBS}
+- LLVMX86CodeGen
+- LLVMX86AsmParser
+- LLVMX86Desc
+- LLVMX86Info
+- LLVMX86Disassembler
+- LLVMAnalysis
+- LLVMCodeGen
+- LLVMCore
+- LLVMipo
+- LLVMInstCombine
+- LLVMInstrumentation
+- LLVMMC
+- LLVMMCParser
+- LLVMObjCARCOpts
+- LLVMOption
+- LLVMScalarOpts
+- LLVMSupport
+- LLVMTransformUtils
+- LLVMVectorize
+- LLVMAsmPrinter
+- LLVMSelectionDAG
+- LLVMMCDisassembler
+- LLVMProfileData
+- LLVMObject
+- LLVMBitWriter
+- LLVMIRReader
+- LLVMAsmParser
+- LLVMTarget
+- LLVMBitReader
+- ${OTHER_LIBRARIES}
++ LLVM
+ )
+
+ install(FILES opencl_clang.h
diff --git a/dev-libs/opencl-clang/files/opencl-clang-16.0.0-standalone-build.patch b/dev-libs/opencl-clang/files/opencl-clang-16.0.0-standalone-build.patch
new file mode 100644
index 000000000000..a85ec58df401
--- /dev/null
+++ b/dev-libs/opencl-clang/files/opencl-clang-16.0.0-standalone-build.patch
@@ -0,0 +1,26 @@
+From 529a9188114bcbd8ed753d2276942384fa50d7a1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <Zatloukal.Frantisek@gmail.com>
+Date: Fri, 21 Apr 2023 04:07:21 +0200
+Subject: [PATCH] Fix standalone build (#415)
+
+Fixes https://github.com/intel/opencl-clang/issues/406
+Fixes https://github.com/intel/opencl-clang/issues/374
+---
+ cl_headers/CMakeLists.txt | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt
+index 788adff..86df76f 100644
+--- a/cl_headers/CMakeLists.txt
++++ b/cl_headers/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ set(CL_HEADERS_LIB cl_headers)
+-set(CLANG_COMMAND $<TARGET_FILE:clang> )
++if(USE_PREBUILT_LLVM)
++ find_program(CLANG_COMMAND clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
++else()
++ set(CLANG_COMMAND $<TARGET_FILE:clang>)
++endif()
+ if(LLVM_USE_HOST_TOOLS AND NOT OPENCL_CLANG_BUILD_EXTERNAL)
+ build_native_tool(clang CLANG_COMMAND)
+ endif()
diff --git a/dev-libs/opencl-clang/opencl-clang-16.0.0.ebuild b/dev-libs/opencl-clang/opencl-clang-16.0.0.ebuild
new file mode 100644
index 000000000000..b902e1ab200f
--- /dev/null
+++ b/dev-libs/opencl-clang/opencl-clang-16.0.0.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_MAX_SLOT="16"
+
+inherit cmake llvm
+
+DESCRIPTION="OpenCL-oriented thin wrapper library around clang"
+HOMEPAGE="https://github.com/intel/opencl-clang"
+SRC_URI="https://github.com/intel/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${PV}"
+
+LICENSE="UoI-NCSA"
+SLOT="$(ver_cut 1)"
+KEYWORDS="~amd64"
+
+RDEPEND="
+ dev-util/spirv-llvm-translator:${SLOT}=
+ sys-devel/clang:${SLOT}=[static-analyzer]
+ sys-devel/llvm:${SLOT}=
+"
+
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-16.0.0-clang_library_dir.patch
+ "${FILESDIR}"/${PN}-16.0.0-cxx17.patch
+ "${FILESDIR}"/${PN}-16.0.0-llvm.patch
+ "${FILESDIR}"/${PN}-16.0.0-standalone-build.patch
+)
+
+src_configure() {
+ local mycmakeargs=(
+ -DCLANG_LIBRARY_DIRS="${EPREFIX}"/usr/lib
+ -DCMAKE_INSTALL_PREFIX="$(get_llvm_prefix ${LLVM_MAX_SLOT})"
+ -Wno-dev
+ )
+
+ cmake_src_configure
+}