Subject: [PATCH] gnu: mpv: Set absolute path to 'youtube-dl'.
From: Timo Eisenmann <[email-masked]>
To: [email-masked]
Cc: Timo Eisenmann <[email-masked]>
Date: Thu, 28 Mar 2019 21:00:54 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/video.scm (mpv)[arguments]: Add phase 'patch-paths' to
substitute in the absolute path to 'youtube-dl'.
---
 gnu/packages/video.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 55a1931530..3c5ade55a3 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -1326,6 +1326,13 @@ SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
     (arguments
      '(#:phases
        (modify-phases %standard-phases
+         (add-after
+          'unpack 'patch-paths
+          (lambda* (#:key inputs #:allow-other-keys)
+            (let ((ytdl (assoc-ref inputs "youtube-dl")))
+              (substitute* "player/lua/ytdl_hook.lua"
+                (("\"youtube-dl\",")
+                 (string-append "\"" ytdl "/bin/youtube-dl\","))))))
          (add-before
           'configure 'setup-waf
           (lambda* (#:key inputs #:allow-other-keys)
-- 
2.21.0