From 577a58ac4d23e7fa749fddb3007a3ad14c40f38d Mon Sep 17 00:00:00 2001 Message-ID: <577a58ac4d23e7fa749fddb3007a3ad14c40f38d.1718143100.git.ludo@gnu.org> From: nathan Date: Sat, 1 Jun 2024 21:14:13 -0400 Subject: [PATCH 1/2] gnu: vulkan-headers: Hard-code libvulkan.so file name. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/vulkan.scm (vulkan-headers): Rename to… (vulkan-headers/no-loader): … this. (vulkan-headers): New variable. (vulkan-loader): Depend on ‘vulkan-headers/no-loader’. Change-Id: Ic674a4d965d8049e388d75137111ed0253ca3b18 Co-authored-by: Ludovic Courtès --- gnu/packages/vulkan.scm | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm index 25542c1e064..5ff47be92e2 100644 --- a/gnu/packages/vulkan.scm +++ b/gnu/packages/vulkan.scm @@ -246,7 +246,8 @@ (define-public glslang ;; include/SPIRV/{bitutils,hex_float}.h are Apache 2.0. license:asl2.0)))) -(define-public vulkan-headers +;; vulkan-headers, but without the path to vulkan-loader patched in. +(define-public vulkan-headers/no-loader (package (name "vulkan-headers") (version "1.3.280.0") @@ -263,6 +264,7 @@ (define-public vulkan-headers (build-system cmake-build-system) (arguments `(#:tests? #f)) ; No tests. + (properties '((hidden? . #t))) (home-page "https://github.com/KhronosGroup/Vulkan-Headers") (synopsis "Vulkan Header files and API registry") @@ -270,6 +272,25 @@ (define-public vulkan-headers "Vulkan-Headers contains header files and API registry for Vulkan.") (license (list license:asl2.0)))) ;LICENSE.txt +(define-public vulkan-headers + (package + (inherit vulkan-headers/no-loader) + (arguments + (substitute-keyword-arguments (package-arguments vulkan-headers/no-loader) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'patch-libvulkan-file-name + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "include/vulkan/vulkan.hpp" + (("dlopen\\( \"libvulkan.so") + (string-append "dlopen(\"" + (search-input-file + inputs "/lib/libvulkan.so")))))))))) + (inputs + (modify-inputs (package-inputs vulkan-headers/no-loader) + (prepend vulkan-loader))) + (properties '()))) + (define-public vulkan-loader (package (name "vulkan-loader") @@ -326,7 +347,7 @@ (define-public vulkan-loader python wayland)) (inputs - (list vulkan-headers libxrandr)) + (list vulkan-headers/no-loader libxrandr)) (native-search-paths (list (search-path-specification (variable "XDG_DATA_DIRS") base-commit: 7daf9328921f9f7d4fe4839d8e16091bd9f06072 -- 2.45.1