Subject: [PATCH 2/4] gnu: Add vkroots.

From: dan <[email-masked]>
Date: Sun, 21 Apr 2024 16:29:30 +0800

* gnu/packages/vulkan.scm (vkroots): New variable.

Change-Id: I57dfea58254c9bcf001d2052156f2c17dde109c4
---
 gnu/packages/vulkan.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 23d0c72ee3..f3c6e619a8 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -32,6 +32,7 @@ (define-module (gnu packages vulkan)
   #:use-module (guix gexp)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bison)
@@ -634,3 +635,38 @@ (define-public vulkan-utility-libraries
     (synopsis "Utility libraries for Vulkan developers")
     (description "Utility libraries for Vulkan developers.")
     (license license:asl2.0)))
+
+(define-public vkroots
+  (let ((commit "d5ef31abc7cb5c69aee4bcb67b10dd543c1ff7ac")
+        (revision "0"))
+    (package
+      (name "vkroots")
+      (version (git-version "0.0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/Joshua-Ashton/vkroots")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32 "0g2mh8l0xzxzr4yjyafzv76n7jk9043dcbf5mpqwpwmjx88m5nc0"))))
+      (build-system meson-build-system)
+      (arguments (list #:phases #~(modify-phases %standard-phases
+                                    (add-after 'unpack 'patch-vulkan
+                                      (lambda _
+                                        (substitute* "gen/make_vkroots"
+                                          (("\\.\\.") (getcwd)))))
+                                    (add-before 'install 'gen-vkroots
+                                      (lambda _
+                                        (invoke "python3"
+                                                "../source/gen/make_vkroots"
+                                                "-x"
+                                                (string-append
+                                                 #$(this-package-native-input "vulkan-headers")
+                                                 "/share/vulkan/registry/vk.xml")))))))
+      (native-inputs (list python vulkan-headers))
+      (home-page "https://github.com/Joshua-Ashton/vkroots")
+      (synopsis "Simple method of making Vulkan layers")
+      (description "vkroots is a framework for writing Vulkan layers that
+takes all the complexity away from you.")
+      (license license:expat))))
-- 
2.41.0