Subject: [PATCH] gnu: Add libmpv.

From: Hilton Chain <[email-masked]>
Date: Fri, 5 Jan 2024 13:06:17 +0800

* gnu/packages/video.scm (libmpv): New variable.
(mpv)[arguments]<#:configure-flags>: Remove libmpv library.
(celluloid,mpv-mpris)[inputs]: Replace mpv with libmpv.
* gnu/packages/kde-plasma.scm (plasmatube)[inputs]: Likewise.
* gnu/packages/python-xyz.scm (python-mpv)[inputs]: Likewise.

Change-Id: I7c0a808f9d54f9bfd98b3d2632316c7d58b67896
---
 gnu/packages/kde-plasma.scm |  2 +-
 gnu/packages/python-xyz.scm |  2 +-
 gnu/packages/video.scm      | 24 ++++++++++++++++++++----
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/kde-plasma.scm b/gnu/packages/kde-plasma.scm
index 331ab28cd1..0527fa136a 100644
--- a/gnu/packages/kde-plasma.scm
+++ b/gnu/packages/kde-plasma.scm
@@ -1611,12 +1611,12 @@ (define-public plasmatube
      (list kconfig
            kirigami
            ki18n
+           libmpv
            qtbase-5
            qtdeclarative-5
            qtmultimedia-5
            qtquickcontrols2-5
            qtsvg-5
-           mpv
            youtube-dl))
     (home-page "https://apps.kde.org/plasmatube/")
     (synopsis "Kirigami YouTube video player")
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2afce6c667..b23eaaadfc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -33948,7 +33948,7 @@ (define-public python-mpv
                    (setenv "HOME" (getcwd)))))))
     (native-inputs
      (list python-xvfbwrapper)) ; needed for tests only
-    (inputs (list mpv))
+    (inputs (list libmpv))
     (propagated-inputs (list python-pillow)) ; for raw screenshots
     (home-page "https://github.com/jaseg/python-mpv")
     (synopsis "Python interface to the mpv media player")
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 6da4897a57..b532181225 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -867,7 +867,7 @@ (define-public celluloid
       pkg-config
       python-wrapper))             ; for generate-authors.py
     (inputs
-     (list gtk libadwaita libepoxy mpv))
+     (list gtk libadwaita libepoxy libmpv))
     (home-page "https://github.com/celluloid-player/celluloid")
     (synopsis "GTK+ frontend for the mpv media player")
     (description "Celluloid is a simple GTK+ frontend for the mpv media player.
@@ -2367,8 +2367,7 @@ (define-public mpv
               ;; Set PYTHONHASHSEED as a workaround for deterministic results.
               (setenv "PYTHONHASHSEED" "1"))))
       #:configure-flags
-      #~(list "-Dlibmpv=true"
-              "-Dcdda=enabled"
+      #~(list "-Dcdda=enabled"
               "-Ddvdnav=enabled"
               "-Dbuild-date=false")))
     (native-inputs
@@ -2422,6 +2421,23 @@ (define-public mpv
 projects while introducing many more.")
     (license license:gpl2+)))
 
+(define-public libmpv
+  (package
+    (inherit mpv)
+    (name "libmpv")
+    (arguments
+     (substitute-keyword-arguments (package-arguments mpv)
+       ((#:configure-flags flags ''())
+        #~(cons* "-Dcplayer=false"
+                 "-Dlibmpv=true"
+                 #$flags))))
+    (native-inputs
+     (modify-inputs (package-native-inputs mpv)
+       (delete "perl" "python-docutils")))
+    (propagated-inputs (package-inputs mpv))
+    (inputs '())
+    (synopsis "mpv media player client library")))
+
 (define-public smplayer
   (package
     (name "smplayer")
@@ -2524,7 +2540,7 @@ (define-public mpv-mpris
     (native-inputs
      (list pkg-config))
     (inputs
-     (list ffmpeg glib mpv))
+     (list ffmpeg glib libmpv))
     (home-page "https://github.com/hoyon/mpv-mpris")
     (synopsis "MPRIS plugin for mpv")
     (description "This package provides an @dfn{MPRIS} (Media Player Remote

base-commit: be1d05c10766a979dd0720b677889ed950d3b895
-- 
2.41.0