gnu: shaderc: Fix formatting.

* gnu/packages/vulkan.scm (shaderc): Use conventional indentation.
[native-inputs]: Move unquotes to their operands.
This commit is contained in:
Tobias Geerinckx-Rice 2018-03-16 16:33:16 +01:00
parent 36a17f056c
commit 49c4c4de85
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
1 changed files with 72 additions and 70 deletions

View File

@ -210,74 +210,76 @@ and the ICD.")
(let ((commit "773ec22d49f40b7161820f29d953be4a7e40190d") (let ((commit "773ec22d49f40b7161820f29d953be4a7e40190d")
(revision "1")) (revision "1"))
(package (package
(name "shaderc") (name "shaderc")
(version (string-append "0.0-" revision "." (string-take commit 9))) (version (string-append "0.0-" revision "." (string-take commit 9)))
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://github.com/google/shaderc") (url "https://github.com/google/shaderc")
(commit commit))) (commit commit)))
(file-name (string-append name "-" version ".tar.gz")) (file-name (string-append name "-" version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"0b41inb1czxv3mciip0lfdxv19ccx2ys31fivfywjn2q8va1gd1f")))) "0b41inb1czxv3mciip0lfdxv19ccx2ys31fivfywjn2q8va1gd1f"))))
(build-system meson-build-system) (build-system meson-build-system)
(arguments (arguments
`(#:tests? #f ;; Tests don't work yet. `(#:tests? #f ; tests don't work yet.
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(replace 'configure (replace 'configure
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
;; Remove various lines and touch build-version.inc or ;; Remove various lines and touch build-version.inc or
;; configuring won't work. ;; configuring won't work.
(invoke "touch" "glslc/src/build-version.inc") (invoke "touch" "glslc/src/build-version.inc")
(substitute* "CMakeLists.txt" (("..PYTHON_EXE..*") "")) (substitute* "CMakeLists.txt" (("..PYTHON_EXE..*") ""))
(substitute* "CMakeLists.txt" (substitute* "CMakeLists.txt"
((".*update_build_version.py..*") "")) ((".*update_build_version.py..*") ""))
(substitute* "CMakeLists.txt" (substitute* "CMakeLists.txt"
((".*add_custom_target.build-version.*") "")) ((".*add_custom_target.build-version.*") ""))
(substitute* "CMakeLists.txt" (substitute* "CMakeLists.txt"
((".*spirv-tools_SOURCE_DIR.*glslang_SOURCE_DIR.*") ((".*spirv-tools_SOURCE_DIR.*glslang_SOURCE_DIR.*")
"")) ""))
(substitute* "CMakeLists.txt" (substitute* "CMakeLists.txt"
((".*Update build-version.inc.*") "")) ((".*Update build-version.inc.*") ""))
(substitute* "CMakeLists.txt" ((".*--check.*") "")) (substitute* "CMakeLists.txt" ((".*--check.*") ""))
(substitute* "glslc/src/main.cc" ((".*build-version.inc.*") (substitute* "glslc/src/main.cc" ((".*build-version.inc.*")
"\"1\"")) "\"1\""))
(invoke "cmake" "-GNinja" "-DCMAKE_BUILD_TYPE=Release" (invoke "cmake" "-GNinja" "-DCMAKE_BUILD_TYPE=Release"
"-DSHADERC_SKIP_TESTS=ON" "-DSHADERC_SKIP_TESTS=ON"
"-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_INSTALL_LIBDIR=lib"
(string-append "-DCMAKE_INSTALL_PREFIX=" (string-append "-DCMAKE_INSTALL_PREFIX="
out))))) out)))))
(add-after 'unpack 'unpack-sources (add-after 'unpack 'unpack-sources
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((spirv-tools-source (assoc-ref %build-inputs (let ((spirv-tools-source (assoc-ref %build-inputs
"spirv-tools-source")) "spirv-tools-source"))
(spirv-headers-source (assoc-ref %build-inputs (spirv-headers-source (assoc-ref %build-inputs
"spirv-headers-source")) "spirv-headers-source"))
(glslang-source (assoc-ref %build-inputs (glslang-source (assoc-ref %build-inputs
"glslang-source"))) "glslang-source")))
(mkdir-p "third-party/spirv-tools") (mkdir-p "third-party/spirv-tools")
(copy-recursively spirv-tools-source (copy-recursively spirv-tools-source
"third_party/spirv-tools") "third_party/spirv-tools")
(mkdir-p "third-party/spirv-tools/external/spirv-headers") (mkdir-p "third-party/spirv-tools/external/spirv-headers")
(copy-recursively spirv-headers-source (copy-recursively spirv-headers-source
(string-append "third_party/spirv-tools" (string-append "third_party/spirv-tools"
"/external/spirv-headers")) "/external/spirv-headers"))
(mkdir-p "third-party/glslang") (mkdir-p "third-party/glslang")
(copy-recursively glslang-source (copy-recursively glslang-source
"third_party/glslang") "third_party/glslang")
#t)))))) #t))))))
(inputs `(("python" ,python))) (inputs
(native-inputs `(("cmake" ,cmake) `(("python" ,python)))
("glslang-source", (package-source glslang)) (native-inputs
("pkg-config", pkg-config) `(("cmake" ,cmake)
("spirv-headers-source", (package-source spirv-headers)) ("glslang-source" ,(package-source glslang))
("spirv-tools-source", (package-source spirv-tools)))) ("pkg-config" ,pkg-config)
(home-page "https://github.com/google/shaderc") ("spirv-headers-source" ,(package-source spirv-headers))
(synopsis "Tools for shader compilation") ("spirv-tools-source" ,(package-source spirv-tools))))
(description "Shaderc is a collection of tools, libraries and tests for (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.") shader compilation.")
(license license:asl2.0)))) (license license:asl2.0))))