all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 2597f6d7011a78c690ddd844b12348504e07b130 28139 bytes (raw)
name: gnu/packages/vulkan.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018, 2023 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020, 2023 Marius Bakke <marius@gnu.org>
;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
;;; Copyright © 2022 Kaelyn Takata <kaelyn.alexi@protonmail.com>
;;; Copyright © 2022, 2024 dan <i@dan.games>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages vulkan)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix utils)
  #:use-module (guix gexp)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages bison)
  #:use-module (gnu packages check)
  #:use-module (gnu packages cmake)
  #:use-module (gnu packages cpp)
  #: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 version-control)
  #:use-module (gnu packages wine)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages xorg))

(define %vulkan-sdk-version "vulkan-sdk-1.3.275.0")

(define-public spirv-headers
  (package
    (name "spirv-headers")
    (version %vulkan-sdk-version)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/KhronosGroup/SPIRV-Headers")
             (commit version)))
       (sha256
        (base32 "18gr715ap9w1rjvzd6l9pl9lwfqiikm2la5apv2lplj4a0k5v3zw"))
       (file-name (git-file-name name version))))
    (build-system cmake-build-system)
    (arguments
     `(#:tests? #f)) ;no tests
    (home-page "https://github.com/KhronosGroup/SPIRV-Headers")
    (synopsis "Machine-readable files from the SPIR-V Registry")
    (description
     "SPIRV-Headers is a repository containing machine-readable files from
the SPIR-V Registry.  This includes:
@itemize
@item Header files for various languages.
@item JSON files describing the grammar for the SPIR-V core instruction set,
and for the GLSL.std.450 extended instruction set.
@item The XML registry file.
@end itemize
")
    (license (license:x11-style (string-append
                                 "https://github.com/KhronosGroup/SPIRV-Headers/blob/"
                                 version "/LICENSE")))))

(define-public spirv-tools
  (package
    (name "spirv-tools")
    (version %vulkan-sdk-version)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/KhronosGroup/SPIRV-Tools")
             (commit version)))
       (sha256
        (base32 "1hmfhvswg66x7x2ww5gj3mhgh59kgp7pwv36xagwyhbm7fhayca7"))
       (file-name (git-file-name name version))))
    (build-system cmake-build-system)
    (arguments
     `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
                               ;; Some packages like mpv fail to link
                               ;; when the static libraries are built.
                               "-DSPIRV_TOOLS_BUILD_STATIC=OFF"
                               (string-append "-DSPIRV-Headers_SOURCE_DIR="
                                              (assoc-ref %build-inputs
                                                         "spirv-headers")))))
    (inputs (list spirv-headers))
    (native-inputs (list pkg-config python))
    (home-page "https://github.com/KhronosGroup/SPIRV-Tools")
    (synopsis "API and commands for processing SPIR-V modules")
    (description
     "The SPIR-V Tools project provides an API and commands for processing
SPIR-V modules.  The project includes an assembler, binary module
parser,disassembler, validator, and optimizer for SPIR-V.")
    (license license:asl2.0)))

