unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#30307] [PATCH core-updates] gnu: mpv: Enable Vulkan support.
@ 2018-01-31 14:41 Rutger Helling
  2018-02-14  7:26 ` bug#30307: " Rutger Helling
  0 siblings, 1 reply; 4+ messages in thread
From: Rutger Helling @ 2018-01-31 14:41 UTC (permalink / raw)
  To: 30307


[-- Attachment #1.1: Type: text/plain, Size: 157 bytes --]

Hey Guix,

these patches enable Vulkan support for mpv. I'm sending them in for
core-updates since the needed Vulkan bits aren't merged into master yet.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-shaderc.patch --]
[-- Type: text/x-patch, Size: 5424 bytes --]

From bffa883a403f6f0bb0f09255fab4527ed80924f3 Mon Sep 17 00:00:00 2001
From: Rutger Helling <rhelling@mykolab.com>
Date: Wed, 31 Jan 2018 15:26:18 +0100
Subject: [PATCH 1/2] gnu: Add shaderc.

* gnu/packages/vulkan.scm (shaderc): New variable.
---
 gnu/packages/vulkan.scm | 78 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 183d42fab..4185064d8 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -22,8 +22,10 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system meson)
   #:use-module (gnu packages)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages pkg-config)
@@ -194,3 +196,79 @@ and the ICD.")
     (license (list license:asl2.0       ;LICENSE.txt
                    (license:x11-style "file://COPYRIGHT.txt")
                    license:bsd-3))))
+
+(define-public shaderc
+  (let ((commit "773ec22d49f40b7161820f29d953be4a7e40190d")
+        (revision "1"))
+    (package
+     (name "shaderc")
+     (version (string-append "0.0-" revision "." (string-take commit 9)))
+     (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/google/shaderc")
+             (commit commit)))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0b41inb1czxv3mciip0lfdxv19ccx2ys31fivfywjn2q8va1gd1f"))))
+     (build-system meson-build-system)
+     (arguments
+      `(#:tests? #f ;; Tests don't work yet.
+        #:phases
+        (modify-phases %standard-phases
+          (replace 'configure
+                   (lambda* (#:key outputs #:allow-other-keys)
+                     (let ((out (assoc-ref outputs "out")))
+                     ;; Remove various lines and touch build-version.inc or
+                     ;; configuring won't work.
+                     (invoke "touch" "glslc/src/build-version.inc")
+                     (substitute* "CMakeLists.txt" (("..PYTHON_EXE..*") ""))
+                     (substitute* "CMakeLists.txt"
+                                  ((".*update_build_version.py..*") ""))
+                     (substitute* "CMakeLists.txt"
+                                  ((".*add_custom_target.build-version.*") ""))
+                     (substitute* "CMakeLists.txt"
+                                  ((".*spirv-tools_SOURCE_DIR.*glslang_SOURCE_DIR.*")
+                                   ""))
+                     (substitute* "CMakeLists.txt"
+                                  ((".*Update build-version.inc.*") ""))
+                     (substitute* "CMakeLists.txt" ((".*--check.*") ""))
+                     (substitute* "glslc/src/main.cc" ((".*build-version.inc.*")
+                                                       "\"1\""))
+                     (invoke "cmake" "-GNinja" "-DCMAKE_BUILD_TYPE=Release"
+                                     "-DSHADERC_SKIP_TESTS=ON"
+                                     "-DCMAKE_INSTALL_LIBDIR=lib"
+                                     (string-append "-DCMAKE_INSTALL_PREFIX="
+                                                    out)))))
+          (add-after 'unpack 'unpack-sources
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (let ((spirv-tools-source (assoc-ref %build-inputs
+                                                            "spirv-tools-source"))
+                             (spirv-headers-source (assoc-ref %build-inputs
+                                                              "spirv-headers-source"))
+                             (glslang-source (assoc-ref %build-inputs
+                                                        "glslang-source")))
+                         (mkdir-p "third-party/spirv-tools")
+                         (copy-recursively spirv-tools-source
+                                           "third_party/spirv-tools")
+                         (mkdir-p "third-party/spirv-tools/external/spirv-headers")
+                         (copy-recursively spirv-headers-source
+                                           (string-append "third_party/spirv-tools"
+                                                          "/external/spirv-headers"))
+                         (mkdir-p "third-party/glslang")
+                         (copy-recursively glslang-source
+                                           "third_party/glslang")
+                         #t))))))
+     (inputs `(("python" ,python)))
+     (native-inputs `(("cmake" ,cmake)
+                      ("glslang-source", (package-source glslang))
+                      ("pkg-config", pkg-config)
+                      ("spirv-headers-source", (package-source spirv-headers))
+                      ("spirv-tools-source", (package-source spirv-tools))))
+     (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))))
-- 
2.16.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-gnu-mpv-Enable-Vulkan-support.patch --]
[-- Type: text/x-patch, Size: 1650 bytes --]

From e94e4e9e48a2c6bdd76a4ad93b938aa8dfda0360 Mon Sep 17 00:00:00 2001
From: Rutger Helling <rhelling@mykolab.com>
Date: Wed, 31 Jan 2018 15:28:31 +0100
Subject: [PATCH 2/2] gnu: mpv: Enable Vulkan support.

* gnu/packages/video.scm (mpv)[inputs]: Add shaderc and vulkan-icd-loader.
---
 gnu/packages/video.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 1e3046626..bdadd7df9 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -21,7 +21,7 @@
 ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com>
 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
-;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
+;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2018 Roel Janssen <roel@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -115,6 +115,7 @@
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
+  #:use-module (gnu packages vulkan)
   #:use-module (gnu packages web)
   #:use-module (gnu packages webkit)
   #:use-module (gnu packages wxwidgets)
@@ -1054,6 +1055,8 @@ SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
        ("mpg123" ,mpg123)
        ("pulseaudio" ,pulseaudio)
        ("rsound" ,rsound)
+       ("shaderc" ,shaderc)
+       ("vulkan-icd-loader" ,vulkan-icd-loader)
        ("waf" ,python-waf)
        ("wayland" ,wayland)
        ("wayland-protocols" ,wayland-protocols)
-- 
2.16.1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#30307: [PATCH core-updates] gnu: mpv: Enable Vulkan support.
  2018-01-31 14:41 [bug#30307] [PATCH core-updates] gnu: mpv: Enable Vulkan support Rutger Helling
@ 2018-02-14  7:26 ` Rutger Helling
  2018-02-15 14:36   ` [bug#30307] " Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Rutger Helling @ 2018-02-14  7:26 UTC (permalink / raw)
  To: 30307-done

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

I merged these since it's been two weeks.

On Wed, 31 Jan 2018 15:41:13 +0100
Rutger Helling <rhelling@mykolab.com> wrote:

> Hey Guix,
> 
> these patches enable Vulkan support for mpv. I'm sending them in for
> core-updates since the needed Vulkan bits aren't merged into master
> yet.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#30307] [PATCH core-updates] gnu: mpv: Enable Vulkan support.
  2018-02-14  7:26 ` bug#30307: " Rutger Helling
@ 2018-02-15 14:36   ` Ludovic Courtès
  2018-02-16  9:21     ` Rutger Helling
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2018-02-15 14:36 UTC (permalink / raw)
  To: 30307-done; +Cc: rhelling

Rutger Helling <rhelling@mykolab.com> skribis:

> I merged these since it's been two weeks.

Thanks, and sorry for not being more responsive.

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#30307] [PATCH core-updates] gnu: mpv: Enable Vulkan support.
  2018-02-15 14:36   ` [bug#30307] " Ludovic Courtès
@ 2018-02-16  9:21     ` Rutger Helling
  0 siblings, 0 replies; 4+ messages in thread
From: Rutger Helling @ 2018-02-16  9:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 30307-done

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

No worries!

On Thu, 15 Feb 2018 15:36:13 +0100
ludo@gnu.org (Ludovic Courtès) wrote:

> Rutger Helling <rhelling@mykolab.com> skribis:
> 
> > I merged these since it's been two weeks.  
> 
> Thanks, and sorry for not being more responsive.
> 
> Ludo’.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-16  9:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 14:41 [bug#30307] [PATCH core-updates] gnu: mpv: Enable Vulkan support Rutger Helling
2018-02-14  7:26 ` bug#30307: " Rutger Helling
2018-02-15 14:36   ` [bug#30307] " Ludovic Courtès
2018-02-16  9:21     ` Rutger Helling

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).