Subject: [bug#60571] [PATCH v2 2/4] gnu: Add spirv-tools-for-skia.

From: Nicolas Graves <[email-masked]>
Date: Sun, 27 Aug 2023 14:53:40 +0200

* gnu/packages/vulkan.scm (spirv-tools-for-skia): New variable.
---
 gnu/packages/vulkan.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index da83417dba..9f02b1d235 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -129,6 +129,29 @@ (define-public spirv-tools
 parser,disassembler, validator, and optimizer for SPIR-V.")
     (license license:asl2.0)))
 
+(define-public spirv-tools-for-skia
+  (package
+    (inherit spirv-tools)
+    (name "spirv-tools-for-skia")
+    (version %vulkan-sdk-skia-version)
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://skia.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0cp1amgylflh36nw3sy0cy7pf9bhhzykk3vxqwmgnxiryr65nhph"))))
+    (inputs (list spirv-headers-for-skia))
+    (native-inputs (list pkg-config python-wrapper))
+    (arguments
+     (list
+      #:configure-flags `(list "-DBUILD_SHARED_LIBS=ON"
+                               (string-append
+                                "-DSPIRV-Headers_SOURCE_DIR="
+                                (assoc-ref %build-inputs "spirv-headers-for-skia")))))))
+
 (define-public spirv-cross
   (package
     (name "spirv-cross")
-- 
2.41.0