From d93b1da0473409053475d30a3d15bd659a479bd4 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 13 Dec 2018 23:05:22 -0500 Subject: [PATCH] dev-libs/rocr-runtime: Radeon Open Compute Runtime Bug: https://bugs.gentoo.org/650804 Package-Manager: Portage-2.3.52, Repoman-2.3.12 Signed-off-by: Craig Andrews --- dev-libs/rocr-runtime/Manifest | 1 + ...cr-runtime-2.0.0-cmake-install-paths.patch | 42 +++++++++++++++++++ dev-libs/rocr-runtime/metadata.xml | 18 ++++++++ .../rocr-runtime/rocr-runtime-2.0.0.ebuild | 34 +++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 dev-libs/rocr-runtime/Manifest create mode 100644 dev-libs/rocr-runtime/files/rocr-runtime-2.0.0-cmake-install-paths.patch create mode 100644 dev-libs/rocr-runtime/metadata.xml create mode 100644 dev-libs/rocr-runtime/rocr-runtime-2.0.0.ebuild diff --git a/dev-libs/rocr-runtime/Manifest b/dev-libs/rocr-runtime/Manifest new file mode 100644 index 000000000000..1049c994c5b7 --- /dev/null +++ b/dev-libs/rocr-runtime/Manifest @@ -0,0 +1 @@ +DIST rocr-runtime-2.0.0.tar.gz 313087 BLAKE2B 5fe5ea99728f7d7337c9e8a174a31d4ca8bdd559fad3400955ba6d86947d5bf9004094d78548cab2cb2089bfd028d0e4dfdd4d5fd7b41bed73feeebf2f33b705 SHA512 662d3d8fff8aeb17557df67207d885edc1266bb9800ec46ecab28bbd6ace7fbffb9e4092d74beb0366cacfe8873b1b257bcf2f8345d81a9b6657a7adcfc53c0c diff --git a/dev-libs/rocr-runtime/files/rocr-runtime-2.0.0-cmake-install-paths.patch b/dev-libs/rocr-runtime/files/rocr-runtime-2.0.0-cmake-install-paths.patch new file mode 100644 index 000000000000..ece1571ab406 --- /dev/null +++ b/dev-libs/rocr-runtime/files/rocr-runtime-2.0.0-cmake-install-paths.patch @@ -0,0 +1,42 @@ +From 866c2fbcf1efa3e84e6f25bebc12dc1d4caa4e74 Mon Sep 17 00:00:00 2001 +From: Craig Andrews +Date: Mon, 7 Jan 2019 21:06:14 -0500 +Subject: [PATCH] Correctly install the library into the system + +Install to standard locations in /usr/{lib,include}/lib (as opposed to /usr/hsa/{lib,include}/hsa) +Use CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR from GNUInstallDirs instead of using "lib" and "include" +--- + src/CMakeLists.txt | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 37a9b09..e39f3d2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,6 +53,7 @@ project( ${CORE_RUNTIME_TARGET} ) + + list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" ) + include ( utils ) ++include ( GNUInstallDirs ) + include ( hsa_common ) + + ## Find LibElf +@@ -177,14 +178,12 @@ if ( "${CMAKE_BUILD_TYPE}" STREQUAL Release ) + endif () + + ## Create symlinks for packaging and install +-add_custom_target ( hsa-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink ../hsa/include/hsa hsa-link ) +-add_custom_target ( ${CORE_RUNTIME_TARGET}.so-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink ../hsa/lib/${CORE_RUNTIME_LIBRARY}.so ${CORE_RUNTIME_LIBRARY}.so-link ) ++add_custom_target ( ${CORE_RUNTIME_TARGET}.so-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E create_symlink hsa/${CORE_RUNTIME_LIBRARY}.so ${CORE_RUNTIME_LIBRARY}.so-link ) + + ## Set install information +-install ( TARGETS ${CORE_RUNTIME_TARGET} LIBRARY DESTINATION hsa/lib ) +-install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/ DESTINATION hsa/include/hsa ) +-install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/hsa-link DESTINATION include PERMISSIONS OWNER_WRITE OWNER_READ RENAME hsa ) +-install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_RUNTIME_LIBRARY}.so-link DESTINATION lib PERMISSIONS OWNER_WRITE OWNER_READ RENAME ${CORE_RUNTIME_LIBRARY}.so ) ++install ( TARGETS ${CORE_RUNTIME_TARGET} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/hsa ) ++install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hsa ) ++install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CORE_RUNTIME_LIBRARY}.so-link DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_WRITE OWNER_READ RENAME ${CORE_RUNTIME_LIBRARY}.so ) + + ## Packaging directives + set ( CPACK_PACKAGE_NAME "hsa-rocr-dev" ) diff --git a/dev-libs/rocr-runtime/metadata.xml b/dev-libs/rocr-runtime/metadata.xml new file mode 100644 index 000000000000..d53b83185ad3 --- /dev/null +++ b/dev-libs/rocr-runtime/metadata.xml @@ -0,0 +1,18 @@ + + + + + candrews@gentoo.org + Craig Andrews + + + gentoo@holzke.net + Wilfried Holzke + + + RadeonOpenCompute/ROCR-Runtime + + + Radeon Open Compute Platform Runtime + + diff --git a/dev-libs/rocr-runtime/rocr-runtime-2.0.0.ebuild b/dev-libs/rocr-runtime/rocr-runtime-2.0.0.ebuild new file mode 100644 index 000000000000..d75707a03ba0 --- /dev/null +++ b/dev-libs/rocr-runtime/rocr-runtime-2.0.0.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2018 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}/${P}-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 +} -- 2.26.2