summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-util/spirv-llvm-translator/Manifest1
-rw-r--r--dev-util/spirv-llvm-translator/spirv-llvm-translator-8.0.0.1-r1.ebuild67
2 files changed, 68 insertions, 0 deletions
diff --git a/dev-util/spirv-llvm-translator/Manifest b/dev-util/spirv-llvm-translator/Manifest
index 33846447d840..336d1277a9f1 100644
--- a/dev-util/spirv-llvm-translator/Manifest
+++ b/dev-util/spirv-llvm-translator/Manifest
@@ -1 +1,2 @@
+DIST spirv-llvm-translator-8.0.0.1-LowerOpenCL_new_block_representation.patch.xz 10108 BLAKE2B 96492a7d3ab25e1fe837ced225d50c7450595af52bc3aa6c17e02dc08c1cccaf7ca8dc5949da17da7cc6ea5fcae8688a5994a50bb7693a52493520e57981bc48 SHA512 574ca7b7fe054e82ee154556555e2d184f102faa7da08ce9d6ca5d2ca37463c7a86b3861b93969f9c886544551af8c8f95e57363ea017f7fc426b56d97eb7cf2
DIST spirv-llvm-translator-8.0.0.1.tar.gz 437384 BLAKE2B bca52bfec04d0adc08b00f5fdbcb6cf953be00f835d2a393545e77bd8776063ef91e8fb62c232b50cbeab58a0a01bea6e47b89c1756699bf35481e87823995de SHA512 85faf176d1ce79d19f10c88055f4a102a5952dcdcd6709e5e5cfdbf69eb958d51020a3ad34198c7c874b42ee8e318f1ce3169ea92853134dfff3dc5843f84414
diff --git a/dev-util/spirv-llvm-translator/spirv-llvm-translator-8.0.0.1-r1.ebuild b/dev-util/spirv-llvm-translator/spirv-llvm-translator-8.0.0.1-r1.ebuild
new file mode 100644
index 000000000000..3412d8cf4a0c
--- /dev/null
+++ b/dev-util/spirv-llvm-translator/spirv-llvm-translator-8.0.0.1-r1.ebuild
@@ -0,0 +1,67 @@
+# 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
+ https://dev.gentoo.org/~marecki/dists/${PN}/${PN}-8.0.0.1-LowerOpenCL_new_block_representation.patch.xz"
+
+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=(
+ "${WORKDIR}"/${PN}-8.0.0.1-LowerOpenCL_new_block_representation.patch
+ "${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
+}