summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Lothian <mike@fireburn.co.uk>2021-02-18 15:07:47 +0000
committerConrad Kostecki <conikost@gentoo.org>2021-02-27 15:39:44 +0100
commit0d6c49e059fcb04e8ee11031e5177927f8a53609 (patch)
tree086eb8afe5c7ba8908d24295ec6681c105cb46fa /dev-util
parentdev-libs/opencl-clang: Add support for llvm 11.1 (diff)
downloadgentoo-0d6c49e059fcb04e8ee11031e5177927f8a53609.tar.gz
gentoo-0d6c49e059fcb04e8ee11031e5177927f8a53609.tar.bz2
gentoo-0d6c49e059fcb04e8ee11031e5177927f8a53609.zip
dev-util/spirv-llvm-translator: Add support for llvm 11.1
Signed-off-by: Mike Lothian <mike@fireburn.co.uk> Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/spirv-llvm-translator/files/llvm-11.1.0.patch10
-rw-r--r--dev-util/spirv-llvm-translator/spirv-llvm-translator-11.0.0-r1.ebuild63
2 files changed, 73 insertions, 0 deletions
diff --git a/dev-util/spirv-llvm-translator/files/llvm-11.1.0.patch b/dev-util/spirv-llvm-translator/files/llvm-11.1.0.patch
new file mode 100644
index 000000000000..f4d243acc5eb
--- /dev/null
+++ b/dev-util/spirv-llvm-translator/files/llvm-11.1.0.patch
@@ -0,0 +1,10 @@
+--- a/CMakeLists.txt 2021-02-18 14:52:20.079691789 +0000
++++ b/CMakeLists.txt 2021-02-18 14:47:43.773873042 +0000
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 3.3)
+
+-set (BASE_LLVM_VERSION 11.0.0)
++set (BASE_LLVM_VERSION 11.1.0)
+ set(LLVM_SPIRV_VERSION ${BASE_LLVM_VERSION}.0)
+
+ option(LLVM_SPIRV_INCLUDE_TESTS
diff --git a/dev-util/spirv-llvm-translator/spirv-llvm-translator-11.0.0-r1.ebuild b/dev-util/spirv-llvm-translator/spirv-llvm-translator-11.0.0-r1.ebuild
new file mode 100644
index 000000000000..94dee02866a6
--- /dev/null
+++ b/dev-util/spirv-llvm-translator/spirv-llvm-translator-11.0.0-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_ECLASS=cmake
+
+inherit cmake-multilib flag-o-matic llvm
+
+EGIT_COMMIT="d6dc999eee381158a26f048a333467c9ce7e77f2"
+MY_PN="SPIRV-LLVM-Translator"
+MY_P="${MY_PN}-${EGIT_COMMIT}"
+
+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/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="UoI-NCSA"
+SLOT="11"
+KEYWORDS="~amd64"
+IUSE="test tools"
+
+# I have yet to see a non-release spirv-llvm-translator ebuild pass ANY tests.
+# This is probably something silly like the test suite expecting different
+# directory names but I really can't be bothered to debug VCS snapshots.
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_P}"
+
+COMMON="~sys-devel/clang-11.1.0:11=[${MULTILIB_USEDEP}]"
+DEPEND="${COMMON}"
+RDEPEND="${COMMON}"
+BDEPEND="test? ( dev-python/lit )"
+
+REQUIRED_USE="test? ( tools )"
+
+LLVM_MAX_SLOT=11
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-8.0.0.1-no_pkgconfig_files.patch
+ "${FILESDIR}"/llvm-11.1.0.patch
+)
+
+src_prepare() {
+ append-flags -fPIC
+ cmake_src_prepare
+}
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="$(get_llvm_prefix ${LLVM_MAX_SLOT})"
+ -DLLVM_BUILD_TOOLS=$(usex tools "ON" "OFF")
+ $(usex test "-DLLVM_INCLUDE_TESTS=ON" "")
+ )
+ cmake_src_configure
+}
+
+multilib_src_test() {
+ # 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
+}