summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/rocm-opencl-driver')
-rw-r--r--dev-libs/rocm-opencl-driver/Manifest1
-rw-r--r--dev-libs/rocm-opencl-driver/files/rocm-opencl-driver-2.6.0-install-correctly.patch49
-rw-r--r--dev-libs/rocm-opencl-driver/files/rocm-opencl-driver-2.6.0-install-header.patch19
-rw-r--r--dev-libs/rocm-opencl-driver/metadata.xml14
-rw-r--r--dev-libs/rocm-opencl-driver/rocm-opencl-driver-2.6.0.ebuild46
5 files changed, 129 insertions, 0 deletions
diff --git a/dev-libs/rocm-opencl-driver/Manifest b/dev-libs/rocm-opencl-driver/Manifest
new file mode 100644
index 000000000000..825e4bf6fabf
--- /dev/null
+++ b/dev-libs/rocm-opencl-driver/Manifest
@@ -0,0 +1 @@
+DIST rocm-opencl-driver-2.6.0.tar.gz 21311 BLAKE2B f17219b577ccd58de052d5936953fd78588a0b042ce002853b10c05e6f6d433edcd90045c15dcd2f2c31ccef89f8b420ef756a1dd1613702efcc8868163878d1 SHA512 7b8bf646d9a36b09d75a0408301c2f1771daad95b8075b1671ca0c8b1f5826e8cd9de8935946858268dc89863a0ee054b4dde3040c84dd37e90f28c7ffa6e097
diff --git a/dev-libs/rocm-opencl-driver/files/rocm-opencl-driver-2.6.0-install-correctly.patch b/dev-libs/rocm-opencl-driver/files/rocm-opencl-driver-2.6.0-install-correctly.patch
new file mode 100644
index 000000000000..d70f0977ec8f
--- /dev/null
+++ b/dev-libs/rocm-opencl-driver/files/rocm-opencl-driver-2.6.0-install-correctly.patch
@@ -0,0 +1,49 @@
+https://github.com/RadeonOpenCompute/ROCm-OpenCL-Driver/pull/85
+
+From 8819a684c9b6e154abedc041b3da545aab353d67 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Fri, 26 Jul 2019 15:54:59 -0400
+Subject: [PATCH] Use GNUInstallDirs to install to standard locations
+
+Some distributions require 64 bit libraries to be installed to lib64, for example.
+Using GNUInstallDirs ensures that files are installed to the expected locations.
+---
+ CMakeLists.txt | 3 +++
+ src/driver/CMakeLists.txt | 2 +-
+ src/roc-cl/CMakeLists.txt | 2 +-
+ 3 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d1759b7..d21e9da 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -42,6 +42,9 @@
+
+ cmake_minimum_required(VERSION 2.8)
+
++## Include common cmake modules
++include ( GNUInstallDirs )
++
+ # Build ROCm-OpenCL-Driver with ccache if the package is present.
+ set(ROCM_OPENCL_DRIVER_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
+ if(ROCM_OPENCL_DRIVER_CCACHE_BUILD)
+diff --git a/src/driver/CMakeLists.txt b/src/driver/CMakeLists.txt
+index 7046e34..55ed13f 100644
+--- a/src/driver/CMakeLists.txt
++++ b/src/driver/CMakeLists.txt
+@@ -90,4 +90,4 @@ target_link_libraries(opencl_driver
+ target_link_libraries(opencl_driver ${llvm_libs})
+ target_include_directories(opencl_driver PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
+-install(TARGETS opencl_driver DESTINATION lib)
++install(TARGETS opencl_driver DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+diff --git a/src/roc-cl/CMakeLists.txt b/src/roc-cl/CMakeLists.txt
+index 5037453..a8e2801 100644
+--- a/src/roc-cl/CMakeLists.txt
++++ b/src/roc-cl/CMakeLists.txt
+@@ -54,4 +54,4 @@ link_directories(${LLVM_LIBRARY_DIRS})
+ add_executable(roc-cl ${sources})
+ target_link_libraries(roc-cl opencl_driver)
+
+-install(TARGETS roc-cl RUNTIME DESTINATION bin)
++install(TARGETS roc-cl RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
diff --git a/dev-libs/rocm-opencl-driver/files/rocm-opencl-driver-2.6.0-install-header.patch b/dev-libs/rocm-opencl-driver/files/rocm-opencl-driver-2.6.0-install-header.patch
new file mode 100644
index 000000000000..b37100994e04
--- /dev/null
+++ b/dev-libs/rocm-opencl-driver/files/rocm-opencl-driver-2.6.0-install-header.patch
@@ -0,0 +1,19 @@
+From 1258a99decf96092de8ea512150209e14152ed9c Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Tue, 30 Jul 2019 16:46:20 -0400
+Subject: [PATCH] Install AmdCompiler.h header
+
+ROCm-OpenCL-Runtime uses AmdCompiler.h so it should be installed to the system and made available for use
+---
+ src/driver/CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/driver/CMakeLists.txt b/src/driver/CMakeLists.txt
+index 55ed13f..8f68fb7 100644
+--- a/src/driver/CMakeLists.txt
++++ b/src/driver/CMakeLists.txt
+@@ -91,3 +91,4 @@ target_link_libraries(opencl_driver ${llvm_libs})
+ target_include_directories(opencl_driver PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
+ install(TARGETS opencl_driver DESTINATION ${CMAKE_INSTALL_LIBDIR} )
++install(FILES AmdCompiler.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
diff --git a/dev-libs/rocm-opencl-driver/metadata.xml b/dev-libs/rocm-opencl-driver/metadata.xml
new file mode 100644
index 000000000000..359755b2e5a5
--- /dev/null
+++ b/dev-libs/rocm-opencl-driver/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>candrews@gentoo.org</email>
+ <name>Craig Andrews</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">RadeonOpenCompute/ROCm-OpenCL-Runtime</remote-id>
+ </upstream>
+ <longdescription lang="en">
+ Radeon Open Compute OpenCL Compatible Runtime
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-libs/rocm-opencl-driver/rocm-opencl-driver-2.6.0.ebuild b/dev-libs/rocm-opencl-driver/rocm-opencl-driver-2.6.0.ebuild
new file mode 100644
index 000000000000..6ab3d1073d10
--- /dev/null
+++ b/dev-libs/rocm-opencl-driver/rocm-opencl-driver-2.6.0.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Driver/"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Driver/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCm-OpenCL-Driver-roc-${PV}"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Radeon Open Compute OpenCL Compiler Tool Driver"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Driver"
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+IUSE="test"
+
+RDEPEND="sys-devel/llvm-roc:=
+ dev-libs/rocr-runtime"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-install-correctly.patch"
+ "${FILESDIR}/${P}-install-header.patch"
+)
+
+src_prepare() {
+ # remove unittest, because it downloads additional file from github.com
+ sed -e "s:add_subdirectory(src/unittest):#add_subdirectory(src/unittest):" -i CMakeLists.txt || die
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/"
+ )
+ cmake-utils_src_configure
+}