archrelease: copy trunk to extra-x86_64
[arch-packages.git] / glslang / trunk / PKGBUILD
blob8761b3bb031f29b69d257605e0fc6caa887307ce
1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
3 # Careful when upgrading this package! It usually breaks ABI without bumping soname.
4 pkgname=glslang
5 pkgver=11.7.1
6 pkgrel=2
7 pkgdesc='OpenGL and OpenGL ES shader front end and validator'
8 arch=('x86_64')
9 url='https://github.com/KhronosGroup/glslang'
10 license=('BSD')
11 depends=('gcc-libs')
12 makedepends=('cmake' 'ninja' 'git' 'python')
13 options=('staticlibs')
14 # Get the commits from known_good.json for every release
15 source=(${pkgname}-${pkgver}.tar.gz::https://github.com/KhronosGroup/glslang/archive/${pkgver}.tar.gz
16         git+https://github.com/KhronosGroup/SPIRV-Tools#commit=1fbed83c8aab8517d821fcb4164c08567951938f
17         git+https://github.com/KhronosGroup/SPIRV-Headers#commit=449bc986ba6f4c5e10e32828783f9daef2a77644)
18 sha256sums=('ab2e2ddc507bb418b9227cbe6f443eb06e89e2387944f42026d82c0b4ef79b0a'
19             'SKIP'
20             'SKIP')
22 prepare() {
23   # Sadly, glslang requires super specific versions of SPIRV headers and
24   # spirv-tools and so I'm afraid that for the time being we'll have to use
25   # their vendored version until we figure out a good way to use system
26   # libraries.
27   cp -r SPIRV-Tools ${pkgname}-${pkgver}/External/spirv-tools
28   cp -r SPIRV-Headers ${pkgname}-${pkgver}/External/spirv-tools/external/spirv-headers
31 build() {
32   cd ${pkgname}-${pkgver}
33   cmake \
34     -Bbuild-shared \
35     -GNinja \
36     -DCMAKE_INSTALL_PREFIX=/usr \
37     -DCMAKE_BUILD_TYPE=Release \
38     -DBUILD_SHARED_LIBS=ON
39   ninja -Cbuild-shared
40   cmake \
41     -Bbuild-static \
42     -GNinja \
43     -DCMAKE_INSTALL_PREFIX=/usr \
44     -DCMAKE_BUILD_TYPE=Release \
45     -DBUILD_SHARED_LIBS=OFF
46   ninja -Cbuild-static
49 package() {
50   cd ${pkgname}-${pkgver}
51   DESTDIR="${pkgdir}" ninja -C build-shared install
52   DESTDIR="${pkgdir}" ninja -C build-static install
54   install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
56   cd "${pkgdir}"/usr/lib
57   for lib in *.so; do
58     ln -sf "${lib}" "${lib}.0"
59   done
61   # Delete the stuff that's been vendored in. It's not ideal but that's we'll deal with for now.
62   mv "${pkgdir}"/usr/bin/spirv-remap .
63   rm -r "${pkgdir}"/usr/{bin/spirv*,include/spirv-tools,lib/cmake/SPIRV-Tools*,lib/libSPIRV-*,lib/pkgconfig}
64   mv spirv-remap "${pkgdir}"/usr/bin/spirv-remap
67 # vim: ts=2 sw=2 et: