This repository has been archived by the owner on May 20, 2023. It is now read-only.
/
PKGBUILD
65 lines (57 loc) · 2.09 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Careful when upgrading this package! It usually breaks ABI without bumping
# soname. Also, be very mindful of the version of spirv-tools that this links
# to. Upstream actually expects the use of the particular commits of
# spirv-tools and spirv-headers that are provided in known_good.json. However,
# if we went that route, we'd have to vendor the resulting spirv-tools libs
# from this glslang build and they would be incompatible with system libs,
# resulting in us having to ship both. Instead, I recommend just waiting until
# upstream releases a compatible version of spirv-tools, then updating the
# spriv-tools system package and only then building glslang against that.
pkgname=glslang
pkgver=12.1.0
pkgrel=2
pkgdesc='OpenGL and OpenGL ES shader front end and validator'
arch=('x86_64')
url='https://github.com/KhronosGroup/glslang'
license=('BSD')
depends=('gcc-libs')
makedepends=('cmake' 'ninja' 'git' 'spirv-tools' 'spirv-headers' 'python')
options=('staticlibs')
# Get the commits from known_good.json for every release
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/KhronosGroup/glslang/archive/${pkgver}.tar.gz)
sha256sums=('1515e840881d1128fb6d831308433f731808f818f2103881162f3ffd47b15cd5')
build() {
cd ${pkgname}-${pkgver}
# we need fat LTO objects to not break consumers during linking
CXXFLAGS+=" -ffat-lto-objects"
cmake \
-Bbuild-shared \
-GNinja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=None \
-DBUILD_SHARED_LIBS=ON
ninja -Cbuild-shared
cmake \
-Bbuild-static \
-GNinja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=None \
-DBUILD_SHARED_LIBS=OFF
ninja -Cbuild-static
}
check() {
cd ${pkgname}-${pkgver}
ninja -Cbuild-shared test
}
package() {
cd ${pkgname}-${pkgver}
DESTDIR="${pkgdir}" ninja -C build-shared install
DESTDIR="${pkgdir}" ninja -C build-static install
install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
cd "${pkgdir}"/usr/lib
for lib in *.so; do
ln -sf "${lib}" "${lib}.0"
done
}
# vim: ts=2 sw=2 et: