From b78d3c133c0c7aa9797e91e6a1f3eeb2255c03af Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Mon, 7 Jun 2021 05:08:19 +0000 Subject: [PATCH] added community/spirv-llvm-translator --- community/spirv-llvm-translator/PKGBUILD | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 community/spirv-llvm-translator/PKGBUILD diff --git a/community/spirv-llvm-translator/PKGBUILD b/community/spirv-llvm-translator/PKGBUILD new file mode 100644 index 000000000..0e6b06692 --- /dev/null +++ b/community/spirv-llvm-translator/PKGBUILD @@ -0,0 +1,42 @@ +# Maintainer: Daniel Bermond +# Maintainer: Bruno Pagani + +# ALARM: Kevin Mihelich +# - make llvm-spirv, install doesn't work otherwise + +_srcname=SPIRV-LLVM-Translator +pkgname=${_srcname,,} +pkgver=12.0.0 +pkgrel=1 +pkgdesc="Tool and a library for bi-directional translation between SPIR-V and LLVM IR" +arch=(x86_64) +url="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/" +license=(custom) +depends=(llvm-libs) +makedepends=(cmake llvm spirv-tools) +checkdepends=(python python-setuptools clang) +source=(${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz) +sha256sums=('6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108') + +build() { + cmake -B build -S ${_srcname}-${pkgver} \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_SKIP_RPATH=ON \ + -DLLVM_INCLUDE_TESTS=ON \ + -DLLVM_EXTERNAL_LIT=/usr/bin/lit \ + -Wno-dev + make -C build llvm-spirv +} + +check() { + LD_LIBRARY_PATH="${srcdir}/build/lib/SPIRV" make -C build test +} + +package() { + make -C build DESTDIR="${pkgdir}" install + install -Dm755 build/tools/llvm-spirv/llvm-spirv -t "${pkgdir}"/usr/bin + install -Dm644 ${_srcname}-${pkgver}/LICENSE.TXT -t "${pkgdir}"/usr/share/licenses/${pkgname}/ +}