[PATCH core-updates] gnu: mesa: Fix library paths in Vulkan layer manifests.

  • Open
  • quality assurance status badge
Details
2 participants
  • Kaelyn Takata
  • Bruno Victal
Owner
unassigned
Submitted by
Kaelyn Takata
Severity
normal
K
K
Kaelyn Takata wrote on 21 Nov 2022 20:09
(address . guix-patches@gnu.org)(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)
4782cd33fae4a0f5e120dab213753d9d51b6d94a.1669057759.git.kaelyn.alexi@protonmail.com
* gnu/packages/gl.scm (mesa): Fix library paths in Vulkan layer manifests.
---
gnu/packages/gl.scm | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)

Toggle diff (36 lines)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index dd62fac13e..c26a51cb32 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -488,7 +488,28 @@ (define-public mesa
file)
(symlink reference file)))
others))))
- (delete-duplicates inodes))))))))
+ (delete-duplicates inodes)))))
+ (add-after 'install 'set-layer-path-in-manifests
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (implicit-path (string-append
+ out
+ "/share/vulkan/implicit_layer.d/"))
+ (explicit-path (string-append
+ out
+ "/share/vulkan/explicit_layer.d/"))
+ (fix-layer-path
+ (lambda (layer-name)
+ (let* ((explicit (string-append explicit-path layer-name ".json"))
+ (implicit (string-append implicit-path layer-name ".json"))
+ (manifest (if (file-exists? explicit)
+ explicit
+ implicit)))
+ (substitute* manifest
+ (((string-append "\"lib" layer-name ".so\""))
+ (string-append "\"" out "/lib/lib" layer-name ".so\"")))))))
+ (for-each fix-layer-path '("VkLayer_MESA_device_select"
+ "VkLayer_MESA_overlay"))))))))
(home-page "https://mesa3d.org/")
(synopsis "OpenGL and Vulkan implementations")
(description "Mesa is a free implementation of the OpenGL and Vulkan

base-commit: affaacf4f46639dcc8239a438cad11c2a6ef6c9a
--
2.38.1
K
K
Kaelyn wrote on 21 Jan 16:41 +0100
(name . guix-devel)(address . guix-devel@gnu.org)(name . 59453@debbugs.gnu.org)(address . 59453@debbugs.gnu.org)
4dVVGwu7NrOi7vgSSPfIRkP6EzAItjcM6cvsIsi6Cv1QnhDjpXdvFOlTOKq8nShmNEVvogtz3vmRdl-dd-sD2yfv7qLPlrvvxa4LBb20_88=@protonmail.com
Hi Guix devs,

Now that it's been a couple of months, I wanted to bump my core-updates patch to Mesa which fixes the library paths in Mesa's Vulkan layer manifest files (https://issues.guix.gnu.org/59453).The patch also resolves https://issues.guix.gnu.org/58251.

Cheers,
Kaelyn
B
B
Bruno Victal wrote on 21 Jan 17:16 +0100
(name . Kaelyn Takata)(address . kaelyn.alexi@protonmail.com)(address . 59453@debbugs.gnu.org)
193fa946-8ac2-823d-78fd-6210199cf804@makinata.eu
On 2022-11-21 19:09, Kaelyn Takata via Guix-patches via wrote:
Toggle quote (19 lines)
> * gnu/packages/gl.scm (mesa): Fix library paths in Vulkan layer manifests.
> ---
> gnu/packages/gl.scm | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
> index dd62fac13e..c26a51cb32 100644
> --- a/gnu/packages/gl.scm
> +++ b/gnu/packages/gl.scm
> @@ -488,7 +488,28 @@ (define-public mesa
> file)
> (symlink reference file)))
> others))))
> - (delete-duplicates inodes))))))))
> + (delete-duplicates inodes)))))
> + (add-after 'install 'set-layer-path-in-manifests
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let* ((out (assoc-ref outputs "out"))

Using G-Expressions would be better here, since you're modifying this package,
you could take the opportunity to modernize/rewrite this package definition using G-Expressions.
(Keep the rewrite and this fix in separate commits)

Toggle quote (30 lines)
> + (implicit-path (string-append
> + out
> + "/share/vulkan/implicit_layer.d/"))
> + (explicit-path (string-append
> + out
> + "/share/vulkan/explicit_layer.d/"))
> + (fix-layer-path
> + (lambda (layer-name)
> + (let* ((explicit (string-append explicit-path layer-name ".json"))
> + (implicit (string-append implicit-path layer-name ".json"))
> + (manifest (if (file-exists? explicit)
> + explicit
> + implicit)))
> + (substitute* manifest
> + (((string-append "\"lib" layer-name ".so\""))
> + (string-append "\"" out "/lib/lib" layer-name ".so\"")))))))
> + (for-each fix-layer-path '("VkLayer_MESA_device_select"
> + "VkLayer_MESA_overlay"))))))))
> (home-page "https://mesa3d.org/")
> (synopsis "OpenGL and Vulkan implementations")
> (description "Mesa is a free implementation of the OpenGL and Vulkan
>
> base-commit: affaacf4f46639dcc8239a438cad11c2a6ef6c9a
> --
> 2.38.1
>
>
>
>
>
?