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

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

* gnu/packages/vulkan.scm (vulkan-validationlayers): Update to
vulkan-sdk-1.3.275.0.
  [source]: Add snippet.
  [inputs]: Add robin-hood-hashing and vulkan-utility-libraries.
  [arguments]: Remove configure-flags and update the reason why disable tests.

Change-Id: I01e25a974a0d4b4c672a621e07c46bdb17baab42
---
 gnu/packages/vulkan.scm | 74 +++++++++++++++++------------------------
 1 file changed, 30 insertions(+), 44 deletions(-)

diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index f8ffcddff3..599b0a47d3 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -37,6 +37,7 @@ (define-module (gnu packages vulkan)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gl)
@@ -453,60 +454,45 @@ (define-public vulkan-validationlayers
   (package
     (name "vulkan-validationlayers")
     (version %vulkan-sdk-version)
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url
-                     "https://github.com/KhronosGroup/Vulkan-ValidationLayers")
-                    (commit version)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "07djrk6yym4vl2b52wr09r8y649v5lark5hnr5rwvlxwxdmd9g75"))))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/KhronosGroup/Vulkan-ValidationLayers")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (modules '((guix build utils)))
+       ;; We don't build static libraries in SPIRV-Tools.
+       (snippet '(substitute* "tests/CMakeLists.txt"
+                   (("-static")
+                    "")))
+       (sha256
+        (base32 "0j39j43siz6jwqai8miy0hgcz5b4lln9xfhk1vzds21kgn17r744"))))
     (build-system cmake-build-system)
     (inputs (list glslang
                   libxrandr
                   mesa
+                  robin-hood-hashing
                   shaderc
                   spirv-tools
                   vulkan-loader
+                  vulkan-utility-libraries
                   wayland))
     (native-inputs (list pkg-config python spirv-headers vulkan-headers))
     (arguments
-     (list #:tests? #f ;no tests
-           #:configure-flags
-           #~(list "-DUSE_ROBIN_HOOD_HASHING=OFF"
-                   (string-append "-DGLSLANG_INSTALL_DIR="
-                                  (dirname (dirname
-                                            (search-input-directory
-                                             %build-inputs
-                                             "include/glslang"))))
-                   (string-append "-DSPIRV_HEADERS_INSTALL_DIR="
-                                  (dirname (dirname
-                                            (search-input-directory
-                                             %build-inputs
-                                             "include/spirv"))))
-                   (string-append "-DSPIRV_TOOLS_INSTALL_DIR="
-                                  (dirname (dirname
-                                            (search-input-directory
-                                             %build-inputs
-                                             "include/spirv-tools"))))
-                   (string-append "-DVULKAN_HEADERS_INSTALL_DIR="
-                                  (dirname (dirname
-                                            (search-input-directory
-                                             %build-inputs
-                                             "include/vulkan"))))
-                   "-Wno-dev")
-           #:phases #~(modify-phases %standard-phases
-                        (add-after 'install 'set-layer-path-in-manifest
-                          (lambda _
-                            (let ((manifest (string-append #$output
-                                             "/share/vulkan/explicit_layer.d"
-                                             "/VkLayer_khronos_validation.json")))
-                              (substitute* manifest
-                                (("\"libVkLayer_khronos_validation.so\"")
-                                 (string-append "\"" #$output
-                                  "/lib/libVkLayer_khronos_validation.so\"")))))))))
+     (list
+      #:tests? #f ;Tests requires GPU driver
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'install 'set-layer-path-in-manifest
+                     (lambda _
+                       (let ((manifest (string-append #$output
+                                        "/share/vulkan/explicit_layer.d"
+                                        "/VkLayer_khronos_validation.json")))
+                         (substitute* manifest
+                           (("\"libVkLayer_khronos_validation.so\"")
+                            (string-append "\""
+                             #$output
+                             "/lib/libVkLayer_khronos_validation.so\"")))))))))
     (home-page "https://github.com/KhronosGroup/Vulkan-ValidationLayers")
     (synopsis "Khronos official validation layers for Vulkan")
     (description
-- 
2.41.0