[arch-commits] Commit in glslang/trunk (PKGBUILD)

Sven-Hendrik Haase svenstaro at archlinux.org
Sun Mar 14 05:14:51 UTC 2021


    Date: Sunday, March 14, 2021 @ 05:14:50
  Author: svenstaro
Revision: 409855

upgpkg: glslang 11.2.0-2: Add vendored spirv-tools to enable HLSL and optimizer support

Apparently upstream really wants us to vendor the specific version of spirv-tools for whatever reason so for now
this is what we'll do until we can come up with something better (FS#69974).
Also cleaned up the build script a little.

Modified:
  glslang/trunk/PKGBUILD

----------+
 PKGBUILD |   47 +++++++++++++++++++++++++++--------------------
 1 file changed, 27 insertions(+), 20 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-03-14 04:12:08 UTC (rev 409854)
+++ PKGBUILD	2021-03-14 05:14:50 UTC (rev 409855)
@@ -3,13 +3,13 @@
 # Careful when upgrading this package! It usually breaks ABI without bumping soname.
 pkgname=glslang
 pkgver=11.2.0
-pkgrel=1
+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' 'spirv-tools' 'python')
-makedepends=('cmake' 'ninja')
+depends=('gcc-libs' 'python')
+makedepends=('cmake' 'ninja' 'git')
 options=('staticlibs')
 source=(${pkgname}-${pkgver}.tar.gz::https://github.com/KhronosGroup/glslang/archive/${pkgver}.tar.gz)
 sha256sums=('8ff2fcf9b054e4a4ef56fcd8a637322f827b2b176a592a618d63672ddb896e06')
@@ -16,23 +16,25 @@
 
 build() {
   cd ${pkgname}-${pkgver}
-  mkdir -p build-{shared,static}
-  (cd build-shared
-    cmake .. \
-      -GNinja \
-      -DCMAKE_INSTALL_PREFIX=/usr \
-      -DCMAKE_BUILD_TYPE=Release \
-      -DBUILD_SHARED_LIBS=ON
-    ninja
-  )
-  (cd build-static
-    cmake .. \
-      -GNinja \
-      -DCMAKE_INSTALL_PREFIX=/usr \
-      -DCMAKE_BUILD_TYPE=Release \
-      -DBUILD_SHARED_LIBS=OFF
-    ninja
-  )
+  # Sadly, glslang requires super specific versions of SPIRV headers and
+  # spirv-tools and so I'm afraid that for the time being we'll have to use
+  # their vendored version until we figure out a good way to use system
+  # libraries.
+  ./update_glslang_sources.py
+  cmake \
+    -Bbuild-shared \
+    -GNinja \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DBUILD_SHARED_LIBS=ON
+  ninja -Cbuild-shared
+  cmake \
+    -Bbuild-static \
+    -GNinja \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DBUILD_SHARED_LIBS=OFF
+  ninja -Cbuild-static
 }
 
 package() {
@@ -46,6 +48,11 @@
   for lib in *.so; do
     ln -sf "${lib}" "${lib}.0"
   done
+
+  # Delete the stuff that's been vendored in. It's not ideal but that's we'll deal with for now.
+  mv "${pkgdir}"/usr/bin/spirv-remap .
+  rm -r "${pkgdir}"/usr/{bin/spirv*,include/spirv-tools,lib/cmake/SPIRV-Tools*,lib/libSPIRV-*,lib/pkgconfig}
+  mv spirv-remap "${pkgdir}"/usr/bin/spirv-remap
 }
 
 # vim: ts=2 sw=2 et:



More information about the arch-commits mailing list