summary refs log tree commit diff
path: root/gnu/packages/vulkan.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-11-30 12:33:17 +0200
committerEfraim Flashner <efraim@flashner.co.il>2023-11-30 12:33:17 +0200
commit0bf46a4fc8c8d2c9b7dfba1211e42d8af62a3b55 (patch)
tree54cbb348faf8bb159dfc80a81b698c76b5040db0 /gnu/packages/vulkan.scm
parentc34c3b1c2b1006ebeede016cca578d5f571fc7a8 (diff)
downloadguix-0bf46a4fc8c8d2c9b7dfba1211e42d8af62a3b55.tar.gz
gnu: Add spirv-llvm-translator.
* gnu/packages/vulkan.scm (spirv-llvm-translator): New variable.

Change-Id: I9e447b7d69c7fdf620854362ca8aa98a2dfa1c87
Diffstat (limited to 'gnu/packages/vulkan.scm')
-rw-r--r--gnu/packages/vulkan.scm33
1 files changed, 33 insertions, 0 deletions
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 1d2e58f1d4..ca771a30b1 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gl)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages wine)
@@ -152,6 +153,38 @@ parser,disassembler, validator, and optimizer for SPIR-V.")
 SPIR-V, aiming to emit GLSL or MSL that looks like human-written code.")
     (license license:asl2.0)))
 
+(define-public spirv-llvm-translator
+  (package
+    (name "spirv-llvm-translator")
+    (version "15.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/KhronosGroup/SPIRV-LLVM-Translator")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0lix3bpli7i9csz26bq0d9g1v7c0gim498m5bm2gp8kifj2yih1s"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags
+       (list (string-append "-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR="
+                            (assoc-ref %build-inputs "spirv-headers")
+                            "/include/spirv")
+             (string-append "-DLLVM_EXTERNAL_LIT="
+                            (assoc-ref %build-inputs "python-lit")
+                            "/bin/lit")
+             "-DLLVM_SPIRV_INCLUDE_TESTS=ON")))
+    (inputs (list llvm-15))
+    (native-inputs (list clang-15 llvm-15 python-lit spirv-headers))
+    (home-page "https://github.com/KhronosGroup/SPIRV-LLVM-Translator")
+    (synopsis "Bi-directional translation between SPIR-V and LLVM IR")
+    (description
+     "The LLVM/SPIR-V Bi-Directional Translator is a library and tool for
+translation between LLVM IR and SPIR-V.")
+    (license license:asl2.0)))
+
 (define-public glslang
   (package
     (name "glslang")