summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2019-04-30 11:58:22 +0100
committerMarek Szuba <marecki@gentoo.org>2019-05-01 17:51:26 +0100
commit93a52c5db9c1056a3b10ebbf9aff9a4047d86cc5 (patch)
tree85522ec82716f6a6a780ce6ace682315158a68b9 /dev-util/spirv-llvm-translator
parentdev-python/ipyparallel: bump to 6.2.3 (diff)
downloadgentoo-93a52c5db9c1056a3b10ebbf9aff9a4047d86cc5.tar.gz
gentoo-93a52c5db9c1056a3b10ebbf9aff9a4047d86cc5.tar.bz2
gentoo-93a52c5db9c1056a3b10ebbf9aff9a4047d86cc5.zip
dev-util/spirv-llvm-translator: new package
Third-order dependency of Intel Graphics Compute Runtime. Signed-off-by: Marek Szuba <marecki@gentoo.org> Package-Manager: Portage-2.3.62, Repoman-2.3.11
Diffstat (limited to 'dev-util/spirv-llvm-translator')
-rw-r--r--dev-util/spirv-llvm-translator/Manifest1
-rw-r--r--dev-util/spirv-llvm-translator/files/spirv-llvm-translator-8.0.0.1-no_pkgconfig_files.patch18
-rw-r--r--dev-util/spirv-llvm-translator/metadata.xml12
-rw-r--r--dev-util/spirv-llvm-translator/spirv-llvm-translator-8.0.0.1.ebuild65
4 files changed, 96 insertions, 0 deletions
diff --git a/dev-util/spirv-llvm-translator/Manifest b/dev-util/spirv-llvm-translator/Manifest
new file mode 100644
index 000000000000..33846447d840
--- /dev/null
+++ b/dev-util/spirv-llvm-translator/Manifest
@@ -0,0 +1 @@
+DIST spirv-llvm-translator-8.0.0.1.tar.gz 437384 BLAKE2B bca52bfec04d0adc08b00f5fdbcb6cf953be00f835d2a393545e77bd8776063ef91e8fb62c232b50cbeab58a0a01bea6e47b89c1756699bf35481e87823995de SHA512 85faf176d1ce79d19f10c88055f4a102a5952dcdcd6709e5e5cfdbf69eb958d51020a3ad34198c7c874b42ee8e318f1ce3169ea92853134dfff3dc5843f84414
diff --git a/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-8.0.0.1-no_pkgconfig_files.patch b/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-8.0.0.1-no_pkgconfig_files.patch
new file mode 100644
index 000000000000..66e81dc3b20d
--- /dev/null
+++ b/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-8.0.0.1-no_pkgconfig_files.patch
@@ -0,0 +1,18 @@
+Do not install pkgconfig data files, pkg-config does not presently look at
+/usr/lib/llvm/.../pkgconfig and putting them in /usr/lib*/pkgconfig would
+cause collisions between slots.
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -66,11 +66,3 @@
+ DESTINATION
+ ${CMAKE_INSTALL_PREFIX}/include/LLVMSPIRVLib
+ )
+-
+-configure_file(LLVMSPIRVLib.pc.in ${CMAKE_BINARY_DIR}/LLVMSPIRVLib.pc @ONLY)
+-install(
+- FILES
+- ${CMAKE_BINARY_DIR}/LLVMSPIRVLib.pc
+- DESTINATION
+- ${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/pkgconfig
+-)
diff --git a/dev-util/spirv-llvm-translator/metadata.xml b/dev-util/spirv-llvm-translator/metadata.xml
new file mode 100644
index 000000000000..d7dec83e2de9
--- /dev/null
+++ b/dev-util/spirv-llvm-translator/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>marecki@gentoo.org</email>
+ <name>Marek Szuba</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">KhronosGroup/SPIRV-LLVM-Translator</remote-id>
+ </upstream>
+</pkgmetadata>
+
diff --git a/dev-util/spirv-llvm-translator/spirv-llvm-translator-8.0.0.1.ebuild b/dev-util/spirv-llvm-translator/spirv-llvm-translator-8.0.0.1.ebuild
new file mode 100644
index 000000000000..9e8e3b39fed5
--- /dev/null
+++ b/dev-util/spirv-llvm-translator/spirv-llvm-translator-8.0.0.1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib flag-o-matic llvm eapi7-ver
+
+MY_PN="SPIRV-LLVM-Translator"
+MY_PV="$(ver_rs 3 -)"
+MY_P="${MY_PN}-${MY_PV}"
+
+DESCRIPTION="Bi-directional translator between SPIR-V and LLVM IR"
+HOMEPAGE="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
+SRC_URI="https://github.com/KhronosGroup/${MY_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="UoI-NCSA"
+SLOT="8"
+KEYWORDS="~amd64"
+IUSE="test"
+
+S="${WORKDIR}/${MY_P}"
+
+COMMON="sys-devel/llvm:8=[${MULTILIB_USEDEP}]"
+DEPEND="${COMMON}
+ test? ( dev-python/lit )"
+RDEPEND="${COMMON}"
+
+LLVM_MAX_SLOT=8
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-8.0.0.1-no_pkgconfig_files.patch
+)
+
+src_prepare() {
+ append-flags -fPIC
+ cmake-utils_src_prepare
+}
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="$(get_llvm_prefix)"
+ $(usex test "-DLLVM_INCLUDE_TESTS=ON" "")
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile llvm-spirv
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+ # CMake does not install the executable so do it by hand
+ if multilib_is_native_abi; then
+ exeinto "$(get_llvm_prefix)"/bin
+ doexe "${BUILD_DIR}"/tools/llvm-spirv/llvm-spirv
+ fi
+}
+
+multilib_src_test() {
+ # TODO: figure out why some tests fail on amd64 when ABI==x86
+ if multilib_is_native_abi; then
+ lit "${BUILD_DIR}/test" || die "Error running tests for ABI ${ABI}"
+ fi
+}