(define-public spirv-cross
  (package
    (name "spirv-cross")
    (version %vulkan-sdk-version)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/KhronosGroup/SPIRV-Cross")
             (commit version)))
       (sha256
        (base32 "0zdpgj0lv8kqzcna7y44qdjvxjifaxmmmcar835y4cdr35izf6ij"))
       (file-name (git-file-name name version))))
    (build-system cmake-build-system)
    (arguments
     `(#:configure-flags (list "-DSPIRV_CROSS_SHARED=YES")
       #:phases (modify-phases %standard-phases
                  (add-after 'unpack 'fix-tests-to-find-deps
                    (lambda* (#:key inputs #:allow-other-keys)
                      (substitute* "CMakeLists.txt"
                        (("\\$\\{CMAKE_(.*)_DIR\\}/external/glslang(.*)/bin")
                         (string-append (assoc-ref inputs "glslang") "/bin")))
                      (substitute* "CMakeLists.txt"
                        (("\\$\\{CMAKE_(.*)_DIR\\}/external/spirv-tools(.*)/bin")
                         (string-append (assoc-ref inputs "spirv-tools")
                                        "/bin")))))
                  (add-before 'check 'update-reference-shaders
                    (lambda _
                      (with-directory-excursion "../source"
                        (invoke "./update_test_shaders.sh")))))))
    (inputs (list glslang spirv-headers spirv-tools))
    (native-inputs (list python))
    (home-page "https://github.com/KhronosGroup/SPIRV-Cross")
    (synopsis "Parser for and converter of SPIR-V to other shader languages")
    (description
     "SPIRV-Cross tries hard to emit readable and clean output from the
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")
    (version %vulkan-sdk-version)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/KhronosGroup/glslang")
             (commit version)))
       (sha256
        (base32 "15xf1p9wwyvcps2kbyfiqnch3x2a1a9bd9aixq2y4yv9ir9hhhpf"))
       (file-name (git-file-name name version))))
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
                           "-DALLOW_EXTERNAL_SPIRV_TOOLS=ON")
       #:phases (modify-phases %standard-phases
                  (replace 'check
                    (lambda* (#:key tests? #:allow-other-keys)
                      (when tests?
                        (invoke "ctest")))))))
    (inputs (list spirv-tools))
    (native-inputs (list pkg-config python))
    (home-page "https://github.com/KhronosGroup/glslang")
    (synopsis "OpenGL and OpenGL ES shader front end and validator")
    (description
     "Glslang is the official reference compiler front end for the
OpenGL@tie{}ES and OpenGL shading languages.  It implements a strict
interpretation of the specifications for these languages.")
    ;; Modified BSD license. See "copyright" section of
    ;; https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/
    (license (list license:bsd-3
                   ;; include/SPIRV/{bitutils,hex_float}.h are Apache 2.0.
                   license:asl2.0))))

(define-public vulkan-headers
  (package
    (name "vulkan-headers")
    (version %vulkan-sdk-version)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/KhronosGroup/Vulkan-Headers")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1ihzbn6aw20i40mlqv2ys3xw1g9ld79890a0bm7wpqmbp67s84wh"))))
    (build-system cmake-build-system)
    (arguments
     `(#:tests? #f)) ;No tests.
    (home-page "https://github.com/KhronosGroup/Vulkan-Headers")
    (synopsis "Vulkan Header files and API registry")
    (description
     "Vulkan-Headers contains header files and API registry for Vulkan.")
    (license (list license:asl2.0)))) ;LICENSE.txt

