* gnu/packages/vulkan.scm (vulkan-validationlayers): New variable.
---
gnu/packages/vulkan.scm | 62 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
Toggle diff (70 lines)
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 14cdecaeee..384cc218a9 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -393,3 +393,65 @@ (define-public vkd3d
(synopsis "Direct3D 12 to Vulkan translation library")
(description "vkd3d is a library for translating Direct3D 12 to Vulkan.")
(license license:lgpl2.1))))
+
+(define-public vulkan-validationlayers
+ (package
+ (name "vulkan-validationlayers")
+ (version "1.3.224.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url
+ "https://github.com/KhronosGroup/Vulkan-ValidationLayers")
+ (commit (string-append "sdk-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "06jzris7a1dq3w5mrp4md2gxs3pfrqgvadm55mbjvmk5bhp3jfp5"))))
+ (build-system cmake-build-system)
+ (inputs (list glslang
+ libxrandr
+ mesa
+ shaderc
+ spirv-tools
+ vulkan-loader
+ 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="
+ #$glslang)
+ (string-append
+ "-DSPIRV_HEADERS_INSTALL_DIR="
+ #$spirv-headers)
+ (string-append
+ "-DSPIRV_TOOLS_INSTALL_DIR="
+ #$spirv-tools)
+ (string-append
+ "-DVULKAN_HEADERS_INSTALL_DIR="
+ #$vulkan-headers)
+ "-Wno-dev")
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'install 'set-layer-path-in-manifest
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (manifest (string-append out
+ "/share/vulkan/explicit_layer.d"
+ "/VkLayer_khronos_validation.json")))
+ (substitute* manifest
+ (("\"libVkLayer_khronos_validation.so\"")
+ (string-append "\"" out
+ "/lib/libVkLayer_khronos_validation.so\"")))))))))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "VK_ADD_LAYER_PATH")
+ (files '("share/vulkan/implicit_layer.d"
+ "share/vulkan/explicit_layer.d")))))
+ (home-page "https://github.com/KhronosGroup/Vulkan-ValidationLayers")
+ (synopsis "Khronos official validation layers for Vulkan")
+ (description
+ "Vulkan-ValidationLayers provides the Khronos official validation layers that
+can assist development by enabling developers to verify their applications correctly
+use the Vulkan API.")
+ (license license:asl2.0))) ;LICENSE.txt