Subject: [mesa-updates 03/13] gnu: glslang: Update to vulkan-sdk-1.3.275.0.

From: dan <[email-masked]>
Date: Thu, 29 Feb 2024 01:31:36 +0800

* gnu/packages/vulkan.scm (glslang): Update to vulkan-sdk-1.3.275.0.
  [source]: Remove patch.
  [arguments]: Run tests.
  [inputs]: Add spirv-tools.
* gnu/packages/patches/glslang-install-static-libs.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Ungerister it.

Change-Id: I053bb7fd2d510395a248b0f5c0107a7b264a38c7
---
 gnu/local.mk                                  |  1 -
 .../patches/glslang-install-static-libs.patch | 61 -------------------
 gnu/packages/vulkan.scm                       | 17 +++---
 3 files changed, 10 insertions(+), 69 deletions(-)
 delete mode 100644 gnu/packages/patches/glslang-install-static-libs.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 208d74ef3e..6177b178b3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1352,7 +1352,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/glibc-2.29-git-updates.patch     	\
   %D%/packages/patches/glibc-2.29-supported-locales.patch     	\
   %D%/packages/patches/glibc-supported-locales.patch     	\
-  %D%/packages/patches/glslang-install-static-libs.patch     	\
   %D%/packages/patches/gmp-arm-asm-nothumb.patch		\
   %D%/packages/patches/gmp-faulty-test.patch			\
   %D%/packages/patches/gnash-fix-giflib-version.patch	        \
diff --git a/gnu/packages/patches/glslang-install-static-libs.patch b/gnu/packages/patches/glslang-install-static-libs.patch
deleted file mode 100644
index a155dde30e..0000000000
--- a/gnu/packages/patches/glslang-install-static-libs.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Install OGLCompiler et.al. even when building shared libraries.  Also fix
-CMake file locations.
-
-Patch taken from Gentoo:
-
-  https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-util/glslang/files/glslang-1.3.231-Install-static-libs.patch
-
-diff --git a/OGLCompilersDLL/CMakeLists.txt b/OGLCompilersDLL/CMakeLists.txt
---- a/OGLCompilersDLL/CMakeLists.txt
-+++ b/OGLCompilersDLL/CMakeLists.txt
-@@ -41,7 +41,7 @@ if(WIN32)
-     source_group("Source" FILES ${SOURCES})
- endif(WIN32)
- 
--if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
-+if(ENABLE_GLSLANG_INSTALL)
-     install(TARGETS OGLCompiler EXPORT glslang-targets)
- 
-     # Backward compatibility
-@@ -49,7 +49,7 @@ if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
-         message(WARNING \"Using `OGLCompilerTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
- 
-         if (NOT TARGET glslang::OGLCompiler)
--            include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/glslang-targets.cmake\")
-+            include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
-         endif()
- 
-         add_library(OGLCompiler ALIAS glslang::OGLCompiler)
-diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt
---- a/glslang/CMakeLists.txt
-+++ b/glslang/CMakeLists.txt
-@@ -203,7 +203,7 @@ endif()
- ################################################################################
- if(ENABLE_GLSLANG_INSTALL)
-     install(TARGETS glslang EXPORT glslang-targets)
--    if(NOT BUILD_SHARED_LIBS)
-+    if(BUILD_SHARED_LIBS)
-         install(TARGETS MachineIndependent EXPORT glslang-targets)
-         install(TARGETS GenericCodeGen EXPORT glslang-targets)
- 
-diff --git a/glslang/OSDependent/Unix/CMakeLists.txt b/glslang/OSDependent/Unix/CMakeLists.txt
---- a/glslang/OSDependent/Unix/CMakeLists.txt
-+++ b/glslang/OSDependent/Unix/CMakeLists.txt
-@@ -52,7 +52,7 @@ else()
-     target_link_libraries(OSDependent Threads::Threads)
- endif()
- 
--if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
-+if(ENABLE_GLSLANG_INSTALL)
-     install(TARGETS OSDependent EXPORT glslang-targets)
- 
-     # Backward compatibility
-@@ -60,7 +60,7 @@ if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
-         message(WARNING \"Using `OSDependentTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
- 
-         if (NOT TARGET glslang::OSDependent)
--            include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/glslang-targets.cmake\")
-+            include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
-         endif()
- 
-         add_library(OSDependent ALIAS glslang::OSDependent)
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index d29810f4c6..3b485901d8 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -196,17 +196,20 @@ (define-public glslang
        (uri (git-reference
              (url "https://github.com/KhronosGroup/glslang")
              (commit version)))
-       (patches (search-patches "glslang-install-static-libs.patch"))
        (sha256
-        (base32
-         "12a1zl8qxa28nbf6m67260c0lwdw3bqbj0jz1382wgm5px1fpqw6"))
+        (base32 "15xf1p9wwyvcps2kbyfiqnch3x2a1a9bd9aixq2y4yv9ir9hhhpf"))
        (file-name (git-file-name name version))))
     (build-system cmake-build-system)
     (arguments
-     '(#:tests? #f                      ;FIXME: requires bundled SPIRV-Tools
-       #:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
-    (native-inputs
-     (list pkg-config python))
+     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
+                           "-DALLOW_EXTERNAL_SPIRV_TOOLS=ON")
+       #:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        (invoke "ctest")))))))
+    (inputs (list spirv-tools))
+    (native-inputs (list pkg-config python))
     (home-page "https://github.com/KhronosGroup/glslang")
     (synopsis "OpenGL and OpenGL ES shader front end and validator")
     (description
-- 
2.41.0