(define-public vulkan-loader
  (package
    (name "vulkan-loader")
    (version %vulkan-sdk-version)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/KhronosGroup/Vulkan-Loader")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0kcq6xsm151mk08vvqjlhj5mfxv4zgq35a2yi4f7yax20mfd8wz7"))))
    (build-system cmake-build-system)
    (arguments
     (list
      ;; As many as 23 tests are expected to fail per architecture.
      ;; Limit the tests to those architectures tested upstream.
      #:tests? (and (%current-system)
                    (target-x86?))
      #:configure-flags #~(list (string-append "-DVULKAN_HEADERS_INSTALL_DIR="
                                 (dirname (dirname (search-input-directory
                                                    %build-inputs
                                                    "include/vulkan"))))
                                #$@(if (%current-target-system)
                                       #~("-DBUILD_TESTS=OFF" "-DUSE_GAS=OFF")
                                       #~("-DBUILD_TESTS=ON")))
      #:phases #~(modify-phases %standard-phases
                   (add-after 'unpack 'fix-pkg-config-file
                     (lambda* (#:key inputs #:allow-other-keys)
                       (let ((vulkan-headers (dirname (search-input-directory
                                                       inputs "include/vulkan"))))
                         ;; Ensure the pkg-config file refers to vulkan-headers.
                         (substitute* "loader/vulkan.pc.in"
                           (("^includedir=.*")
                            (string-append "includedir=" vulkan-headers "\n"))))))
                   (add-after 'unpack 'use-system-googletest
                     (lambda _
                       (substitute* "tests/CMakeLists.txt"
                         (("message\\(FATAL_ERROR \"Could not find googletest directory. See BUILD.md\"\\)")
                          "find_package(GTest REQUIRED)"))
                       ;; Use the namespaced variable.
                       (substitute* "tests/framework/CMakeLists.txt"
                         (("PUBLIC gtest ")
                          "PUBLIC GTest::gtest ")))))))
    (native-inputs (list googletest libxrandr pkg-config python wayland))
    (inputs (list vulkan-headers libxrandr))
    (native-search-paths
     (list (search-path-specification
            (variable "XDG_DATA_DIRS")
            (files '("share")))))
    (home-page "https://github.com/KhronosGroup/Vulkan-Loader")
    (synopsis "Khronos official ICD loader and validation layers for Vulkan")
    (description
     "Vulkan allows multiple @dfn{Installable Client Drivers} (ICDs) each
supporting one or more devices to be used collectively.  The loader is
responsible for discovering available Vulkan ICDs on the system and inserting
Vulkan layer libraries, including validation layers between the application
and the ICD.")
    ;; This software is mainly Apache 2.0 licensed, but contains some components
    ;; covered by other licenses.  See COPYRIGHT.txt for details.
    (license (list license:asl2.0 ;LICENSE.txt
                   (license:x11-style "file://COPYRIGHT.txt") license:bsd-3))))

(define-public vulkan-tools
  (package
    (name "vulkan-tools")
    (version %vulkan-sdk-version)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/KhronosGroup/Vulkan-Tools")
             (commit version)))
       (file-name (git-file-name name version))
       (modules '((guix build utils)))
       (snippet #~(substitute* "tests/icd/mock_icd_tests.cpp"
                    ;; Disable driver info test since it relies on git branch info
                    (("ASSERT_EQ\\(std::string\\(driver_properties\\.driverInfo\\)")
                     "// ASSERT_EQ(std::string(driver_properties.driverInfo)")))
       (sha256
        (base32 "0g604gzzlqibnkjd18iss6iwn852nnsfrrgfnwn97khpr0xk1h6j"))))
    (build-system cmake-build-system)
    (inputs (list glslang libxrandr vulkan-loader wayland wayland-protocols))
    (native-inputs (list googletest pkg-config python volk vulkan-headers))
    (arguments
     `(#:configure-flags (list "-DBUILD_TESTS=ON")
       #:phases (modify-phases %standard-phases
                  (replace 'check
                    (lambda* (#:key tests? #:allow-other-keys)
                      (when tests?
                        (invoke "./tests/vulkan_tools_tests")))))))
    (home-page "https://github.com/KhronosGroup/Vulkan-Tools")
    (synopsis "Tools and utilities for Vulkan")
    (description
     "Vulkan-Tools provides tools and utilities that can assist development by
enabling developers to verify their applications correct use of the Vulkan
API.")
    (license (list license:asl2.0)))) ;LICENSE.txt

(define-public shaderc
  (package
    (name "shaderc")
    ;; shaderc doesn't follow the versioning scheme of vulkan sdk
    (version "2023.8")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/google/shaderc")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0cs36p1y2269gjfv75fvs43ymsapmc8gsy2n91jnaqs3mpgqkjbk"))))
    (build-system cmake-build-system)
    (arguments
     `(;; FIXME: Skip most of the tests, because enabling system gtest breaks
       ;; the build: <https://github.com/google/shaderc/issues/470>.
       #:configure-flags (list "-DSHADERC_SKIP_TESTS=ON"
                               ;; These two flags are copied from:
                               ;; https://sdk.lunarg.com/sdk/download/1.3.275.0/linux/config.json
                               "-DSHADERC_ENABLE_SHARED_CRT=ON"
                               "-DSHADERC_SKIP_COPYRIGHT_CHECK=ON"
                               "-DPYTHON_EXECUTABLE=python3"
                               ;; Note: despite the name, this just specifies the headers.
                               (string-append "-Dglslang_SOURCE_DIR="
                                              (assoc-ref %build-inputs
                                                         "glslang")
                                              "/include/glslang"))
       #:phases (modify-phases %standard-phases
                  (add-after 'unpack 'do-not-look-for-bundled-sources
                    (lambda _
                      (substitute* "CMakeLists.txt"
                        (("add_subdirectory\\(third_party\\)")
                         ""))

                      (substitute* "glslc/test/CMakeLists.txt"
                        (("\\$<TARGET_FILE:spirv-dis>")
                         (which "spirv-dis")))

                      ;; Do not attempt to use git to encode version information.
                      (substitute* "glslc/CMakeLists.txt"
                        (("add_dependencies\\(glslc_exe build-version\\)")
                         ""))
                      (call-with-output-file "glslc/src/build-version.inc"
                        (lambda (port)
                          (format port "\"~a\"\n\"~a\"\n\"~a\"~%"
                                  ,version
                                  ,(package-version spirv-tools)
                                  ,(package-version glslang))))
                      #t)))))
    (inputs (list glslang spirv-headers spirv-tools))
    (native-inputs (list pkg-config python))
    (home-page "https://github.com/google/shaderc")
    (synopsis "Tools for shader compilation")
    (description "Shaderc is a collection of tools, libraries, and tests for
shader compilation.")
    (license license:asl2.0)))

(define-public vkd3d
  (let ((commit "56cd4a94d541707959ce7677af6d1a34739e5579")) ; Release 1.2.
    (package
     (name "vkd3d")
     (version "1.2")
     (source
      (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://source.winehq.org/git/vkd3d.git")
             (commit commit)))
       (sha256
        (base32
         "1n4a622drgnprvz5hjxzyzcsg2lp5rlf1sajki2vzf5gsx6fdpk8"))
       (file-name (string-append name "-" version "-checkout"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags '("--with-spirv-tools")
        #:phases (modify-phases %standard-phases
                   (add-after 'unpack 'patch-for-new-vulkan
                     (lambda _
                       ;; Mimic upstream commit 8e7bf8a5c3e0047 for
                       ;; compatibility with newer vulkan-headers.
                       (substitute* "libs/vkd3d/vkd3d_private.h"
                         (("VK_PIPELINE_BIND_POINT_RANGE_SIZE")
                          "2u"))
                       #t)))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
        ("gettext" ,gettext-minimal)
        ("libtool" ,libtool)
        ("pkg-config" ,pkg-config)))
     (inputs
      (list libx11
            libxcb
            spirv-headers
            spirv-tools
            vulkan-headers
            vulkan-loader
            wine-minimal ; Needed for 'widl'.
            xcb-util
            xcb-util-keysyms
            xcb-util-wm))
     (home-page "https://source.winehq.org/git/vkd3d.git/")
     (synopsis "Direct3D 12 to Vulkan translation library")
     (description "vkd3d is a library for translating Direct3D 12 to Vulkan.")
     (license license:lgpl2.1))))

(define-public vulkan-validationlayers
  (package
    (name "vulkan-validationlayers")
    (version %vulkan-sdk-version)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/KhronosGroup/Vulkan-ValidationLayers")
             (commit version)))
       (file-name (git-file-name name version))
       (modules '((guix build utils)))
       ;; We don't build static libraries in SPIRV-Tools.
       (snippet '(substitute* "tests/CMakeLists.txt"
                   (("-static")
                    "")))
       (sha256
        (base32 "0j39j43siz6jwqai8miy0hgcz5b4lln9xfhk1vzds21kgn17r744"))))
    (build-system cmake-build-system)
    (inputs (list glslang
                  libxrandr
                  mesa
                  robin-hood-hashing
                  shaderc
                  spirv-tools
                  vulkan-loader
                  vulkan-utility-libraries
                  wayland))
    (native-inputs (list pkg-config python spirv-headers vulkan-headers))
    (arguments
     (list
      #:tests? #f ;Tests requires GPU driver
      #:phases #~(modify-phases %standard-phases
                   (add-after 'install 'set-layer-path-in-manifest
                     (lambda _
                       (let ((manifest (string-append #$output
                                        "/share/vulkan/explicit_layer.d"
                                        "/VkLayer_khronos_validation.json")))
                         (substitute* manifest
                           (("\"libVkLayer_khronos_validation.so\"")
                            (string-append "\""
                             #$output
                             "/lib/libVkLayer_khronos_validation.so\"")))))))))
    (home-page "https://github.com/KhronosGroup/Vulkan-ValidationLayers")
    (synopsis "Khronos official validation layers for Vulkan")
    (description
     "Vulkan-ValidationLayers provides the Khronos official validation layers that
can assist development by enabling developers to verify their applications correctly
use the Vulkan API.")
    (license license:asl2.0)))

(define-public volk
  (package
    (name "volk")
    (version %vulkan-sdk-version)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/zeux/volk")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1zmr3wy0hc1hpwyifvjyxxfs7vc4ipqrfj0mav7cjdq6jf0cnf5r"))))
    (build-system cmake-build-system)
    (arguments
     '(#:tests? #f ;no test
       #:configure-flags '("-DVOLK_INSTALL=ON" "-DVOLK_PULL_IN_VULKAN=ON")))
    (inputs (list vulkan-headers))
    (synopsis "Meta loader for Vulkan API")
    (description
     "Volk is a meta-loader for Vulkan.  It allows you to dynamically load
entrypoints required to use Vulkan without linking the Vulkan loader.
Additionally, volk simplifies the use of Vulkan extensions by automatically
loading all associated entrypoints.  Finally, volk enables loading Vulkan
entrypoints directly from the driver which can increase performance by
skipping loader dispatch overhead.")
    (home-page "https://github.com/zeux/volk")
    (license license:expat)))

