1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Contributor: Daniel M. Capella <polycitizen@gmail.com>
3 # Contributor: Bin Jin <bjin@ctrl-d.org>
8 pkgdesc='Collection of tools, libraries and tests for shader compilation'
9 url='https://github.com/google/shaderc'
12 depends=('glibc' 'gcc-libs' 'glslang' 'spirv-tools')
13 makedepends=('asciidoctor' 'cmake' 'ninja' 'python' 'spirv-headers')
14 provides=('libshaderc_shared.so')
15 source=(https://github.com/google/shaderc/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
16 sha512sums=('41e8a931ce47f42964c69c747aae96795d9791787deee411ce2e7053e2f426f1766a5aa42e8400fa9179c9428f11f3283a7b4c1dd20e7969963e6a00443549c1')
17 b2sums=('a9a29b4cef74b864b87af5700b830d1d193cf2cdb8ae6cafffc50c6130ac6e1bfb0a598ca30ecf1cfa06dd50144bdd421b7541a6fdb2965b8ee029ad749ea0fe')
20 cd ${pkgname}-${pkgver}
22 # de-vendor libs and disable git versioning
23 sed '/examples/d;/third_party/d' -i CMakeLists.txt
24 sed '/build-version/d' -i glslc/CMakeLists.txt
25 cat <<- EOF > glslc/src/build-version.inc
27 "$(pacman -Q spirv-tools|cut -d \ -f 2|sed 's/-.*//')\\n"
28 "$(pacman -Q glslang|cut -d \ -f 2|sed 's/-.*//')\\n"
33 cd ${pkgname}-${pkgver}
36 -DCMAKE_BUILD_TYPE=Release \
37 -DCMAKE_INSTALL_PREFIX=/usr \
38 -DCMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects" \
39 -DSHADERC_SKIP_TESTS=ON \
40 -Dglslang_SOURCE_DIR=/usr/include/glslang \
45 asciidoctor -b manpage README.asciidoc -o glslc.1
49 cd ${pkgname}-${pkgver}
54 cd ${pkgname}-${pkgver}
55 DESTDIR="${pkgdir}" ninja -C build install
56 install -Dm 644 glslc/glslc.1 -t "${pkgdir}/usr/share/man/man1"