Subject: [PATCH 1/2] gnu: youtube-dl: Use ffmpeg and pycryptodome

From: Brice Waegeneire <[email-masked]>
Date: Sat, 14 Mar 2020 15:42:20 +0100

* gnu/packages/video.scm (youtube-dl)[arguments]: Add phase
wrap-executable.
[inputs]: Add ffmpeg.
[propagated-inputs]: Add python-pycryptodome.
---
 gnu/packages/video.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 074a1235a3..4ca037532f 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -37,6 +37,7 @@
 ;;; Copyright © 2019 Riku Viitanen <[email-masked]>
 ;;; Copyright © 2020 Oleg Pykhalov <[email-masked]>
 ;;; Copyright © 2020 Josh Holland <[email-masked]>
+;;; Copyright © 2020 Brice Waegeneire <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1580,7 +1581,19 @@ To load this plugin, specify the following option when starting mpv:
                            (string-append "'" prefix "/etc/"))
                           (("'share/")
                            (string-append "'" prefix "/share/")))
-                        #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)))
+    (propagated-inputs
+     `(("python-pycryptodome" ,python-pycryptodome)))
     (synopsis "Download videos from YouTube.com and other sites")
     (description
      "Youtube-dl is a small command-line program to download videos from
-- 
2.25.0