(define-public vulkan-memory-allocator
  (package
    (name "vulkan-memory-allocator")
    (version "3.0.1")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator")
         (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "1hpzjwl5bgqv9hmf1fdldihfllcbdg515f391a200klg0rnixdds"))))
    (build-system cmake-build-system)
    (arguments
     ;; no test
     `(#:tests? #f))
    (inputs (list vulkan-loader vulkan-headers))
    (synopsis "Vulkan memory allocation library")
    (description
     "The Vulkan Memory Allocator (VMA) library provides a simple and easy to
integrate API to help users allocate memory for Vulkan buffer and image
storage.")
    (home-page
     "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator")
    (license license:expat)))

(define-public vulkan-utility-libraries
  (package
    (name "vulkan-utility-libraries")
    (version %vulkan-sdk-version)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/KhronosGroup/Vulkan-Utility-Libraries")
             (commit version)))
       (sha256
        (base32 "11bqb18mvb9h7xv5d83b3mz43km7l1sa6jh47jir61pxfvwrmy42"))
       (file-name (git-file-name name version))))
    (build-system cmake-build-system)
    (arguments
     (list
      #:configure-flags #~(list "-DBUILD_TESTS=ON")))
    (inputs (list vulkan-headers))
    (native-inputs (list googletest magic-enum))
    (home-page "https://github.com/KhronosGroup/Vulkan-Utility-Libraries")
    (synopsis "Utility libraries for Vulkan developers")
    (description "Utility libraries for Vulkan developers.")
    (license license:asl2.0)))

;; directx-shader-compiler depends on an old version of directx-headers.
(define directx-headers-for-dxc
  (let ((commit "980971e835876dc0cde415e8f9bc646e64667bf7")
        (revision "115"))
    (origin
      (method git-fetch)
      (uri (git-reference (url
                           "https://github.com/microsoft/DirectX-Headers.git")
                          (commit commit)))
      (file-name (git-file-name "directx-headers-for-dxc"
                                (git-version "0" revision commit)))
      (sha256 (base32 "0c7l2xdsbr132ga2nyqjhz9xa42dxvhh9idjxnl673mz5kab1j6h")))))

(define-public directx-shader-compiler
  ;; This commit drops the dependency on effcee.
  (let ((commit "5f7834de562eeda3689fba0824008e1bcd7958b8")
        (revision "0"))
    (package
      (name "directx-shader-compiler")
      (version "1.7.2308")
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/microsoft/DirectXShaderCompiler.git")
               (commit commit)))
         (file-name (git-file-name "directx-shader-compiler"
                                   (git-version version revision commit)))
         (sha256
          (base32 "0awnn5qb9hci3pprl6p84y4hlh6xibgsv0vwp6sm6n7wn71z2cb9"))
         (modules '((guix build utils)))
         (snippet '(substitute* "CMakeLists.txt"
                     (("add_subdirectory\\(external\\)")
                      "find_package(SPIRV-Tools REQUIRED)
find_package(SPIRV-Tools-opt CONFIG REQUIRED)")))))
      (build-system cmake-build-system)
      (arguments
       (list
        #:configure-flags #~(list "-G"
                             "Unix Makefiles"
                             "-C"
                             "../source/cmake/caches/PredefinedParams.cmake"
                             (string-append "-DSPIRV_HEADER_INCLUDE_DIR="
                                            #$(this-package-input
                                               "spirv-headers") "/include")
                             (string-append "-DSPIRV_TOOLS_INCLUDE_DIR="
                                            #$(this-package-input
                                               "spirv-tools") "/include")
                             (string-append "-DDIRECTX_HEADER_INCLUDE_DIR="
                                            #$directx-headers-for-dxc
                                            "/include"))
        #:phases #~(modify-phases %standard-phases
                     (replace 'install
                       (lambda* (#:key make-flags outputs #:allow-other-keys)
                         (apply invoke "make" "install-distribution"
                                make-flags))))))
      (inputs (list libxml2 spirv-headers spirv-tools))
      (native-inputs (list git python))
      (home-page "https://github.com/microsoft/DirectXShaderCompiler")
      (synopsis
       "Compiler and related tools used to compile High-Level Shader Language (HLSL)")
      (description
       "The DirectX Shader Compiler project includes a compiler and related
tools used to compile High-Level Shader Language (HLSL) programs into DirectX
Intermediate Language (DXIL) representation. Applications that make use of
DirectX for graphics, games, and computation can use it to generate shader
programs.")
      (license license:ncsa))))


debug log:

solving 2597f6d701 ...
found 2597f6d701 in https://yhetil.org/guix/cf35dd023dbe78296d8972113c03c9a221b25a7f.1709140055.git.i@dan.games/
found 599b0a47d3 in https://yhetil.org/guix/0af764f02fe999685998050a65aa66c341238d50.1709140055.git.i@dan.games/
found f8ffcddff3 in https://yhetil.org/guix/baf76c85e2751d6d157c16fa2f18dbbd00798fcb.1709140055.git.i@dan.games/
found 82bc87dcd6 in https://yhetil.org/guix/617d4147db2b9bb37b94514cb79aaebf1fb5d5d5.1709140055.git.i@dan.games/
found 807b0be8af in https://yhetil.org/guix/e243df7347ea70fe1d27c860e9a326dc0f3626e8.1709140055.git.i@dan.games/
found 8e162402fa in https://yhetil.org/guix/8f806fbbb811debf1f63899fc8a882b4ac8ec723.1709140055.git.i@dan.games/
found ea02d9887b in https://yhetil.org/guix/62d151e6c27c8f56ebaf6b034183a59483d3ab4c.1709140055.git.i@dan.games/
found 38f723bd91 in https://yhetil.org/guix/3e30ab660277e638f54846fab8c10ef298107114.1709140055.git.i@dan.games/
found 12baf52f92 in https://yhetil.org/guix/363af38c9a04e02d0ee1485732e7342ff551896d.1709140055.git.i@dan.games/
found 3b485901d8 in https://yhetil.org/guix/61fa2d39ac8f0fce6be8946887cd19d136b3d7fc.1709140055.git.i@dan.games/
found d29810f4c6 in https://yhetil.org/guix/c6c671c2036f69f04571e0ee7d3f74f38b2bb7c3.1709140055.git.i@dan.games/
found 2fb1884795 in https://yhetil.org/guix/6925020499c96ba08bb9cf59615c6ec96a4f24cd.1709140055.git.i@dan.games/
found 285d6be7f5 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 285d6be7f592a666e42f50658931908e783cda7f	gnu/packages/vulkan.scm

applying [1/12] https://yhetil.org/guix/6925020499c96ba08bb9cf59615c6ec96a4f24cd.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 285d6be7f5..2fb1884795 100644


applying [2/12] https://yhetil.org/guix/c6c671c2036f69f04571e0ee7d3f74f38b2bb7c3.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 2fb1884795..d29810f4c6 100644


applying [3/12] https://yhetil.org/guix/61fa2d39ac8f0fce6be8946887cd19d136b3d7fc.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index d29810f4c6..3b485901d8 100644


applying [4/12] https://yhetil.org/guix/363af38c9a04e02d0ee1485732e7342ff551896d.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 3b485901d8..12baf52f92 100644


applying [5/12] https://yhetil.org/guix/3e30ab660277e638f54846fab8c10ef298107114.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 12baf52f92..38f723bd91 100644


applying [6/12] https://yhetil.org/guix/62d151e6c27c8f56ebaf6b034183a59483d3ab4c.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 38f723bd91..ea02d9887b 100644


applying [7/12] https://yhetil.org/guix/8f806fbbb811debf1f63899fc8a882b4ac8ec723.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index ea02d9887b..8e162402fa 100644


applying [8/12] https://yhetil.org/guix/e243df7347ea70fe1d27c860e9a326dc0f3626e8.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 8e162402fa..807b0be8af 100644


applying [9/12] https://yhetil.org/guix/617d4147db2b9bb37b94514cb79aaebf1fb5d5d5.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 807b0be8af..82bc87dcd6 100644


applying [10/12] https://yhetil.org/guix/baf76c85e2751d6d157c16fa2f18dbbd00798fcb.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 82bc87dcd6..f8ffcddff3 100644


applying [11/12] https://yhetil.org/guix/0af764f02fe999685998050a65aa66c341238d50.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index f8ffcddff3..599b0a47d3 100644


applying [12/12] https://yhetil.org/guix/cf35dd023dbe78296d8972113c03c9a221b25a7f.1709140055.git.i@dan.games/
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 599b0a47d3..2597f6d701 100644

Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
Applied patch gnu/packages/vulkan.scm cleanly.
Checking patch gnu/packages/vulkan.scm...
1:725: new blank line at EOF.
+
Applied patch gnu/packages/vulkan.scm cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 2597f6d7011a78c690ddd844b12348504e07b130	gnu/packages/vulkan.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.