Subject: bug#71109: closed (Re: [bug#71109] [PATCH] gnu: vulkan-tools: Wrap binaries with LD_LIBRARY_PATH.)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 11 Jun 2024 21:31:02 +0000

Your bug report

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

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
71109: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71109
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#71109] [PATCH] gnu: vulkan-tools: Wrap binaries with LD_LIBRARY_PATH.
From: Ludovic Courtès <[email-masked]>
To: nathan <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Tue, 11 Jun 2024 23:27:43 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi nathan and all,

nathan <[email-masked]> skribis:

> From 811d7567098e00711ee4c9c80afbe544ebe1c08e Mon Sep 17 00:00:00 2001
> Message-ID: <811[email-masked]>
> From: nathan <[email-masked]>
> Date: Sat, 1 Jun 2024 21:14:13 -0400
> Subject: [PATCH] example of how to patch patch of vulkan-loader into
>  vulkan-headers
>
> Change-Id: Ic674a4d965d8049e388d75137111ed0253ca3b18

[...]

> From ee4581690b6486a65bf0e4faed3f2c88cac70d9e Mon Sep 17 00:00:00 2001
> Message-ID: <ee4[email-masked]>
> From: nathan <[email-masked]>
> Date: Sat, 1 Jun 2024 19:55:24 -0400
> Subject: [PATCH] gnu: volk: Hard-code path of vulkan-loader for dynamic
>  loading
>
> * gnu/packages/vulkan.scm (volk):
> [arguments]: use gexp.
> <#:phases>: patch dlopen with libvulkan.so. fixes vulkan-tools and potentially
> other programs too.
> [input]: add vulkan-loader
>
> Change-Id: I5ef0eb13d35e517b8947faddace641882a775b80

These two patches make sense to me.

I applied them with minor tweaks: using ‘search-input-file’ rather than
‘assoc-ref’ in build phases, and commit log modifications to match our
conventions.

Thank you!

Ludo’.

Subject: [PATCH] gnu: vulkan-tools: Wrap binaries with LD_LIBRARY_PATH.
From: Sughosha <[email-masked]>
To: [email-masked]
Cc: Sughosha <[email-masked]>
Date: Wed, 22 May 2024 15:06:19 +0530
List-Id: <debbugs-submit.debbugs.gnu.org>

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