2017-12-08 12:39:16 +00:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2019-01-10 10:42:13 +00:00
|
|
|
;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
|
2019-09-11 18:54:34 +00:00
|
|
|
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
2024-04-04 13:26:50 +00:00
|
|
|
;;; Copyright © 2018, 2023, 2024 Efraim Flashner <efraim@flashner.co.il>
|
2023-01-08 19:58:53 +00:00
|
|
|
;;; Copyright © 2020, 2023 Marius Bakke <marius@gnu.org>
|
2021-09-22 09:59:48 +00:00
|
|
|
;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
|
2022-09-01 16:27:40 +00:00
|
|
|
;;; Copyright © 2022 Kaelyn Takata <kaelyn.alexi@protonmail.com>
|
2024-03-28 03:54:43 +00:00
|
|
|
;;; Copyright © 2022, 2024 dan <i@dan.games>
|
2023-12-30 05:31:36 +00:00
|
|
|
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
|
2017-12-08 12:39:16 +00:00
|
|
|
;;;
|
|
|
|
;;; 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)
|
2017-12-08 13:56:36 +00:00
|
|
|
#:use-module (guix download)
|
2017-12-08 12:39:16 +00:00
|
|
|
#:use-module (guix git-download)
|
2023-05-04 13:03:37 +00:00
|
|
|
#:use-module (guix utils)
|
2021-09-22 09:59:48 +00:00
|
|
|
#:use-module (guix gexp)
|
2017-12-08 12:39:16 +00:00
|
|
|
#:use-module (guix build-system cmake)
|
2018-06-11 09:14:28 +00:00
|
|
|
#:use-module (guix build-system gnu)
|
2017-12-08 13:56:36 +00:00
|
|
|
#:use-module (gnu packages)
|
2018-06-11 09:14:28 +00:00
|
|
|
#:use-module (gnu packages autotools)
|
2017-12-14 22:03:02 +00:00
|
|
|
#:use-module (gnu packages bison)
|
2018-06-11 08:08:50 +00:00
|
|
|
#:use-module (gnu packages check)
|
2018-01-31 14:26:18 +00:00
|
|
|
#:use-module (gnu packages cmake)
|
2024-03-28 03:54:53 +00:00
|
|
|
#:use-module (gnu packages cpp)
|
2017-12-08 15:06:05 +00:00
|
|
|
#:use-module (gnu packages freedesktop)
|
2018-06-11 09:14:28 +00:00
|
|
|
#:use-module (gnu packages gettext)
|
2017-12-08 15:06:05 +00:00
|
|
|
#:use-module (gnu packages gl)
|
2023-11-30 10:33:17 +00:00
|
|
|
#:use-module (gnu packages llvm)
|
2017-12-08 13:56:36 +00:00
|
|
|
#:use-module (gnu packages pkg-config)
|
2017-12-08 15:06:05 +00:00
|
|
|
#:use-module (gnu packages python)
|
2018-06-11 09:14:28 +00:00
|
|
|
#:use-module (gnu packages wine)
|
2017-12-08 15:06:05 +00:00
|
|
|
#:use-module (gnu packages xorg))
|
2017-12-08 12:39:16 +00:00
|
|
|
|
|
|
|
(define-public spirv-headers
|
2019-04-23 08:55:59 +00:00
|
|
|
(package
|
|
|
|
(name "spirv-headers")
|
2024-03-28 03:54:43 +00:00
|
|
|
(version "1.3.280.0")
|
2019-04-23 08:55:59 +00:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/KhronosGroup/SPIRV-Headers")
|
2024-03-28 03:54:43 +00:00
|
|
|
(commit (string-append "vulkan-sdk-" version))))
|
2019-04-23 08:55:59 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2024-03-28 03:54:43 +00:00
|
|
|
"17jw5gwj2vmicyd6522b1zp7x551krfj826j0fg5kl0ixv0q08wk"))
|
2020-05-22 12:37:13 +00:00
|
|
|
(file-name (git-file-name name version))))
|
2019-04-23 08:55:59 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(arguments
|
2020-05-22 12:37:13 +00:00
|
|
|
`(#:tests? #f)) ;no tests
|
2019-04-23 08:55:59 +00:00
|
|
|
(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
|
2017-12-08 12:39:16 +00:00
|
|
|
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\n")
|
2019-04-23 08:55:59 +00:00
|
|
|
(license (license:x11-style
|
|
|
|
(string-append "https://github.com/KhronosGroup/SPIRV-Headers/blob/"
|
|
|
|
version "/LICENSE")))))
|
2017-12-08 13:56:36 +00:00
|
|
|
|
|
|
|
(define-public spirv-tools
|
2019-03-06 07:59:00 +00:00
|
|
|
(package
|
|
|
|
(name "spirv-tools")
|
2024-03-28 03:54:44 +00:00
|
|
|
(version "1.3.280.0")
|
2019-03-06 07:59:00 +00:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/KhronosGroup/SPIRV-Tools")
|
2024-03-28 03:54:44 +00:00
|
|
|
(commit (string-append "vulkan-sdk-" version))))
|
2019-03-06 07:59:00 +00:00
|
|
|
(sha256
|
2024-03-28 03:54:44 +00:00
|
|
|
(base32 "1sj84ngwcgmydlj88nx1a9jfmhmxlij7wc92khp8wf1vsfplayas"))
|
2019-09-24 23:21:38 +00:00
|
|
|
(file-name (git-file-name name version))))
|
2019-03-06 07:59:00 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(arguments
|
2020-05-22 12:48:11 +00:00
|
|
|
`(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
|
2022-11-16 22:52:56 +00:00
|
|
|
;; Some packages like mpv fail to link
|
|
|
|
;; when the static libraries are built.
|
|
|
|
"-DSPIRV_TOOLS_BUILD_STATIC=OFF"
|
2020-05-22 12:48:11 +00:00
|
|
|
(string-append
|
|
|
|
"-DSPIRV-Headers_SOURCE_DIR="
|
|
|
|
(assoc-ref %build-inputs "spirv-headers")))))
|
2021-12-13 16:18:24 +00:00
|
|
|
(inputs (list spirv-headers))
|
|
|
|
(native-inputs (list pkg-config python))
|
2019-03-06 07:59:00 +00:00
|
|
|
(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)))
|
2017-12-14 22:03:02 +00:00
|
|
|
|
2020-06-29 10:06:49 +00:00
|
|
|
(define-public spirv-cross
|
|
|
|
(package
|
|
|
|
(name "spirv-cross")
|
2024-03-28 03:54:46 +00:00
|
|
|
(version "1.3.280.0")
|
2020-06-29 10:06:49 +00:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/KhronosGroup/SPIRV-Cross")
|
2024-03-28 03:54:46 +00:00
|
|
|
(commit (string-append "vulkan-sdk-" version))))
|
2020-06-29 10:06:49 +00:00
|
|
|
(sha256
|
2024-03-28 03:54:46 +00:00
|
|
|
(base32 "1k6fbkradknxis85akzzksz9ipm3v42xvrzaamwj2lrgfm8d6r4d"))
|
2020-06-29 10:06:49 +00:00
|
|
|
(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")
|
2023-01-03 15:48:20 +00:00
|
|
|
(string-append (assoc-ref inputs "spirv-tools") "/bin")))))
|
|
|
|
(add-before 'check 'update-reference-shaders
|
|
|
|
(lambda _
|
|
|
|
(with-directory-excursion "../source"
|
|
|
|
(invoke "./update_test_shaders.sh")))))))
|
2020-06-29 10:06:49 +00:00
|
|
|
(inputs
|
2021-12-13 16:18:24 +00:00
|
|
|
(list glslang spirv-headers spirv-tools))
|
|
|
|
(native-inputs (list python))
|
2020-06-29 10:06:49 +00:00
|
|
|
(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
|
2020-06-30 09:41:36 +00:00
|
|
|
SPIR-V, aiming to emit GLSL or MSL that looks like human-written code.")
|
2020-06-29 10:06:49 +00:00
|
|
|
(license license:asl2.0)))
|
|
|
|
|
2023-11-30 10:33:17 +00:00
|
|
|
(define-public spirv-llvm-translator
|
|
|
|
(package
|
|
|
|
(name "spirv-llvm-translator")
|
2024-05-01 19:25:44 +00:00
|
|
|
(version "18.1.0")
|
2023-11-30 10:33:17 +00:00
|
|
|
(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
|
2024-05-01 19:25:44 +00:00
|
|
|
(base32 "0yfz02mlnf4ffn67g2ms0w8f7jgdsn438w2dbxd5mvcf5dk2x27b"))))
|
2023-11-30 10:33:17 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(arguments
|
2024-06-03 06:57:32 +00:00
|
|
|
;; The test suite is known to fail on several architectures:
|
|
|
|
;; https://github.com/llvm/llvm-project/issues/59637
|
2024-06-03 06:57:32 +00:00
|
|
|
(list
|
|
|
|
#:tests? (and (not (%current-target-system))
|
|
|
|
(target-x86-64?))
|
2024-06-03 06:57:32 +00:00
|
|
|
#:configure-flags
|
2024-06-03 06:57:32 +00:00
|
|
|
#~(list (string-append "-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR="
|
|
|
|
#$(this-package-native-input "spirv-headers")
|
|
|
|
"/include/spirv")
|
|
|
|
(string-append "-DLLVM_EXTERNAL_LIT="
|
|
|
|
#$(this-package-native-input "python-lit")
|
|
|
|
"/bin/lit")
|
|
|
|
(string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
|
|
|
|
#$output "/lib")
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
|
|
|
"-DLLVM_SPIRV_INCLUDE_TESTS=ON")))
|
2024-05-01 19:25:44 +00:00
|
|
|
(inputs (list llvm-18))
|
|
|
|
(native-inputs (list clang-18 llvm-18 python-lit spirv-headers))
|
2023-11-30 10:33:17 +00:00
|
|
|
(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)))
|
|
|
|
|
2017-12-14 22:03:02 +00:00
|
|
|
(define-public glslang
|
2019-03-06 07:45:27 +00:00
|
|
|
(package
|
|
|
|
(name "glslang")
|
2024-03-28 03:54:45 +00:00
|
|
|
(version "1.3.280.0")
|
2019-03-06 07:45:27 +00:00
|
|
|
(source
|
|
|
|
(origin
|
2018-01-31 13:20:02 +00:00
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
2019-03-06 07:45:27 +00:00
|
|
|
(url "https://github.com/KhronosGroup/glslang")
|
2024-03-28 03:54:45 +00:00
|
|
|
(commit (string-append "vulkan-sdk-" version))))
|
2017-12-08 13:56:36 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2024-03-28 03:54:45 +00:00
|
|
|
"1vvgqvwhsimlz8wkk38b9cvp9abggq840iws8al0znzz3mnvkfdn"))
|
2022-11-15 15:15:56 +00:00
|
|
|
(file-name (git-file-name name version))))
|
2019-03-06 07:45:27 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(arguments
|
2024-04-04 13:26:50 +00:00
|
|
|
`(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"
|
|
|
|
"-DALLOW_EXTERNAL_SPIRV_TOOLS=ON"
|
|
|
|
,@(if (target-riscv64?)
|
|
|
|
`("-DCMAKE_EXE_LINKER_FLAGS=-latomic")
|
|
|
|
'()))
|
2024-03-28 03:54:45 +00:00
|
|
|
#:phases (modify-phases %standard-phases
|
2024-04-07 09:13:42 +00:00
|
|
|
,@(if (target-ppc32?)
|
|
|
|
`((add-after 'unpack 'skip-failing-test
|
|
|
|
(lambda _
|
|
|
|
;; TODO: Figure out why this test fails.
|
|
|
|
(substitute* "Test/runtests"
|
|
|
|
((".*remap\\.invalid" all)
|
|
|
|
(string-append "# " all))))))
|
|
|
|
'())
|
2024-03-28 03:54:45 +00:00
|
|
|
(replace 'check
|
2024-04-07 06:49:30 +00:00
|
|
|
(lambda* (#:key tests? parallel-tests? #:allow-other-keys)
|
2024-03-28 03:54:45 +00:00
|
|
|
(when tests?
|
2024-04-07 06:49:30 +00:00
|
|
|
(invoke "ctest"
|
|
|
|
"-j" (if parallel-tests?
|
|
|
|
(number->string (parallel-job-count))
|
|
|
|
"1")
|
|
|
|
"--rerun-failed"
|
|
|
|
"--output-on-failure")))))))
|
2024-03-28 03:54:45 +00:00
|
|
|
(inputs (list spirv-tools))
|
2020-05-22 12:57:57 +00:00
|
|
|
(native-inputs
|
2021-12-13 16:18:24 +00:00
|
|
|
(list pkg-config python))
|
2019-03-06 07:45:27 +00:00
|
|
|
(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
|
2017-12-14 22:03:02 +00:00
|
|
|
OpenGL@tie{}ES and OpenGL shading languages. It implements a strict
|
|
|
|
interpretation of the specifications for these languages.")
|
2019-03-06 07:45:27 +00:00
|
|
|
;; 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))))
|
2017-12-08 15:06:05 +00:00
|
|
|
|
2018-07-03 07:33:54 +00:00
|
|
|
(define-public vulkan-headers
|
|
|
|
(package
|
|
|
|
(name "vulkan-headers")
|
2024-03-28 03:54:48 +00:00
|
|
|
(version "1.3.280.0")
|
2018-07-03 07:33:54 +00:00
|
|
|
(source
|
|
|
|
(origin
|
2019-01-10 10:42:13 +00:00
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/KhronosGroup/Vulkan-Headers")
|
2024-03-28 03:54:48 +00:00
|
|
|
(commit (string-append "vulkan-sdk-" version))))
|
2019-02-21 07:38:10 +00:00
|
|
|
(file-name (git-file-name name version))
|
2018-07-03 07:33:54 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2024-03-28 03:54:48 +00:00
|
|
|
"13mmv5621z73hlfnsrccbcb4z0d7kwj92a081701vbpss45a4whj"))))
|
2018-07-03 07:33:54 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(arguments
|
2019-01-10 10:42:13 +00:00
|
|
|
`(#:tests? #f)) ; No tests.
|
2018-07-03 07:33:54 +00:00
|
|
|
(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
|
|
|
|
|
2018-06-06 07:59:15 +00:00
|
|
|
(define-public vulkan-loader
|
2017-12-08 15:06:05 +00:00
|
|
|
(package
|
2018-06-06 07:59:15 +00:00
|
|
|
(name "vulkan-loader")
|
2024-03-28 03:54:49 +00:00
|
|
|
(version "1.3.280.0")
|
2017-12-08 15:06:05 +00:00
|
|
|
(source
|
|
|
|
(origin
|
2019-01-10 10:42:13 +00:00
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/KhronosGroup/Vulkan-Loader")
|
2024-03-28 03:54:49 +00:00
|
|
|
(commit (string-append "vulkan-sdk-" version))))
|
2019-02-21 07:38:10 +00:00
|
|
|
(file-name (git-file-name name version))
|
2017-12-08 15:06:05 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2024-03-28 03:54:49 +00:00
|
|
|
"0glix3clqkdbi9kqcp8abmglqpgjd2r2bjqvi11r8sair0z54hnf"))))
|
2017-12-08 15:06:05 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(arguments
|
2022-11-20 19:56:27 +00:00
|
|
|
(list
|
2023-05-15 14:07:44 +00:00
|
|
|
;; 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?))
|
2022-11-20 19:56:27 +00:00
|
|
|
#:configure-flags
|
|
|
|
#~(list (string-append "-DVULKAN_HEADERS_INSTALL_DIR="
|
|
|
|
(dirname (dirname
|
|
|
|
(search-input-directory
|
|
|
|
%build-inputs "include/vulkan"))))
|
2023-12-30 05:31:36 +00:00
|
|
|
#$@(if (%current-target-system)
|
|
|
|
#~("-DBUILD_TESTS=OFF" "-DUSE_GAS=OFF")
|
|
|
|
#~("-DBUILD_TESTS=ON")))
|
2022-11-20 19:56:27 +00:00
|
|
|
#:phases
|
|
|
|
#~(modify-phases %standard-phases
|
2023-01-08 19:27:08 +00:00
|
|
|
(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"))))))
|
2023-01-08 19:58:53 +00:00
|
|
|
(add-after 'unpack 'use-system-googletest
|
|
|
|
(lambda _
|
2024-03-28 03:54:49 +00:00
|
|
|
(substitute* "tests/CMakeLists.txt"
|
|
|
|
(((string-append "message\\(FATAL_ERROR \"Could not "
|
|
|
|
"find googletest directory. See BUILD.md\"\\)"))
|
|
|
|
"find_package(GTest REQUIRED)"))
|
2023-01-08 19:58:53 +00:00
|
|
|
;; Use the namespaced variable.
|
|
|
|
(substitute* "tests/framework/CMakeLists.txt"
|
|
|
|
(("PUBLIC gtest ")
|
|
|
|
"PUBLIC GTest::gtest ")))))))
|
2020-05-22 14:57:46 +00:00
|
|
|
(native-inputs
|
2023-01-08 19:58:53 +00:00
|
|
|
(list googletest
|
2022-11-20 19:56:27 +00:00
|
|
|
libxrandr
|
|
|
|
pkg-config
|
|
|
|
python
|
|
|
|
wayland))
|
2021-09-22 09:59:48 +00:00
|
|
|
(inputs
|
2023-12-30 05:31:36 +00:00
|
|
|
(list vulkan-headers libxrandr))
|
2024-03-28 03:54:49 +00:00
|
|
|
(native-search-paths
|
|
|
|
(list (search-path-specification
|
|
|
|
(variable "XDG_DATA_DIRS")
|
|
|
|
(files '("share")))))
|
2017-12-08 15:06:05 +00:00
|
|
|
(home-page
|
2018-07-03 07:35:37 +00:00
|
|
|
"https://github.com/KhronosGroup/Vulkan-Loader")
|
2017-12-08 15:06:05 +00:00
|
|
|
(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))))
|
2018-01-31 14:26:18 +00:00
|
|
|
|
2018-07-07 20:38:37 +00:00
|
|
|
(define-public vulkan-tools
|
|
|
|
(package
|
|
|
|
(name "vulkan-tools")
|
2024-03-28 03:54:51 +00:00
|
|
|
(version "1.3.280.0")
|
2018-07-07 20:38:37 +00:00
|
|
|
(source
|
|
|
|
(origin
|
2019-01-10 10:42:13 +00:00
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/KhronosGroup/Vulkan-Tools")
|
2024-03-28 03:54:51 +00:00
|
|
|
(commit (string-append "vulkan-sdk-" version))))
|
2019-02-21 07:38:10 +00:00
|
|
|
(file-name (git-file-name name version))
|
2024-03-28 03:54:51 +00:00
|
|
|
(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)")))
|
2018-07-07 20:38:37 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2024-03-28 03:54:51 +00:00
|
|
|
"0w0m04vscr4a6vr682g3mn7mfni740cmai9ylzlgfdggb77y58xz"))))
|
2018-07-07 20:38:37 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(inputs
|
2022-11-19 15:02:45 +00:00
|
|
|
(list glslang libxrandr vulkan-loader wayland wayland-protocols))
|
2018-07-07 20:38:37 +00:00
|
|
|
(native-inputs
|
2024-03-28 03:54:51 +00:00
|
|
|
(list googletest pkg-config python volk vulkan-headers))
|
2018-07-07 20:38:37 +00:00
|
|
|
(arguments
|
2024-03-28 03:54:51 +00:00
|
|
|
`(#: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")))))))
|
2018-07-07 20:38:37 +00:00
|
|
|
(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
|
|
|
|
|
2018-01-31 14:26:18 +00:00
|
|
|
(define-public shaderc
|
2019-03-06 08:06:24 +00:00
|
|
|
(package
|
|
|
|
(name "shaderc")
|
2022-11-19 15:02:42 +00:00
|
|
|
;; shaderc doesn't follow the versioning scheme of vulkan sdk
|
2024-03-28 03:54:47 +00:00
|
|
|
(version "2024.0")
|
2019-03-06 08:06:24 +00:00
|
|
|
(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
|
2024-03-28 03:54:47 +00:00
|
|
|
"1m5jncn6y8c6g83f8nwh86hz33mvv03x7fyr5zq0ynwanrcpn2hb"))))
|
2020-05-22 15:38:36 +00:00
|
|
|
(build-system cmake-build-system)
|
2019-03-06 08:06:24 +00:00
|
|
|
(arguments
|
2020-05-22 15:52:15 +00:00
|
|
|
`(;; FIXME: Skip most of the tests, because enabling system gtest breaks
|
|
|
|
;; the build: <https://github.com/google/shaderc/issues/470>.
|
2020-12-12 18:13:02 +00:00
|
|
|
#:configure-flags
|
|
|
|
(list "-DSHADERC_SKIP_TESTS=ON"
|
2024-03-28 03:54:47 +00:00
|
|
|
;; The two flags are copied from:
|
|
|
|
;; https://sdk.lunarg.com/sdk/download/1.3.280.0/linux/config.json
|
|
|
|
"-DSHADERC_ENABLE_SHARED_CRT=ON"
|
|
|
|
"-DSHADERC_SKIP_COPYRIGHT_CHECK=ON"
|
|
|
|
"-DPYTHON_EXECUTABLE=python3"
|
2020-12-12 18:13:02 +00:00
|
|
|
;; Note: despite the name, this just specifies the headers.
|
|
|
|
(string-append "-Dglslang_SOURCE_DIR="
|
|
|
|
(assoc-ref %build-inputs "glslang") "/include/glslang"))
|
2019-03-06 08:06:24 +00:00
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-phases
|
2020-05-22 15:38:36 +00:00
|
|
|
(add-after 'unpack 'do-not-look-for-bundled-sources
|
|
|
|
(lambda _
|
|
|
|
(substitute* "CMakeLists.txt"
|
|
|
|
(("add_subdirectory\\(third_party\\)")
|
|
|
|
""))
|
|
|
|
|
2020-05-22 15:52:15 +00:00
|
|
|
(substitute* "glslc/test/CMakeLists.txt"
|
|
|
|
(("\\$<TARGET_FILE:spirv-dis>")
|
|
|
|
(which "spirv-dis")))
|
|
|
|
|
2020-05-22 15:38:36 +00:00
|
|
|
;; 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))))
|
2024-03-28 03:54:47 +00:00
|
|
|
#t)))))
|
2019-03-06 08:06:24 +00:00
|
|
|
(inputs
|
2024-03-28 03:54:47 +00:00
|
|
|
(list glslang spirv-headers spirv-tools))
|
2019-03-06 08:06:24 +00:00
|
|
|
(native-inputs
|
2024-03-28 03:54:47 +00:00
|
|
|
(list pkg-config python))
|
2019-03-06 08:06:24 +00:00
|
|
|
(home-page "https://github.com/google/shaderc")
|
|
|
|
(synopsis "Tools for shader compilation")
|
|
|
|
(description "Shaderc is a collection of tools, libraries, and tests for
|
2018-01-31 14:26:18 +00:00
|
|
|
shader compilation.")
|
2019-03-06 08:06:24 +00:00
|
|
|
(license license:asl2.0)))
|
2018-06-11 09:14:28 +00:00
|
|
|
|
|
|
|
(define-public vkd3d
|
2021-01-24 17:57:31 +00:00
|
|
|
(let ((commit "56cd4a94d541707959ce7677af6d1a34739e5579")) ; Release 1.2.
|
2018-06-11 09:14:28 +00:00
|
|
|
(package
|
|
|
|
(name "vkd3d")
|
2021-01-24 17:57:31 +00:00
|
|
|
(version "1.2")
|
2018-06-11 09:14:28 +00:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://source.winehq.org/git/vkd3d.git")
|
|
|
|
(commit commit)))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2021-01-24 17:57:31 +00:00
|
|
|
"1n4a622drgnprvz5hjxzyzcsg2lp5rlf1sajki2vzf5gsx6fdpk8"))
|
2018-06-11 09:14:28 +00:00
|
|
|
(file-name (string-append name "-" version "-checkout"))))
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
(arguments
|
2020-05-22 19:03:02 +00:00
|
|
|
`(#: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)))))
|
2018-06-11 09:14:28 +00:00
|
|
|
(native-inputs
|
|
|
|
`(("autoconf" ,autoconf)
|
|
|
|
("automake" ,automake)
|
2020-04-04 13:48:44 +00:00
|
|
|
("gettext" ,gettext-minimal)
|
2018-06-11 09:14:28 +00:00
|
|
|
("libtool" ,libtool)
|
|
|
|
("pkg-config" ,pkg-config)))
|
|
|
|
(inputs
|
2021-12-13 16:18:24 +00:00
|
|
|
(list libx11
|
|
|
|
libxcb
|
|
|
|
spirv-headers
|
|
|
|
spirv-tools
|
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
|
|
|
wine-minimal ; Needed for 'widl'.
|
|
|
|
xcb-util
|
|
|
|
xcb-util-keysyms
|
|
|
|
xcb-util-wm))
|
2018-06-11 09:14:28 +00:00
|
|
|
(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))))
|
2022-09-01 16:27:40 +00:00
|
|
|
|
|
|
|
(define-public vulkan-validationlayers
|
|
|
|
(package
|
|
|
|
(name "vulkan-validationlayers")
|
2024-03-28 03:54:54 +00:00
|
|
|
(version "1.3.280.0")
|
2022-09-01 16:27:40 +00:00
|
|
|
(source (origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url
|
|
|
|
"https://github.com/KhronosGroup/Vulkan-ValidationLayers")
|
2024-03-28 03:54:54 +00:00
|
|
|
(commit (string-append "vulkan-sdk-" version))))
|
2022-09-01 16:27:40 +00:00
|
|
|
(file-name (git-file-name name version))
|
2024-03-28 03:54:54 +00:00
|
|
|
(modules '((guix build utils)))
|
|
|
|
;; We don't build static libraries in SPIRV-Tools.
|
|
|
|
(snippet '(substitute* "tests/CMakeLists.txt"
|
|
|
|
(("-static")
|
|
|
|
"")))
|
2022-09-01 16:27:40 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2024-03-28 03:54:54 +00:00
|
|
|
"1w6fsaicrgnzkj5vz2v86a2gk1n7478q6n66ac2920avnin9a64c"))))
|
2022-09-01 16:27:40 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(inputs (list glslang
|
|
|
|
libxrandr
|
|
|
|
mesa
|
2024-03-28 03:54:54 +00:00
|
|
|
robin-hood-hashing
|
2022-09-01 16:27:40 +00:00
|
|
|
shaderc
|
|
|
|
spirv-tools
|
|
|
|
vulkan-loader
|
2024-03-28 03:54:54 +00:00
|
|
|
vulkan-utility-libraries
|
2022-09-01 16:27:40 +00:00
|
|
|
wayland))
|
2024-03-28 03:54:54 +00:00
|
|
|
(native-inputs (list googletest pkg-config python spirv-headers vulkan-headers))
|
2022-09-01 16:27:40 +00:00
|
|
|
(arguments
|
2024-03-28 03:54:54 +00:00
|
|
|
(list #:tests? #f ; tests crash on some hardware (various upstream issues)
|
2022-11-15 12:16:18 +00:00
|
|
|
#:configure-flags
|
2024-03-28 03:54:54 +00:00
|
|
|
#~(list "-DBUILD_TESTS=ON")
|
2022-09-01 16:27:40 +00:00
|
|
|
#: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
|
2024-03-28 03:54:54 +00:00
|
|
|
"/lib/libVkLayer_khronos_validation.so\""))))))
|
|
|
|
(replace 'check
|
|
|
|
(lambda* (#:key tests? #:allow-other-keys)
|
|
|
|
(when tests?
|
|
|
|
(setenv "VK_LAYER_PATH"
|
|
|
|
(string-append (getcwd) "/layers"))
|
|
|
|
(setenv "LD_LIBRARY_PATH"
|
|
|
|
(string-append #$(this-package-input
|
|
|
|
"vulkan-loader") "/lib"))
|
|
|
|
(setenv "MESA_SHADER_CACHE_DIR"
|
|
|
|
(string-append (getcwd) "/shader-cache"))
|
|
|
|
(setenv "XDG_RUNTIME_DIR" (getcwd))
|
|
|
|
(invoke "./tests/vk_layer_validation_tests")))))))
|
2022-09-01 16:27:40 +00:00
|
|
|
(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)))
|
2022-11-19 15:02:47 +00:00
|
|
|
|
|
|
|
(define-public volk
|
|
|
|
(package
|
|
|
|
(name "volk")
|
2024-03-28 03:54:50 +00:00
|
|
|
(version "1.3.280.0")
|
2022-11-19 15:02:47 +00:00
|
|
|
(source (origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/zeux/volk")
|
2024-03-28 03:54:50 +00:00
|
|
|
(commit (string-append "vulkan-sdk-" version))))
|
2022-11-19 15:02:47 +00:00
|
|
|
(file-name (git-file-name name version))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2024-03-28 03:54:50 +00:00
|
|
|
"0x4jhc8n9c4k8svmmcaxxs613xbsav7wam94gacddlm738cwp13v"))))
|
2022-11-19 15:02:47 +00:00
|
|
|
(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)))
|
2022-11-20 13:49:31 +00:00
|
|
|
|
|
|
|
(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)))
|
2024-03-28 03:54:53 +00:00
|
|
|
|
|
|
|
(define-public vulkan-utility-libraries
|
|
|
|
(package
|
|
|
|
(name "vulkan-utility-libraries")
|
|
|
|
(version "1.3.280.0")
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/KhronosGroup/Vulkan-Utility-Libraries")
|
|
|
|
(commit (string-append "vulkan-sdk-" version))))
|
|
|
|
(sha256
|
|
|
|
(base32 "17fmalilczs4x435f8kdx8bf0x5mnjhkmcp34xap8lanpbyzs84q"))
|
|
|
|
(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)))
|