db-move: moved webkitgtk-6.0 from [testing] to [extra] (x86_64)
[arch-packages.git] / shaderc / repos / extra-x86_64 / PKGBUILD
blobc0e822df1acd8fc1995f686dd3873fc33ed75b1e
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=2023.3
7 pkgrel=1
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=(https://github.com/google/shaderc/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
16 sha512sums=('41e8a931ce47f42964c69c747aae96795d9791787deee411ce2e7053e2f426f1766a5aa42e8400fa9179c9428f11f3283a7b4c1dd20e7969963e6a00443549c1')
17 b2sums=('a9a29b4cef74b864b87af5700b830d1d193cf2cdb8ae6cafffc50c6130ac6e1bfb0a598ca30ecf1cfa06dd50144bdd421b7541a6fdb2965b8ee029ad749ea0fe')
19 prepare() {
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
26 "${pkgver}\\n"
27 "$(pacman -Q spirv-tools|cut -d \  -f 2|sed 's/-.*//')\\n"
28 "$(pacman -Q glslang|cut -d \  -f 2|sed 's/-.*//')\\n"
29 EOF
32 build() {
33   cd ${pkgname}-${pkgver}
34   cmake \
35     -B build \
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 \
41     -GNinja
42   ninja -C build
44   cd glslc
45   asciidoctor -b manpage README.asciidoc -o glslc.1
48 check() {
49   cd ${pkgname}-${pkgver}
50   ninja -C build test
53 package() {
54   cd ${pkgname}-${pkgver}
55   DESTDIR="${pkgdir}" ninja -C build install
56   install -Dm 644 glslc/glslc.1 -t "${pkgdir}/usr/share/man/man1"
59 # vim: ts=2 sw=2 et: