2021-06-07 05:08:19 +00:00
|
|
|
# Maintainer: Daniel Bermond <dbermond@archlinux.org>
|
|
|
|
# Maintainer: Bruno Pagani <archange@archlinux.org>
|
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
# - make llvm-spirv, install doesn't work otherwise
|
|
|
|
|
|
|
|
_srcname=SPIRV-LLVM-Translator
|
|
|
|
pkgname=${_srcname,,}
|
2022-07-03 04:24:02 +00:00
|
|
|
pkgver=14.0.0.r57+g33898cef
|
2023-01-04 11:34:44 +00:00
|
|
|
pkgrel=3
|
2021-06-07 05:08:19 +00:00
|
|
|
pkgdesc="Tool and a library for bi-directional translation between SPIR-V and LLVM IR"
|
|
|
|
arch=(x86_64)
|
2022-03-21 01:21:21 +00:00
|
|
|
url="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
|
2021-06-07 05:08:19 +00:00
|
|
|
license=(custom)
|
2022-07-03 04:24:02 +00:00
|
|
|
depends=(llvm-libs spirv-tools)
|
|
|
|
makedepends=(git cmake llvm spirv-headers)
|
2021-06-07 05:08:19 +00:00
|
|
|
checkdepends=(python python-setuptools clang)
|
2022-07-03 04:24:02 +00:00
|
|
|
# Current point in the used LLVM branch
|
|
|
|
_commit=33898cef1093f67c73f0623bae941f00034b2db9
|
2022-03-21 01:21:21 +00:00
|
|
|
source=(git+${url}.git#commit=$_commit)
|
2023-01-04 11:34:44 +00:00
|
|
|
sha256sums=('SKIP')
|
2022-03-21 01:21:21 +00:00
|
|
|
|
|
|
|
pkgver() {
|
2022-03-24 13:21:11 +00:00
|
|
|
cd ${_srcname}
|
|
|
|
git describe --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./;s/-/+/'
|
2022-03-21 01:21:21 +00:00
|
|
|
}
|
2021-06-07 05:08:19 +00:00
|
|
|
|
|
|
|
build() {
|
2022-03-24 13:21:11 +00:00
|
|
|
cmake -B build -S ${_srcname} \
|
|
|
|
-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 \
|
|
|
|
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr/include/spirv/ \
|
|
|
|
-Wno-dev
|
|
|
|
make -C build llvm-spirv
|
2021-06-07 05:08:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2022-07-03 04:24:02 +00:00
|
|
|
LD_LIBRARY_PATH="${srcdir}/build/lib/SPIRV" make -C build test
|
2021-06-07 05:08:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2022-03-24 13:21:11 +00:00
|
|
|
make -C build DESTDIR="${pkgdir}" install
|
|
|
|
install -Dm755 build/tools/llvm-spirv/llvm-spirv -t "${pkgdir}"/usr/bin
|
|
|
|
install -Dm644 ${_srcname}/LICENSE.TXT -t "${pkgdir}"/usr/share/licenses/${pkgname}/
|
2021-06-07 05:08:19 +00:00
|
|
|
}
|