From 2cb9899209d1807cd18e9ed68a634faca48c6d89 Mon Sep 17 00:00:00 2001 Message-ID: <2cb9899209d1807cd18e9ed68a634faca48c6d89.1718143100.git.ludo@gnu.org> In-Reply-To: <577a58ac4d23e7fa749fddb3007a3ad14c40f38d.1718143100.git.ludo@gnu.org> References: <577a58ac4d23e7fa749fddb3007a3ad14c40f38d.1718143100.git.ludo@gnu.org> From: nathan Date: Sat, 1 Jun 2024 19:55:24 -0400 Subject: [PATCH 2/2] gnu: volk: Hard-code path of vulkan-loader for dynamic loading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now, we’d get: $ guix shell vulkan-tools -- vulkaninfo ERROR at /tmp/guix-build-vulkan-tools-1.3.280.0.drv-0/source/vulkaninfo/./vulkaninfo.h:412: Failed to initialize: Vulkan loader is not installed, not found, or failed to load. This patch fixes it and potentially for other programs as well. * gnu/packages/vulkan.scm (volk)[arguments]: use gexp. <#:phases>: Patch dlopen with libvulkan.so. [input]: Add vulkan-loader. Change-Id: I5ef0eb13d35e517b8947faddace641882a775b80 Co-authored-by: Ludovic Courtès --- gnu/packages/vulkan.scm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm index 5ff47be92e2..5d322f3ddb9 100644 --- a/gnu/packages/vulkan.scm +++ b/gnu/packages/vulkan.scm @@ -597,9 +597,19 @@ (define-public volk "0x4jhc8n9c4k8svmmcaxxs613xbsav7wam94gacddlm738cwp13v")))) (build-system cmake-build-system) (arguments - '(#:tests? #f ;no test - #:configure-flags '("-DVOLK_INSTALL=ON" "-DVOLK_PULL_IN_VULKAN=ON"))) - (inputs (list vulkan-headers)) + (list + #:tests? #f ;no test + #:configure-flags #~(list "-DVOLK_INSTALL=ON" "-DVOLK_PULL_IN_VULKAN=ON") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-loader-path + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "volk.c" + (("dlopen\\(\"libvulkan.so") + (string-append "dlopen(\"" + (search-input-file + inputs "/lib/libvulkan.so"))))))))) + (inputs (list vulkan-headers vulkan-loader)) (synopsis "Meta loader for Vulkan API") (description "Volk is a meta-loader for Vulkan. It allows you to dynamically load -- 2.45.1