Subject: [PATCH v3] gnu: youtube-dl: Add 'ffmpeg' as input.

From: Brice Waegeneire <[email-masked]>
Date: Wed, 1 Apr 2020 15:01:52 +0200

* gnu/packages/video.scm (youtube-dl)[arguments]: Add phase
wrap-executable.
[inputs]: Add ffmpeg.
---

This version is rebased on top of master and the commit adding zsh completion
has been removed from the patch set since it has already been merged.

 gnu/packages/video.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 03796fd770..6ad46fb9fe 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -1680,7 +1680,17 @@ To load this plugin, specify the following option when starting mpv:
                         (mkdir-p zsh)
                         (copy-file "youtube-dl.zsh"
                                    (string-append zsh "/_youtube-dl"))
-                        #t))))))
+                        #t)))
+                 (add-after 'install 'wrap-executable
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out"))
+                            (ffmpeg (assoc-ref inputs "ffmpeg")))
+                        (wrap-program (string-append out "/bin/youtube-dl")
+                          `("PATH" ":" prefix
+                            ,(list (string-append ffmpeg "/bin")))))
+                      #t)))))
+    (inputs
+     `(("ffmpeg" ,ffmpeg)))
     (synopsis "Download videos from YouTube.com and other sites")
     (description
      "Youtube-dl is a small command-line program to download videos from
-- 
2.25.1