archrelease: copy trunk to extra-x86_64
[arch-packages.git] / shaderc / trunk / PKGBUILD
bloba55c16d27e6cda5372311ee348f227d91a9512f6
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>
5 pkgname=shaderc
6 pkgver=2022.1
7 pkgrel=4
8 pkgdesc='Collection of tools, libraries and tests for shader compilation'
9 url='https://github.com/google/shaderc'
10 arch=('x86_64')
11 license=('Apache')
12 depends=('glibc' 'gcc-libs' 'glslang' 'spirv-tools')
13 makedepends=('asciidoctor' 'cmake' 'ninja' 'python' 'spirv-headers')
14 provides=('libshaderc_shared.so')
15 source=(${pkgname}-${pkgver}.tar.gz::https://github.com/google/shaderc/archive/v${pkgver}.tar.gz)
16 sha512sums=('21c2462cb434d94da87c71ba660f6cd5b161450d7faeff8789b41db25e64f2baa7c560e78aa856d128c5a73699215d6b1085b5ca19a4640237adf194793ad44b')
18 prepare() {
19   cd ${pkgname}-${pkgver}
21   # de-vendor libs and disable git versioning
22   sed '/examples/d;/third_party/d' -i CMakeLists.txt
23   sed '/build-version/d' -i glslc/CMakeLists.txt
24   cat <<- EOF > glslc/src/build-version.inc
25 "${pkgver}\\n"
26 "$(pacman -Q spirv-tools|cut -d \  -f 2|sed 's/-.*//')\\n"
27 "$(pacman -Q glslang|cut -d \  -f 2|sed 's/-.*//')\\n"
28 EOF
31 build() {
32   cd ${pkgname}-${pkgver}
33   cmake \
34     -B build \
35     -DCMAKE_BUILD_TYPE=Release \
36     -DCMAKE_INSTALL_PREFIX=/usr \
37     -DCMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects" \
38     -DSHADERC_SKIP_TESTS=ON \
39     -Dglslang_SOURCE_DIR=/usr/include/glslang \
40     -GNinja
41   ninja -C build
43   cd glslc
44   asciidoctor -b manpage README.asciidoc -o glslc.1
47 package() {
48   cd ${pkgname}-${pkgver}
49   DESTDIR="${pkgdir}" ninja -C build install
50   install -Dm 644 glslc/glslc.1 -t "${pkgdir}/usr/share/man/man1"
53 # vim: ts=2 sw=2 et: