summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRepository mirror & CI <repomirrorci@gentoo.org>2019-08-07 17:47:19 +0000
committerRepository mirror & CI <repomirrorci@gentoo.org>2019-08-07 17:47:19 +0000
commit85cf8ced20bd67eb1c577bd4ad33b780c7a32d19 (patch)
tree985675bbcfbe531487a56e225750795f9bb27baa
parent2019-08-07 17:07:33 UTC (diff)
parentdev-libs/rocm-comgr: Radeon Open Compute Code Object Manager (diff)
downloadgentoo-85cf8ced20bd67eb1c577bd4ad33b780c7a32d19.tar.gz
gentoo-85cf8ced20bd67eb1c577bd4ad33b780c7a32d19.tar.bz2
gentoo-85cf8ced20bd67eb1c577bd4ad33b780c7a32d19.zip
Merge updates from master
-rw-r--r--dev-libs/rocm-comgr/Manifest1
-rw-r--r--dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-correctly-install.patch44
-rw-r--r--dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-dependencies.patch38
-rw-r--r--dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-clang.patch26
-rw-r--r--dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-lld-includes.patch43
-rw-r--r--dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-unbundle-yaml-cpp.patch30
-rw-r--r--dev-libs/rocm-comgr/metadata.xml14
-rw-r--r--dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild46
-rw-r--r--dev-libs/rocm-device-libs/Manifest1
-rw-r--r--dev-libs/rocm-device-libs/metadata.xml14
-rw-r--r--dev-libs/rocm-device-libs/rocm-device-libs-2.6.0.ebuild34
-rw-r--r--dev-libs/rocm-device-libs/rocm-device-libs-9999.ebuild34
-rw-r--r--dev-libs/rocm-hostcall/Manifest1
-rw-r--r--dev-libs/rocm-hostcall/files/rocm-hostcall-2.7.0-install-correctly.patch39
-rw-r--r--dev-libs/rocm-hostcall/metadata.xml14
-rw-r--r--dev-libs/rocm-hostcall/rocm-hostcall-2.7.0.ebuild34
-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
-rw-r--r--dev-libs/rocr-runtime/Manifest1
-rw-r--r--dev-libs/rocr-runtime/rocr-runtime-2.6.0.ebuild34
-rw-r--r--dev-libs/rocr-runtime/rocr-runtime-9999.ebuild31
-rw-r--r--dev-libs/roct-thunk-interface/Manifest1
-rw-r--r--dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-correctly-install-pc.patch25
-rw-r--r--dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-correctly-install.patch25
-rw-r--r--dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-pc-prefix.patch22
-rw-r--r--dev-libs/roct-thunk-interface/roct-thunk-interface-2.6.0.ebuild41
-rw-r--r--dev-libs/roct-thunk-interface/roct-thunk-interface-9999.ebuild42
-rw-r--r--dev-util/rocm-cmake/Manifest1
-rw-r--r--dev-util/rocm-cmake/metadata.xml14
-rw-r--r--dev-util/rocm-cmake/rocm-cmake-0.2.ebuild25
-rw-r--r--dev-util/rocm-cmake/rocm-cmake-9999.ebuild25
-rw-r--r--dev-util/rocminfo/Manifest1
-rw-r--r--dev-util/rocminfo/files/rocminfo-2.6.0-cmake-variables.patch31
-rw-r--r--dev-util/rocminfo/metadata.xml14
-rw-r--r--dev-util/rocminfo/rocminfo-2.6.0.ebuild36
-rw-r--r--media-libs/mesa/Manifest1
-rw-r--r--media-libs/mesa/mesa-19.1.4.ebuild540
-rw-r--r--sys-devel/llvm-roc/Manifest3
-rw-r--r--sys-devel/llvm-roc/llvm-roc-2.6.0.ebuild39
-rw-r--r--sys-devel/llvm-roc/metadata.xml14
43 files changed, 1508 insertions, 0 deletions
diff --git a/dev-libs/rocm-comgr/Manifest b/dev-libs/rocm-comgr/Manifest
new file mode 100644
index 000000000000..8e7150e7fd21
--- /dev/null
+++ b/dev-libs/rocm-comgr/Manifest
@@ -0,0 +1 @@
+DIST rocm-comgr-2.6.0.tar.gz 1484343 BLAKE2B fcb496b4997d672640e3f75622e74085eeb9dfe83c88ae025530389d3cdca7628155168060e71f7a3ff915e933ffe70c7026720dc124d128d16ef4df397525e7 SHA512 b14e90603d2b6e17f6b0335ea35da2e5d7e31710f301d7a7f7751a45d996e3dbbfbf84a03e2e911e8798e72e77b87b5cd88317e897cb4de3ee5cf0e7c3222d68
diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-correctly-install.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-correctly-install.patch
new file mode 100644
index 000000000000..74206760f39a
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-correctly-install.patch
@@ -0,0 +1,44 @@
+From 98f589636729b1e25625db6880fbd7820dcf9e40 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Wed, 31 Jul 2019 10:04:11 -0400
+Subject: [PATCH] Install to standard locations using GNUInstallDirs
+
+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 | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 454b830..a89af16 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,5 +1,7 @@
+ cmake_minimum_required(VERSION 3.2.0)
+
++include (GNUInstallDirs)
++
+ # Build ROCM-Compiler-Support with ccache if the package is present.
+ set(ROCM_COMPILER_SUPPORT_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
+ if(ROCM_COMPILER_SUPPORT_CCACHE_BUILD)
+@@ -146,17 +148,17 @@ configure_file("cmake/${AMD_COMGR_CONFIG_NAME}.in"
+
+ install(TARGETS amd_comgr
+ EXPORT amd_comgr_export
+- DESTINATION lib)
++ DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ install(FILES
+ "include/amd_comgr.h"
+- DESTINATION include)
++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+ install(FILES
+ "README.md"
+ "LICENSE.txt"
+ "NOTICES.txt"
+- DESTINATION share/amd_comgr)
++ DESTINATION ${CMAKE_INSTALL_DATADIR}/amd_comgr)
+
+ # Generate the install-tree package.
+ set(AMD_COMGR_PREFIX_CODE "
diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-dependencies.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-dependencies.patch
new file mode 100644
index 000000000000..bce19d168b0a
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-dependencies.patch
@@ -0,0 +1,38 @@
+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/19
+
+--- comgr/CMakeLists.old 2019-07-19 17:19:26.080276421 +0200
++++ comgr/CMakeLists.txt 2019-07-19 18:17:25.780163592 +0200
+@@ -185,7 +185,11 @@
+ include_directories(./yaml-cpp/include)
+
+ set(CLANG_LIBS
+- clangFrontendTool)
++ clangFrontendTool
++ clangFrontend
++ clangBasic
++ clangDriver
++ clangSerialization)
+
+ set(LLD_LIBS
+ lldELF
+@@ -193,8 +197,19 @@
+
+ llvm_map_components_to_libnames(LLVM_LIBS
+ ${LLVM_TARGETS_TO_BUILD}
++ Option
+ DebugInfoDWARF
+- Symbolize)
++ Symbolize
++ Support
++ Object
++ BitWriter
++ MC
++ MCParser
++ MCDisassembler
++ Core
++ IRReader
++ CodeGen
++ Linker)
+
+ target_link_libraries(amd_comgr
+ PUBLIC
diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-clang.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-clang.patch
new file mode 100644
index 000000000000..dda005ab7a21
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-clang.patch
@@ -0,0 +1,26 @@
+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/16
+
+From 09eb70afa22e2d6066a5f29888158c6005170ca6 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Wed, 31 Jul 2019 10:13:30 -0400
+Subject: [PATCH] Find Clang avoiding the system (non-ROC) LLVM
+
+Use NO_DEFAULT_PATH to avoid finding the system (non-ROC) LLVM.
+Use /opt/rocm/llvm as an additional hint to be consistent with the build systems of other ROC projects (such as ROCm-OpenCL-Driver)
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 454b830..8642c98 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -13,7 +13,7 @@ endif()
+
+ project(code_object_manager)
+
+-find_package(Clang REQUIRED CONFIG)
++find_package(Clang REQUIRED CONFIG PATHS ${LLVM_DIR} "/opt/rocm/llvm" NO_DEFAULT_PATH)
+ add_definitions(${LLVM_DEFINITIONS})
+ include_directories(${LLVM_INCLUDE_DIRS})
+ link_directories(${LLVM_LIBRARY_DIRS})
diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-lld-includes.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-lld-includes.patch
new file mode 100644
index 000000000000..5b44feaf1b3d
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-find-lld-includes.patch
@@ -0,0 +1,43 @@
+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/17
+
+From 4588c1a5aad3edae9d3e121685d8d1f5fddd54ba Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Wed, 31 Jul 2019 10:45:01 -0400
+Subject: [PATCH] Find lld includes in LLVM_INCLUDE_DIRS
+
+Allows building against an LLVM build tree
+---
+ CMakeLists.txt | 20 ++------------------
+ 1 file changed, 2 insertions(+), 18 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 454b830..db28533 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -19,24 +19,8 @@ include_directories(${LLVM_INCLUDE_DIRS})
+ link_directories(${LLVM_LIBRARY_DIRS})
+ include_directories(${CLANG_INCLUDE_DIRS})
+
+-# FIXME: There is no way to directly determine the include paths for LLD when
+-# working with an LLVM build tree, but we want to avoid having to install LLVM
+-# to build Comgr. This should eventually be fixed in usptream LLD so this can
+-# be removed.
+-if(DEFINED LLVM_BUILD_MAIN_SRC_DIR)
+- set(INTERNAL_LLD_INCLUDE_DIRS "${LLVM_BUILD_MAIN_SRC_DIR}/tools/lld/include")
+- set(EXTERNAL_LLD_INCLUDE_DIRS "${LLVM_BUILD_MAIN_SRC_DIR}/../lld/include")
+- if (EXISTS "${INTERNAL_LLD_INCLUDE_DIRS}"
+- AND IS_DIRECTORY "${INTERNAL_LLD_INCLUDE_DIRS}")
+- set(LLD_INCLUDE_DIRS "${INTERNAL_LLD_INCLUDE_DIRS}")
+- elseif (EXISTS "${EXTERNAL_LLD_INCLUDE_DIRS}"
+- AND IS_DIRECTORY "${EXTERNAL_LLD_INCLUDE_DIRS}")
+- set(LLD_INCLUDE_DIRS "${EXTERNAL_LLD_INCLUDE_DIRS}")
+- else()
+- message(FATAL_ERROR "You are attempting to compile using an LLVM build tree, but the LLD include directory could not be located. The paths '${INTERNAL_LLD_INCLUDE_DIRS}' and '${EXTERNAL_LLD_INCLUDE_DIRS}' were tried.")
+- endif()
+- include_directories(${LLD_INCLUDE_DIRS})
+-endif()
++set(LLD_INCLUDE_DIRS "${LLVM_INCLUDE_DIRS}/lld")
++include_directories(${LLD_INCLUDE_DIRS})
+
+ find_package(AMDDeviceLibs CONFIG)
+
diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-unbundle-yaml-cpp.patch b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-unbundle-yaml-cpp.patch
new file mode 100644
index 000000000000..d61f4c2a2003
--- /dev/null
+++ b/dev-libs/rocm-comgr/files/rocm-comgr-2.6.0-unbundle-yaml-cpp.patch
@@ -0,0 +1,30 @@
+diff --git a/lib/comgr/CMakeLists.txt b/lib/comgr/CMakeLists.txt
+index 454b830..70e2526 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -90,12 +90,8 @@ if (UNIX)
+ -Wl,--no-undefined)
+ endif()
+ endif()
+- # FIXME: Remove when yaml-cpp is removed from the build.
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ else()
+ list(APPEND AMD_COMGR_PRIVATE_COMPILE_OPTIONS "/W0" "/wd4244")
+- # FIXME: Make this private once yaml-cpp is removed from the build.
+- add_definitions(-D_HAS_EXCEPTIONS=0)
+ endif()
+
+ # Windows is strict about visibility of exports in shared libraries, so we ask
+@@ -179,10 +175,8 @@ install(EXPORT amd_comgr_export
+ DESTINATION "${AMD_COMGR_PACKAGE_PREFIX}"
+ FILE "${AMD_COMGR_TARGETS_NAME}")
+
+-set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "Enable testing" FORCE)
+-set(YAML_CPP_BUILD_TOOLS OFF CACHE BOOL "Enable parse tools" FORCE)
+-add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL)
+-include_directories(./yaml-cpp/include)
++find_package(yaml-cpp REQUIRED)
++include_directories(${YAML_CPP_INCLUDE_DIR})
+
+ set(CLANG_LIBS
+ clangFrontendTool)
diff --git a/dev-libs/rocm-comgr/metadata.xml b/dev-libs/rocm-comgr/metadata.xml
new file mode 100644
index 000000000000..20237687f91a
--- /dev/null
+++ b/dev-libs/rocm-comgr/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-CompilerSupport</remote-id>
+ </upstream>
+ <longdescription lang="en">
+ Radeon Open Compute Code Object Manager
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild b/dev-libs/rocm-comgr/rocm-comgr-2.6.0.ebuild
new file mode 100644
index 000000000000..c000ce55ab71
--- /dev/null
+++ b/dev-libs/rocm-comgr/rocm-comgr-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-CompilerSupport/"
+ inherit git-r3
+ S="${WORKDIR}/${P}/lib/comgr"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCm-CompilerSupport-roc-${PV}/lib/comgr"
+ KEYWORDS="~amd64"
+fi
+PATCHES=(
+ "${FILESDIR}/${P}-correctly-install.patch"
+ "${FILESDIR}/${P}-find-clang.patch"
+ "${FILESDIR}/${P}-find-lld-includes.patch"
+ "${FILESDIR}/${P}-dependencies.patch"
+ "${FILESDIR}/${P}-unbundle-yaml-cpp.patch"
+)
+
+DESCRIPTION="Radeon Open Compute Code Object Manager"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="dev-libs/rocm-device-libs
+ dev-cpp/yaml-cpp:=
+ sys-devel/llvm-roc:="
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ rm -rf yaml-cpp || 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
+}
diff --git a/dev-libs/rocm-device-libs/Manifest b/dev-libs/rocm-device-libs/Manifest
new file mode 100644
index 000000000000..cc781e9e0e8d
--- /dev/null
+++ b/dev-libs/rocm-device-libs/Manifest
@@ -0,0 +1 @@
+DIST rocm-device-libs-2.6.0.tar.gz 221981 BLAKE2B 6350fafb31453daf015886bc2d3d2ba59b805fafdf12372fcad8f328c9e7c74d4e54093817b07961d7be77b990780038f7a7b91d5ab63650a92bf107e0be4a40 SHA512 4262c956ea8c212c2707acf74ee27f609a6faee1bee7c3fd436b2a4adbedf1b072b611e6143cc315bd4e9d1e306d874aa0f4629cff9301bd28be65fd16867180
diff --git a/dev-libs/rocm-device-libs/metadata.xml b/dev-libs/rocm-device-libs/metadata.xml
new file mode 100644
index 000000000000..e7986fbb2ae9
--- /dev/null
+++ b/dev-libs/rocm-device-libs/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-Device-Libs</remote-id>
+ </upstream>
+ <longdescription lang="en">
+ Radeon Open Compute Device Libraries
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-2.6.0.ebuild b/dev-libs/rocm-device-libs/rocm-device-libs-2.6.0.ebuild
new file mode 100644
index 000000000000..91d53a41976d
--- /dev/null
+++ b/dev-libs/rocm-device-libs/rocm-device-libs-2.6.0.ebuild
@@ -0,0 +1,34 @@
+# 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-Device-Libs/"
+ inherit git-r3
+ S="${WORKDIR}/${P}/src"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/ROCm-Device-Libs/archive/roc-ocl-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCm-Device-Libs-roc-ocl-${PV}"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Radeon Open Compute Device Libraries"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-Device-Libs"
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="dev-libs/rocr-runtime
+ sys-devel/llvm-roc:="
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ local mycmakeargs=(
+ -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/"
+ )
+ cmake-utils_src_configure
+}
diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-9999.ebuild b/dev-libs/rocm-device-libs/rocm-device-libs-9999.ebuild
new file mode 100644
index 000000000000..91d53a41976d
--- /dev/null
+++ b/dev-libs/rocm-device-libs/rocm-device-libs-9999.ebuild
@@ -0,0 +1,34 @@
+# 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-Device-Libs/"
+ inherit git-r3
+ S="${WORKDIR}/${P}/src"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/ROCm-Device-Libs/archive/roc-ocl-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCm-Device-Libs-roc-ocl-${PV}"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Radeon Open Compute Device Libraries"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-Device-Libs"
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="dev-libs/rocr-runtime
+ sys-devel/llvm-roc:="
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ local mycmakeargs=(
+ -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/"
+ )
+ cmake-utils_src_configure
+}
diff --git a/dev-libs/rocm-hostcall/Manifest b/dev-libs/rocm-hostcall/Manifest
new file mode 100644
index 000000000000..ca774830c73a
--- /dev/null
+++ b/dev-libs/rocm-hostcall/Manifest
@@ -0,0 +1 @@
+DIST rocm-hostcall-2.7.0.tar.gz 1500771 BLAKE2B 275ad4cab34d554f8a131101eda474926f7270a44a0af9941d8f1233c29b44b3efb3ba83c6b541d501a3e2fc751c591c0f6a993563bbacf539b5bcd04b23963b SHA512 afb4a7318c2e137db6ac0502041ed53e63783ec1ab458962b1b16f0f2f28e09ce2ae70d048b858740eca8bf06328858400a68bed4e91d7cfc4b7714a66d85bc9
diff --git a/dev-libs/rocm-hostcall/files/rocm-hostcall-2.7.0-install-correctly.patch b/dev-libs/rocm-hostcall/files/rocm-hostcall-2.7.0-install-correctly.patch
new file mode 100644
index 000000000000..f419674886a7
--- /dev/null
+++ b/dev-libs/rocm-hostcall/files/rocm-hostcall-2.7.0-install-correctly.patch
@@ -0,0 +1,39 @@
+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/18
+
+From 345025de5c6c470e36505ff70978b168c05a1a71 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Wed, 31 Jul 2019 11:18:56 -0400
+Subject: [PATCH] Install to standard locations using GNUInstallDirs
+
+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 | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0f524e6..009bab7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -5,6 +5,8 @@ if (NOT UNIX)
+ message(FATAL_ERROR "No Windows support due to lack of signals")
+ endif()
+
++include(GNUInstallDirs)
++
+ find_path(HSA_HEADER hsa/hsa.h PATHS /opt/rocm/include)
+ if (NOT EXISTS ${HSA_HEADER})
+ message(FATAL_ERROR "Cannot find HSA headers. Please check the CMAKE_PREFIX_PATH")
+@@ -34,9 +36,9 @@ target_compile_options(amd_hostcall
+ target_compile_definitions(amd_hostcall
+ PRIVATE "${AMD_HOSTCALL_PRIVATE_COMPILE_DEFINITIONS}")
+
+-set(INCLUDE_INSTALL_DIR include)
+-set(LIB_INSTALL_DIR lib)
+-set(SHARE_INSTALL_DIR share)
++set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
++set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
++set(SHARE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR})
+ set(CONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/amd_hostcall)
+
+ install(TARGETS amd_hostcall
diff --git a/dev-libs/rocm-hostcall/metadata.xml b/dev-libs/rocm-hostcall/metadata.xml
new file mode 100644
index 000000000000..6b2718fcba0e
--- /dev/null
+++ b/dev-libs/rocm-hostcall/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-CompilerSupport</remote-id>
+ </upstream>
+ <longdescription lang="en">
+ Radeon Open Compute hostcall API
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-libs/rocm-hostcall/rocm-hostcall-2.7.0.ebuild b/dev-libs/rocm-hostcall/rocm-hostcall-2.7.0.ebuild
new file mode 100644
index 000000000000..848a8f3a5408
--- /dev/null
+++ b/dev-libs/rocm-hostcall/rocm-hostcall-2.7.0.ebuild
@@ -0,0 +1,34 @@
+# 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-CompilerSupport/"
+ inherit git-r3
+ S="${WORKDIR}/${P}/lib/hostcall"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCm-CompilerSupport-roc-${PV}/lib/hostcall"
+ KEYWORDS="~amd64"
+fi
+PATCHES=(
+ "${FILESDIR}/${P}-install-correctly.patch"
+)
+
+DESCRIPTION="Radeon Open Compute hostcall API"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="dev-libs/rocr-runtime"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/"
+ )
+ cmake-utils_src_configure
+}
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
+}
diff --git a/dev-libs/rocr-runtime/Manifest b/dev-libs/rocr-runtime/Manifest
index 1049c994c5b7..6c90d6896c47 100644
--- a/dev-libs/rocr-runtime/Manifest
+++ b/dev-libs/rocr-runtime/Manifest
@@ -1 +1,2 @@
DIST rocr-runtime-2.0.0.tar.gz 313087 BLAKE2B 5fe5ea99728f7d7337c9e8a174a31d4ca8bdd559fad3400955ba6d86947d5bf9004094d78548cab2cb2089bfd028d0e4dfdd4d5fd7b41bed73feeebf2f33b705 SHA512 662d3d8fff8aeb17557df67207d885edc1266bb9800ec46ecab28bbd6ace7fbffb9e4092d74beb0366cacfe8873b1b257bcf2f8345d81a9b6657a7adcfc53c0c
+DIST rocr-runtime-2.6.0.tar.gz 318296 BLAKE2B c04e04db32f650def8a7973fa73f0c0e9b99412b13676a05e9c4283ea07958ffe14f7c54002db469ddfd506f349087bd66fff138b7e7b19c41f4ca8789a7c384 SHA512 3b88cf4e1cb6fca6b4361a612abc2c02466d4f716838665d02f16b6fa975b5f69795622d6b96a01b796165980d2888be7eedd77957a7fd44fac19a0ea581f6b8
diff --git a/dev-libs/rocr-runtime/rocr-runtime-2.6.0.ebuild b/dev-libs/rocr-runtime/rocr-runtime-2.6.0.ebuild
new file mode 100644
index 000000000000..dc4aad01c299
--- /dev/null
+++ b/dev-libs/rocr-runtime/rocr-runtime-2.6.0.ebuild
@@ -0,0 +1,34 @@
+# 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/ROCR-Runtime/"
+ inherit git-r3
+ S="${WORKDIR}/${P}/src"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/ROCR-Runtime/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCR-Runtime-roc-${PV}/src"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Radeon Open Compute Runtime"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCR-Runtime"
+PATCHES=(
+ "${FILESDIR}/${PN}-2.0.0-cmake-install-paths.patch"
+)
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="sys-process/numactl"
+DEPEND="${RDEPEND}
+ dev-libs/roct-thunk-interface"
+
+src_prepare() {
+ sed -e "s:get_version ( \"1.0.0\" ):get_version ( \"${PV}\" ):" -i CMakeLists.txt || die
+ cmake-utils_src_prepare
+}
diff --git a/dev-libs/rocr-runtime/rocr-runtime-9999.ebuild b/dev-libs/rocr-runtime/rocr-runtime-9999.ebuild
new file mode 100644
index 000000000000..a31193337a6d
--- /dev/null
+++ b/dev-libs/rocr-runtime/rocr-runtime-9999.ebuild
@@ -0,0 +1,31 @@
+# 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/ROCR-Runtime/"
+ inherit git-r3
+ S="${WORKDIR}/${P}/src"
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/ROCR-Runtime/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCR-Runtime-roc-${PV}/src"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Radeon Open Compute Runtime"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCR-Runtime"
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="sys-process/numactl"
+DEPEND="${RDEPEND}
+ dev-libs/roct-thunk-interface"
+
+src_prepare() {
+ sed -e "s:get_version ( \"1.0.0\" ):get_version ( \"${PV}\" ):" -i CMakeLists.txt || die
+ cmake-utils_src_prepare
+}
diff --git a/dev-libs/roct-thunk-interface/Manifest b/dev-libs/roct-thunk-interface/Manifest
index 5a78b9fd36af..8ba10b793412 100644
--- a/dev-libs/roct-thunk-interface/Manifest
+++ b/dev-libs/roct-thunk-interface/Manifest
@@ -1 +1,2 @@
DIST roct-thunk-interface-2.0.0.tar.gz 1958218 BLAKE2B c1ba89cac9a18964e040e6b1e57a464216e7086c400e3360cfca6f376ac90b0b1afbb3a2a4d995581d1829ca57afe62bf6f2ac59cc103a48d384a8e52b1457d0 SHA512 7d2e35df2bec201bcc977328d7d36b921f76b57a0c54fc2332eb1faf3a722b6a3a1e3b1658e93b216ed68b965426c463a2dbf52a22af64ce1dcc9fad0f27ca9c
+DIST roct-thunk-interface-2.6.0.tar.gz 1957383 BLAKE2B 0335d4e219978d16bc8dbc77c6e1fb315f424ddf9225eb14968d4f8233348b358151f2baf279dc2a6e422da7839b704c847f1311b21d69e07738f3fca3235452 SHA512 e54f7cefa1854fb9967e373bd3ef5a0236987ebb26c21728ef5676e73cf63be6e9a49c1ce52d1156caa970473f214e02f25370e2cd7381c1f74a0b8cd5b2bc7f
diff --git a/dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-correctly-install-pc.patch b/dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-correctly-install-pc.patch
new file mode 100644
index 000000000000..4d0680415ce1
--- /dev/null
+++ b/dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-correctly-install-pc.patch
@@ -0,0 +1,25 @@
+https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/pull/39
+
+From 032a3e38c62b84ec56fad70d24cf82ee65d8c80b Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Mon, 22 Jul 2019 17:06:16 -0400
+Subject: [PATCH] Install libhsakmt.pc to the standard location
+
+pkgconfig files should be installed to /usr/share/pkgconfig/, not /usr/libhsakmt/
+---
+ hsakmt-dev.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/hsakmt-dev.txt b/hsakmt-dev.txt
+index eb0d3e2..195cc6c 100644
+--- a/hsakmt-dev.txt
++++ b/hsakmt-dev.txt
+@@ -43,7 +43,7 @@ set ( BUILD_VERSION_PATCH @BUILD_VERSION_PATCH@ )
+ set ( CMAKE_VERBOSE_MAKEFILE on )
+
+ ## Set the install targets
+-install ( FILES libhsakmt.pc DESTINATION libhsakmt )
++install ( FILES libhsakmt.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pkgconfig )
+ install ( DIRECTORY ${SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${HSAKMT_COMPONENT} )
+
+
diff --git a/dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-correctly-install.patch b/dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-correctly-install.patch
new file mode 100644
index 000000000000..961d2978a2d1
--- /dev/null
+++ b/dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-correctly-install.patch
@@ -0,0 +1,25 @@
+https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/pull/38
+
+From 1362864410579c35eb2ec428384ad883cb8b24b1 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Mon, 22 Jul 2019 16:18:08 -0400
+Subject: [PATCH] Install LICENSE.md to DOCDIR
+
+LICENSE.md should be installed to the DOCDIR, not /usr/libhsakmt
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e020132..398da3e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -145,7 +145,7 @@ add_custom_target ( package-dev DEPENDS build-dev
+
+ ## Add the install directives for the runtime library.
+ install ( TARGETS ${HSAKMT_TARGET} DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+-install ( FILES ${SOURCE_DIR}/LICENSE.md DESTINATION libhsakmt )
++install ( FILES ${SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR} )
+
+ ## Add the packaging directives for the runtime library.
+ set ( CPACK_PACKAGE_NAME ${HSAKMT_PACKAGE} )
diff --git a/dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-pc-prefix.patch b/dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-pc-prefix.patch
new file mode 100644
index 000000000000..0b4a716e6c9d
--- /dev/null
+++ b/dev-libs/roct-thunk-interface/files/roct-thunk-interface-2.6.0-pc-prefix.patch
@@ -0,0 +1,22 @@
+https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/pull/40
+
+From fb42a02230ed5140b3ac3beadb38ca39eb9ea463 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Mon, 22 Jul 2019 17:17:09 -0400
+Subject: [PATCH] Use CMAKE_INSTALL_PREFIX in pkgconfig
+
+The location where files are installed is the value to use; the CPACK packaging directory isn't important as the pkgconfig file is used on the system after the package is installed.
+---
+ libhsakmt.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libhsakmt.pc.in b/libhsakmt.pc.in
+index 3093afc..1abb66d 100644
+--- a/libhsakmt.pc.in
++++ b/libhsakmt.pc.in
+@@ -1,4 +1,4 @@
+-prefix=@CPACK_PACKAGING_INSTALL_PREFIX@
++prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+ libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
diff --git a/dev-libs/roct-thunk-interface/roct-thunk-interface-2.6.0.ebuild b/dev-libs/roct-thunk-interface/roct-thunk-interface-2.6.0.ebuild
new file mode 100644
index 000000000000..8968eaaf9659
--- /dev/null
+++ b/dev-libs/roct-thunk-interface/roct-thunk-interface-2.6.0.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils linux-info
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCT-Thunk-Interface-roc-${PV}"
+ KEYWORDS="~amd64"
+fi
+PATCHES=(
+ "${FILESDIR}/${P}-correctly-install.patch"
+ "${FILESDIR}/${P}-correctly-install-pc.patch"
+ "${FILESDIR}/${P}-pc-prefix.patch"
+)
+
+DESCRIPTION="Radeon Open Compute Thunk Interface"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface"
+CONFIG_CHECK="~HSA_AMD"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="sys-process/numactl
+ sys-apps/pciutils"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ sed -e "s:get_version ( \"1.0.0\" ):get_version ( \"${PV}\" ):" -i CMakeLists.txt || die
+ cmake-utils_src_prepare
+}
+src_compile() {
+ cmake-utils_src_compile build-dev
+}
+src_install() {
+ cmake-utils_src_install install-dev
+}
diff --git a/dev-libs/roct-thunk-interface/roct-thunk-interface-9999.ebuild b/dev-libs/roct-thunk-interface/roct-thunk-interface-9999.ebuild
new file mode 100644
index 000000000000..28db57d3c714
--- /dev/null
+++ b/dev-libs/roct-thunk-interface/roct-thunk-interface-9999.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils linux-info
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/ROCT-Thunk-Interface-roc-${PV}"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Radeon Open Compute Thunk Interface"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface"
+CONFIG_CHECK="~HSA_AMD"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="sys-process/numactl
+ sys-apps/pciutils"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ sed -e "s:get_version ( \"1.0.0\" ):get_version ( \"${PV}\" ):" -i CMakeLists.txt || die
+ cmake-utils_src_prepare
+}
+src_configure() {
+ local mycmakeargs=(
+ -DCPACK_PACKAGING_INSTALL_PREFIX=/usr
+ )
+ cmake-utils_src_configure
+}
+src_compile() {
+ cmake-utils_src_compile build-dev
+}
+src_install() {
+ cmake-utils_src_install install-dev
+}
diff --git a/dev-util/rocm-cmake/Manifest b/dev-util/rocm-cmake/Manifest
new file mode 100644
index 000000000000..24991e568f19
--- /dev/null
+++ b/dev-util/rocm-cmake/Manifest
@@ -0,0 +1 @@
+DIST rocm-cmake-0.2.tar.gz 12729 BLAKE2B 6380e077cdc0dcc8c40c487789bd4405a9104e0c55e68df0587c74ea140c329b28ef224bea0d9d529ddaca2c3b874e64be840f96191b8bae7d662de5854756b6 SHA512 b2ebd749fb99ac6dbeac005bb0de5ca57e12ae3590d560c0fd03371f2dd0fc6e7862e0bc96046b98b8248770852c6ee64dd349f22405e77d8a210884246213bd
diff --git a/dev-util/rocm-cmake/metadata.xml b/dev-util/rocm-cmake/metadata.xml
new file mode 100644
index 000000000000..a82bb12bfd85
--- /dev/null
+++ b/dev-util/rocm-cmake/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-cmake</remote-id>
+ </upstream>
+ <longdescription lang="en">
+ Radeon Open Compute CMake Modules
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-util/rocm-cmake/rocm-cmake-0.2.ebuild b/dev-util/rocm-cmake/rocm-cmake-0.2.ebuild
new file mode 100644
index 000000000000..eee840d3674b
--- /dev/null
+++ b/dev-util/rocm-cmake/rocm-cmake-0.2.ebuild
@@ -0,0 +1,25 @@
+# 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-cmake/"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/rocm-cmake/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Radeon Open Compute CMake Modules"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocm-cmake"
+LICENSE="MIT"
+SLOT="0"
+RESTRICT="test"
+
+src_prepare() {
+ sed -e "s:set(ROCM_INSTALL_LIBDIR lib):set(ROCM_INSTALL_LIBDIR $(get_libdir)):" -i "${S}/share/rocm/cmake/ROCMInstallTargets.cmake" || die
+ cmake-utils_src_prepare
+}
diff --git a/dev-util/rocm-cmake/rocm-cmake-9999.ebuild b/dev-util/rocm-cmake/rocm-cmake-9999.ebuild
new file mode 100644
index 000000000000..eee840d3674b
--- /dev/null
+++ b/dev-util/rocm-cmake/rocm-cmake-9999.ebuild
@@ -0,0 +1,25 @@
+# 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-cmake/"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/rocm-cmake/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Radeon Open Compute CMake Modules"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocm-cmake"
+LICENSE="MIT"
+SLOT="0"
+RESTRICT="test"
+
+src_prepare() {
+ sed -e "s:set(ROCM_INSTALL_LIBDIR lib):set(ROCM_INSTALL_LIBDIR $(get_libdir)):" -i "${S}/share/rocm/cmake/ROCMInstallTargets.cmake" || die
+ cmake-utils_src_prepare
+}
diff --git a/dev-util/rocminfo/Manifest b/dev-util/rocminfo/Manifest
new file mode 100644
index 000000000000..28fcd10b1e6e
--- /dev/null
+++ b/dev-util/rocminfo/Manifest
@@ -0,0 +1 @@
+DIST rocminfo-2.6.0.tar.gz 12293 BLAKE2B b08725b45f48e78841da9d6e57bb19a441a423e20f853d16024c620914059abf3cb2e61c12ae6fdfdb85eb3e984d488ae9975ab3fd2fcc529ecb576c6816fc92 SHA512 e2dae7e2e02b674b3ad959a3dffdcd8f550842edfd0eac5866259a6a12de1a5f935afbdcb37845fa189d0937c41186f0eb8be08e7b346ddef959d5dd7b62dca7
diff --git a/dev-util/rocminfo/files/rocminfo-2.6.0-cmake-variables.patch b/dev-util/rocminfo/files/rocminfo-2.6.0-cmake-variables.patch
new file mode 100644
index 000000000000..1678f5043273
--- /dev/null
+++ b/dev-util/rocminfo/files/rocminfo-2.6.0-cmake-variables.patch
@@ -0,0 +1,31 @@
+https://github.com/RadeonOpenCompute/rocminfo/pull/17
+
+From c9bfc4b3db029b8502f900cd9bb545a675ca0898 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Thu, 25 Jul 2019 17:59:51 -0400
+Subject: [PATCH] Use CACHE variables, allow overriding
+ ROCR_LIB_DIR/ROCR_INC_DIR
+
+CACHE variables allow for variables to be documented, and ROCR_LIB_DIR/ROCR_INC_DIR should be overridable as they'll have different values on different Linux distributions.
+---
+ CMakeLists.txt | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b5fa9dd..f8f430f 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -43,9 +43,10 @@ endif()
+ #
+
+ # Required Defines first:
+-
+-set(ROCR_INC_DIR ${ROCM_DIR}/include)
+-set(ROCR_LIB_DIR ${ROCM_DIR}/lib)
++set(ROCRTST_BLD_BITS CACHE "64" STRING "Either 32 or 64")
++set(ROCM_DIR CACHE PATH "Root for RocM install")
++set(ROCR_INC_DIR ${ROCM_DIR}/include CACHE PATH "Path for RocM includes")
++set(ROCR_LIB_DIR ${ROCM_DIR}/lib CACHE PATH "Path for RocM libraries")
+ #
+ # Determine ROCR Header files are present
+ #
diff --git a/dev-util/rocminfo/metadata.xml b/dev-util/rocminfo/metadata.xml
new file mode 100644
index 000000000000..c7439799c48a
--- /dev/null
+++ b/dev-util/rocminfo/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/rocminfo</remote-id>
+ </upstream>
+ <longdescription lang="en">
+ ROCm Application for Reporting System Info
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-util/rocminfo/rocminfo-2.6.0.ebuild b/dev-util/rocminfo/rocminfo-2.6.0.ebuild
new file mode 100644
index 000000000000..9d2f7d5e0eb0
--- /dev/null
+++ b/dev-util/rocminfo/rocminfo-2.6.0.ebuild
@@ -0,0 +1,36 @@
+# 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/rocminfo/"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/RadeonOpenCompute/rocminfo/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+ S="${WORKDIR}/rocminfo-roc-${PV}"
+fi
+
+DESCRIPTION="ROCm Application for Reporting System Info"
+HOMEPAGE="https://github.com/RadeonOpenCompute/rocminfo"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND="dev-libs/rocr-runtime"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-cmake-variables.patch"
+)
+
+src_configure() {
+ local mycmakeargs=(
+ -DROCM_DIR="${ESYSROOT}/usr"
+ -DROCR_INC_DIR="${ESYSROOT}/usr/include"
+ -DROCR_LIB_DIR="${EPREFIX}/usr/$(get_libdir)/hsa"
+ )
+ cmake-utils_src_configure
+}
diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index ef0c1c24e2f3..3bbd7ac2972f 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,2 +1,3 @@
DIST mesa-19.0.8.tar.xz 11967592 BLAKE2B 91a46b67bdb8cb3ab4c7337be7c2b0dc6ab5ec8cc126afc2d8af8d056bff0392a5b443c26304bf4c68472eb6ba16d29ca248c1fc0c0f2dd6af03d3e10d3ec1b3 SHA512 fbddc3a74f223564343027380af776b3fa5d63fe1af4e34121273235d1c6eced96439f601eb19bf658eb927aff3965b520f0329fcbd4650f3112167303e1746d
DIST mesa-19.1.3.tar.xz 10935604 BLAKE2B 4dfda4b3ef7a2d53b20a7a0c81b08901d6b88431b6b56679b8d97d6f2f57ce18f6dcdbae9b79c5d02b9175f47db629833da6012658295fe456829ef07a5ff087 SHA512 787310c43089142209ff7db298489b0815b630577680d5ce1bc3f796eed3772ba41f03e5e773b77ae084c191ed4e365eac1753166ce60f12b8f5974d55762eeb
+DIST mesa-19.1.4.tar.xz 10938008 BLAKE2B 4745fc7e844397378fe1adf61bcd5b54aad11ec0b375ced85fd80ced01227432b491ad8b7ba7d9013190cfbb451bc11cdb7c8af0e1f298dd5d793d3ce43aa92b SHA512 234032d917c9b378c3f6ceb921677b64e549344c3957331810b50fd73e0dccd2f4f62e2bd39e619590f389bc58fdab10fab4b88f7c117557cbeb1dda049b9fc5
diff --git a/media-libs/mesa/mesa-19.1.4.ebuild b/media-libs/mesa/mesa-19.1.4.ebuild
new file mode 100644
index 000000000000..0fd4ae716a5f
--- /dev/null
+++ b/media-libs/mesa/mesa-19.1.4.ebuild
@@ -0,0 +1,540 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_5 python3_6 python3_7 )
+
+inherit llvm meson multilib-minimal pax-utils python-any-r1
+
+OPENGL_DIR="xorg-x11"
+
+MY_P="${P/_/-}"
+
+DESCRIPTION="OpenGL-like graphic library for Linux"
+HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
+ EXPERIMENTAL="true"
+ inherit git-r3
+else
+ SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+RESTRICT="
+ !test? ( test )
+"
+
+RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
+VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris nouveau vc4 virgl vivante vmware"
+for card in ${VIDEO_CARDS}; do
+ IUSE_VIDEO_CARDS+=" video_cards_${card}"
+done
+
+IUSE="${IUSE_VIDEO_CARDS}
+ +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +libglvnd +llvm
+ lm_sensors opencl osmesa pax_kernel pic selinux test unwind vaapi valgrind
+ vdpau vulkan vulkan-overlay wayland xa xvmc"
+
+REQUIRED_USE="
+ d3d9? ( dri3 || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
+ gles1? ( egl )
+ gles2? ( egl )
+ vulkan? ( dri3
+ || ( video_cards_i965 video_cards_iris video_cards_radeonsi )
+ video_cards_radeonsi? ( llvm ) )
+ vulkan-overlay? ( vulkan )
+ wayland? ( egl gbm )
+ video_cards_freedreno? ( gallium )
+ video_cards_intel? ( classic )
+ video_cards_i915? ( || ( classic gallium ) )
+ video_cards_i965? ( classic )
+ video_cards_iris? ( gallium )
+ video_cards_nouveau? ( || ( classic gallium ) )
+ video_cards_radeon? ( || ( classic gallium )
+ gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
+ video_cards_r100? ( classic )
+ video_cards_r200? ( classic )
+ video_cards_r300? ( gallium x86? ( llvm ) amd64? ( llvm ) )
+ video_cards_r600? ( gallium )
+ video_cards_radeonsi? ( gallium llvm )
+ video_cards_vc4? ( gallium )
+ video_cards_virgl? ( gallium )
+ video_cards_vivante? ( gallium gbm )
+ video_cards_vmware? ( gallium )
+"
+
+LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.97"
+RDEPEND="
+ !app-eselect/eselect-mesa
+ >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
+ >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
+ >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
+ x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
+ libglvnd? (
+ media-libs/libglvnd[${MULTILIB_USEDEP}]
+ !app-eselect/eselect-opengl
+ )
+ !libglvnd? (
+ >=app-eselect/eselect-opengl-1.3.0
+ )
+ gallium? (
+ unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
+ llvm? (
+ video_cards_radeonsi? (
+ virtual/libelf:0=[${MULTILIB_USEDEP}]
+ )
+ video_cards_r600? (
+ virtual/libelf:0=[${MULTILIB_USEDEP}]
+ )
+ video_cards_radeon? (
+ virtual/libelf:0=[${MULTILIB_USEDEP}]
+ )
+ )
+ lm_sensors? ( sys-apps/lm_sensors:=[${MULTILIB_USEDEP}] )
+ opencl? (
+ dev-libs/ocl-icd[khronos-headers,${MULTILIB_USEDEP}]
+ dev-libs/libclc
+ virtual/libelf:0=[${MULTILIB_USEDEP}]
+ )
+ vaapi? (
+ >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
+ video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
+ )
+ vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
+ xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
+ )
+ wayland? (
+ >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
+ >=dev-libs/wayland-protocols-1.8
+ )
+ ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
+
+ video_cards_intel? (
+ !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
+ )
+ video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
+ vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
+"
+for card in ${RADEON_CARDS}; do
+ RDEPEND="${RDEPEND}
+ video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
+ "
+done
+RDEPEND="${RDEPEND}
+ video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
+"
+
+# Please keep the LLVM dependency block separate. Since LLVM is slotted,
+# we need to *really* make sure we're not pulling one than more slot
+# simultaneously.
+#
+# How to use it:
+# 1. List all the working slots (with min versions) in ||, newest first.
+# 2. Update the := to specify *max* version, e.g. < 10.
+# 3. Specify LLVM_MAX_SLOT, e.g. 9.
+LLVM_MAX_SLOT="9"
+LLVM_DEPSTR="
+ || (
+ sys-devel/llvm:9[${MULTILIB_USEDEP}]
+ sys-devel/llvm:8[${MULTILIB_USEDEP}]
+ sys-devel/llvm:7[${MULTILIB_USEDEP}]
+ )
+ sys-devel/llvm:=[${MULTILIB_USEDEP}]
+"
+LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
+CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
+CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
+RDEPEND="${RDEPEND}
+ llvm? (
+ opencl? (
+ video_cards_r600? (
+ ${CLANG_DEPSTR_AMDGPU}
+ )
+ !video_cards_r600? (
+ video_cards_radeonsi? (
+ ${CLANG_DEPSTR_AMDGPU}
+ )
+ )
+ !video_cards_r600? (
+ !video_cards_radeonsi? (
+ video_cards_radeon? (
+ ${CLANG_DEPSTR_AMDGPU}
+ )
+ )
+ )
+ !video_cards_r600? (
+ !video_cards_radeon? (
+ !video_cards_radeonsi? (
+ ${CLANG_DEPSTR}
+ )
+ )
+ )
+ )
+ !opencl? (
+ video_cards_r600? (
+ ${LLVM_DEPSTR_AMDGPU}
+ )
+ !video_cards_r600? (
+ video_cards_radeonsi? (
+ ${LLVM_DEPSTR_AMDGPU}
+ )
+ )
+ !video_cards_r600? (
+ !video_cards_radeonsi? (
+ video_cards_radeon? (
+ ${LLVM_DEPSTR_AMDGPU}
+ )
+ )
+ )
+ !video_cards_r600? (
+ !video_cards_radeon? (
+ !video_cards_radeonsi? (
+ ${LLVM_DEPSTR}
+ )
+ )
+ )
+ )
+ )
+"
+unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
+
+DEPEND="${RDEPEND}
+ valgrind? ( dev-util/valgrind )
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-base/xorg-proto
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ opencl? (
+ >=sys-devel/gcc-4.6
+ )
+ sys-devel/bison
+ sys-devel/flex
+ sys-devel/gettext
+ virtual/pkgconfig
+ $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
+"
+
+S="${WORKDIR}/${MY_P}"
+EGIT_CHECKOUT_DIR=${S}
+
+QA_WX_LOAD="
+x86? (
+ !pic? (
+ usr/lib*/libglapi.so.0.0.0
+ usr/lib*/libGLESv1_CM.so.1.0.0
+ usr/lib*/libGLESv2.so.2.0.0
+ usr/lib*/libGL.so.1.2.0
+ usr/lib*/libOSMesa.so.8.0.0
+ )
+)"
+
+llvm_check_deps() {
+ local flags=${MULTILIB_USEDEP}
+ if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
+ then
+ flags+=",llvm_targets_AMDGPU(-)"
+ fi
+
+ if use opencl; then
+ has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
+ fi
+ has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
+}
+
+pkg_pretend() {
+ if use opencl; then
+ if ! use video_cards_r600 &&
+ ! use video_cards_radeonsi; then
+ ewarn "Ignoring USE=opencl since VIDEO_CARDS does not contain r600 or radeonsi"
+ fi
+ fi
+
+ if use vaapi; then
+ if ! use video_cards_r600 &&
+ ! use video_cards_radeonsi &&
+ ! use video_cards_nouveau; then
+ ewarn "Ignoring USE=vaapi since VIDEO_CARDS does not contain r600, radeonsi, or nouveau"
+ fi
+ fi
+
+ if use vdpau; then
+ if ! use video_cards_r300 &&
+ ! use video_cards_r600 &&
+ ! use video_cards_radeonsi &&
+ ! use video_cards_nouveau; then
+ ewarn "Ignoring USE=vdpau since VIDEO_CARDS does not contain r300, r600, radeonsi, or nouveau"
+ fi
+ fi
+
+ if use xa; then
+ if ! use video_cards_freedreno &&
+ ! use video_cards_nouveau &&
+ ! use video_cards_vmware; then
+ ewarn "Ignoring USE=xa since VIDEO_CARDS does not contain freedreno, nouveau, or vmware"
+ fi
+ fi
+
+ if use xvmc; then
+ if ! use video_cards_r600 &&
+ ! use video_cards_nouveau; then
+ ewarn "Ignoring USE=xvmc since VIDEO_CARDS does not contain r600 or nouveau"
+ fi
+ fi
+
+ if ! use gallium; then
+ use lm_sensors && ewarn "Ignoring USE=lm_sensors since USE does not contain gallium"
+ use llvm && ewarn "Ignoring USE=llvm since USE does not contain gallium"
+ use opencl && ewarn "Ignoring USE=opencl since USE does not contain gallium"
+ use vaapi && ewarn "Ignoring USE=vaapi since USE does not contain gallium"
+ use vdpau && ewarn "Ignoring USE=vdpau since USE does not contain gallium"
+ use unwind && ewarn "Ignoring USE=unwind since USE does not contain gallium"
+ use xa && ewarn "Ignoring USE=xa since USE does not contain gallium"
+ use xvmc && ewarn "Ignoring USE=xvmc since USE does not contain gallium"
+ fi
+
+ if ! use llvm; then
+ use opencl && ewarn "Ignoring USE=opencl since USE does not contain llvm"
+ fi
+}
+
+python_check_deps() {
+ has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ # warning message for bug 459306
+ if use llvm && has_version sys-devel/llvm[!debug=]; then
+ ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
+ ewarn "detected! This can cause problems. For details, see bug 459306."
+ fi
+
+ if use llvm; then
+ llvm_pkg_setup
+ fi
+ python-any-r1_pkg_setup
+}
+
+multilib_src_configure() {
+ local emesonargs=()
+
+ if use classic; then
+ # Intel code
+ dri_driver_enable video_cards_i915 i915
+ dri_driver_enable video_cards_i965 i965
+ if ! use video_cards_i915 && \
+ ! use video_cards_i965; then
+ dri_driver_enable video_cards_intel i915 i965
+ fi
+
+ # Nouveau code
+ dri_driver_enable video_cards_nouveau nouveau
+
+ # ATI code
+ dri_driver_enable video_cards_r100 r100
+ dri_driver_enable video_cards_r200 r200
+ if ! use video_cards_r100 && \
+ ! use video_cards_r200; then
+ dri_driver_enable video_cards_radeon r100 r200
+ fi
+ fi
+
+ emesonargs+=( -Dplatforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm") )
+
+ if use gallium; then
+ emesonargs+=(
+ $(meson_use llvm)
+ $(meson_use lm_sensors lmsensors)
+ $(meson_use unwind libunwind)
+ )
+
+ if use video_cards_iris ||
+ use video_cards_r300 ||
+ use video_cards_r600 ||
+ use video_cards_radeonsi ||
+ use video_cards_nouveau ||
+ use video_cards_vmware; then
+ emesonargs+=($(meson_use d3d9 gallium-nine))
+ else
+ emesonargs+=(-Dgallium-nine=false)
+ fi
+
+ if use video_cards_r600 ||
+ use video_cards_radeonsi ||
+ use video_cards_nouveau; then
+ emesonargs+=($(meson_use vaapi gallium-va))
+ use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
+ else
+ emesonargs+=(-Dgallium-va=false)
+ fi
+
+ if use video_cards_r300 ||
+ use video_cards_r600 ||
+ use video_cards_radeonsi ||
+ use video_cards_nouveau; then
+ emesonargs+=($(meson_use vdpau gallium-vdpau))
+ else
+ emesonargs+=(-Dgallium-vdpau=false)
+ fi
+
+ if use video_cards_freedreno ||
+ use video_cards_nouveau ||
+ use video_cards_vmware; then
+ emesonargs+=($(meson_use xa gallium-xa))
+ else
+ emesonargs+=(-Dgallium-xa=false)
+ fi
+
+ if use video_cards_r600 ||
+ use video_cards_nouveau; then
+ emesonargs+=($(meson_use xvmc gallium-xvmc))
+ else
+ emesonargs+=(-Dgallium-xvmc=false)
+ fi
+
+ if use video_cards_freedreno ||
+ use video_cards_vc4 ||
+ use video_cards_vivante; then
+ gallium_enable -- kmsro
+ fi
+
+ gallium_enable video_cards_vc4 vc4
+ gallium_enable video_cards_vivante etnaviv
+ gallium_enable video_cards_vmware svga
+ gallium_enable video_cards_nouveau nouveau
+
+ # Only one i915 driver (classic vs gallium). Default to classic.
+ if ! use classic; then
+ gallium_enable video_cards_i915 i915
+ if ! use video_cards_i915 && \
+ ! use video_cards_i965; then
+ gallium_enable video_cards_intel i915
+ fi
+ fi
+
+ gallium_enable video_cards_iris iris
+
+ gallium_enable video_cards_r300 r300
+ gallium_enable video_cards_r600 r600
+ gallium_enable video_cards_radeonsi radeonsi
+ if ! use video_cards_r300 && \
+ ! use video_cards_r600; then
+ gallium_enable video_cards_radeon r300 r600
+ fi
+
+ gallium_enable video_cards_freedreno freedreno
+ gallium_enable video_cards_virgl virgl
+
+ # opencl stuff
+ emesonargs+=(
+ -Dgallium-opencl="$(usex opencl icd disabled)"
+ )
+ fi
+
+ if use vulkan; then
+ vulkan_enable video_cards_i965 intel
+ vulkan_enable video_cards_iris intel
+ vulkan_enable video_cards_radeonsi amd
+ fi
+
+ # x86 hardened pax_kernel needs glx-rts, bug 240956
+ if [[ ${ABI} == x86 ]]; then
+ emesonargs+=( $(meson_use pax_kernel glx-read-only-text) )
+ fi
+
+ # on abi_x86_32 hardened we need to have asm disable
+ if [[ ${ABI} == x86* ]] && use pic; then
+ emesonargs+=( -Dasm=false )
+ fi
+
+ if use gallium; then
+ gallium_enable -- swrast
+ emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
+ else
+ dri_driver_enable -- swrast
+ emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
+ fi
+
+ driver_list() {
+ local drivers="$(sort -u <<< "${1// /$'\n'}")"
+ echo "${drivers//$'\n'/,}"
+ }
+
+ emesonargs+=(
+ $(meson_use test build-tests)
+ -Dglx=dri
+ -Dshared-glapi=true
+ $(meson_use dri3)
+ $(meson_use egl)
+ $(meson_use gbm)
+ $(meson_use gles1)
+ $(meson_use gles2)
+ $(meson_use libglvnd glvnd)
+ $(meson_use selinux)
+ -Dvalgrind=$(usex valgrind auto false)
+ -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
+ -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
+ -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
+ $(meson_use vulkan-overlay vulkan-overlay-layer)
+ --buildtype $(usex debug debug plain)
+ -Db_ndebug=$(usex debug false true)
+ )
+ meson_src_configure
+}
+
+multilib_src_compile() {
+ meson_src_compile
+}
+
+multilib_src_install() {
+ meson_src_install
+
+ use libglvnd && rm -f "${D}"/usr/$(get_libdir)/libGLESv{1_CM,2}.so*
+}
+
+multilib_src_install_all() {
+ einstalldocs
+}
+
+multilib_src_test() {
+ meson test -v -C "${BUILD_DIR}" -t 100
+}
+
+pkg_postinst() {
+ # Switch to the xorg implementation.
+ echo
+ eselect opengl set --use-old ${OPENGL_DIR}
+}
+
+# $1 - VIDEO_CARDS flag (check skipped for "--")
+# other args - names of DRI drivers to enable
+dri_driver_enable() {
+ if [[ $1 == -- ]] || use $1; then
+ shift
+ DRI_DRIVERS+=("$@")
+ fi
+}
+
+gallium_enable() {
+ if [[ $1 == -- ]] || use $1; then
+ shift
+ GALLIUM_DRIVERS+=("$@")
+ fi
+}
+
+vulkan_enable() {
+ if [[ $1 == -- ]] || use $1; then
+ shift
+ VULKAN_DRIVERS+=("$@")
+ fi
+}
diff --git a/sys-devel/llvm-roc/Manifest b/sys-devel/llvm-roc/Manifest
new file mode 100644
index 000000000000..422ab6500cae
--- /dev/null
+++ b/sys-devel/llvm-roc/Manifest
@@ -0,0 +1,3 @@
+DIST clang-roc-2.6.0.tar.gz 18831605 BLAKE2B c54b811afc57d42b32e6c38ef219eb8a1bdba47f2a58505249bf5057708c6873b28387c1fa05a8a6c1bfb02cb71b4ca96e69a72d9f0cc03bb393fa1033d86a41 SHA512 41a3595961eb4b57ac8b2d7483f53628ffe5f064a40a7331fbfa1daad2f1491e1062a1189a15a00586341fdeb73978db67c058a23e00982d32b987cc41a63b43
+DIST lld-roc-ocl-2.6.0.tar.gz 1508227 BLAKE2B 39182669e38ec21cdd30f180981631abfa55c1ddc9f923e44f251a12e27da55409d7dfebd454b2706c88ebc0259455020fbe5db8d3543a353810bacde2396104 SHA512 19f300760be83c165a03ff2d48b014b3bcb3f7703c9430c3146b964e23ae30ea07ff579402bdce613e995004b063bced7329719e801c585e6e885b0ab473ce8a
+DIST llvm-roc-ocl-2.6.0.tar.gz 48417665 BLAKE2B 9b7ff7cc57d98b2076994d3a5585563430fdad5975b89459aea34d585adf330d3d49d2ef611a70fd546878d84bc64d2c196dbf9f19e78ab2b4a5e63266ffb2d3 SHA512 89d5c97b8bf97242d72176768f8d12b218ab258fff9d154e3c3ff382b5563c2d6997ee5cf145e5f2c34e2cf4f9dd268906750a014a874a2038683ef5f173b872
diff --git a/sys-devel/llvm-roc/llvm-roc-2.6.0.ebuild b/sys-devel/llvm-roc/llvm-roc-2.6.0.ebuild
new file mode 100644
index 000000000000..63d3cc7cf47e
--- /dev/null
+++ b/sys-devel/llvm-roc/llvm-roc-2.6.0.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils
+
+DESCRIPTION="Radeon Open Compute llvm,lld,clang"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
+SRC_URI="https://github.com/RadeonOpenCompute/llvm/archive/roc-ocl-${PV}.tar.gz -> llvm-roc-ocl-${PV}.tar.gz
+ https://github.com/RadeonOpenCompute/clang/archive/roc-${PV}.tar.gz -> clang-roc-${PV}.tar.gz
+ https://github.com/RadeonOpenCompute/lld/archive/roc-ocl-${PV}.tar.gz -> lld-roc-ocl-${PV}.tar.gz"
+
+LICENSE="UoI-NCSA rc BSD public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="virtual/cblas
+ dev-libs/rocr-runtime"
+DEPEND="${RDEPEND}"
+
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+S="${WORKDIR}/llvm-roc-ocl-${PV}"
+
+src_unpack() {
+ unpack ${A}
+ ln -s "${WORKDIR}/clang-roc-${PV}" "${WORKDIR}/llvm-roc-ocl-${PV}/tools/clang"
+ ln -s "${WORKDIR}/lld-roc-ocl-${PV}" "${WORKDIR}/llvm-roc-ocl-${PV}/tools/lld"
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
+ -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" "${S}"
+ )
+ cmake-utils_src_configure
+}
diff --git a/sys-devel/llvm-roc/metadata.xml b/sys-devel/llvm-roc/metadata.xml
new file mode 100644
index 000000000000..971e48876cfb
--- /dev/null
+++ b/sys-devel/llvm-roc/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/llvm</remote-id>
+ </upstream>
+ <longdescription lang="en">
+ Radeon Open Compute llvm, clang, and lld
+ </longdescription>
+</pkgmetadata>