Subject: [PATCH] gnu: vulkan-tools: Wrap binaries with LD_LIBRARY_PATH.

From: Sughosha <[email-masked]>
Date: Wed, 22 May 2024 15:06:19 +0530

This fixes not finding vulkan-loader.

* gnu/packages/vulkan.scm (vulkan-tools)[arguments]<#:phases>:
Wrap-binaries with LD_LIBRARY_PATH.

Change-Id: I9aaf1cf04f70f1da976fa84d2189ca2c01b9520f
---
 gnu/packages/vulkan.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 4c53a19aba..dcf97e98dd 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -368,7 +368,16 @@ (define-public vulkan-tools
                   (replace 'check
                     (lambda* (#:key tests? #:allow-other-keys)
                       (when tests?
-                        (invoke "./tests/vulkan_tools_tests")))))))
+                        (invoke "./tests/vulkan_tools_tests"))))
+                  (add-after 'install 'wrap-binaries
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (for-each
+                        (lambda (file)
+                          (wrap-program file
+                            `("LD_LIBRARY_PATH" ":" =
+                               (,(getenv "LIBRARY_PATH")))))
+                        (find-files (string-append (assoc-ref outputs "out")
+                                                   "/bin"))))))))
     (home-page
      "https://github.com/KhronosGroup/Vulkan-Tools")
     (synopsis "Tools and utilities for Vulkan")

base-commit: e9b25a6c6c626a560d28a1f732e6e5d362d584a4
-- 
2.41.0