unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: John Kehayias via Guix-patches via <guix-patches@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: nathan <nathan_mail@nborghese.com>,
	71109-done@debbugs.gnu.org, sughosha@disroot.org
Subject: bug#71109: [PATCH] gnu: vulkan-tools: Wrap binaries with LD_LIBRARY_PATH.
Date: Sat, 07 Sep 2024 01:32:04 +0000	[thread overview]
Message-ID: <878qw4l04v.fsf@protonmail.com> (raw)
In-Reply-To: <87bk47kujd.fsf@gnu.org>

Hi all,

On Wed, Jun 12, 2024 at 12:02 AM, Ludovic Courtès wrote:

> Hi,
>
> I spoke a bit too fast: given that many packages depend on
> ‘vulkan-headers’, this should be applied on a branch.
>
> Attached as the updated patches.
>
> John, could you apply them on the ‘mesa-updates’ branch?  (I realized
> there’s no formal ‘mesa’ team contrary to what I thought; perhaps there
> should be one?).
>
> Thanks,
> Ludo’.
>

My apologies for a being a bit slow here! I've included these patches on
mesa-updates (building now) and the full set of patches is tracked here:
https://issues.guix.gnu.org/73071  I have used vulkan on that branch
without issues so far.

And yes, I keep forgetting to make a formal team. I suppose it shouldn't
be a "mesa" team but a bit broader (graphics?).

I will close this as it is live on mesa-updates and hopefully merged
into master before long. (Otherwise I'm afraid it will be forgotten open
and it can be tested with the other updates, but please correct me if
this should remain open.)

Thanks everyone for your work here!
John

>>From 577a58ac4d23e7fa749fddb3007a3ad14c40f38d Mon Sep 17 00:00:00 2001
> Message-ID: <577a58ac4d23e7fa749fddb3007a3ad14c40f38d.1718143100.git.ludo@gnu.org>
> From: nathan <nathan_mail@nborghese.com>
> 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 <ludo@gnu.org>
> ---
>  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
>
>>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 <nathan_mail@nborghese.com>
> 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 <ludo@gnu.org>
> ---
>  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





      reply	other threads:[~2024-09-07  1:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22  9:36 [bug#71109] [PATCH] gnu: vulkan-tools: Wrap binaries with LD_LIBRARY_PATH Sughosha via Guix-patches via
2024-05-26 18:51 ` Kaelyn via Guix-patches via
2024-05-31 10:38 ` Ludovic Courtès
2024-05-31 15:21   ` Sughosha via Guix-patches via
2024-05-31 16:47   ` Kaelyn via Guix-patches via
2024-06-02  1:19 ` nathan via Guix-patches via
2024-06-11 21:27   ` bug#71109: " Ludovic Courtès
2024-06-11 22:02   ` [bug#71109] " Ludovic Courtès
2024-09-07  1:32     ` John Kehayias via Guix-patches via [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878qw4l04v.fsf@protonmail.com \
    --to=guix-patches@gnu.org \
    --cc=71109-done@debbugs.gnu.org \
    --cc=john.kehayias@protonmail.com \
    --cc=ludo@gnu.org \
    --cc=nathan_mail@nborghese.com \
    --cc=sughosha@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).