Subject: [PATCH] gnu: yt-dlp: Update to 2022.07.18, use gexps and new style inputs.

From: kiasoc5 <[email-masked]>
Date: Fri, 5 Aug 2022 01:30:12 -0400

* gnu/packages/video.scm (yt-dlp): Update to 2022.07.18.
[arguments]: Use gexps.
[inputs]: Use new style.
[native-inputs]: Likewise.
---
 gnu/packages/video.scm | 70 ++++++++++++++++++++----------------------
 1 file changed, 34 insertions(+), 36 deletions(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 04049fd9c8..8cd6d03688 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -2474,7 +2474,7 @@ (define-public youtube-dl
 (define-public yt-dlp
   (package/inherit youtube-dl
     (name "yt-dlp")
-    (version "2022.06.22.1")
+    (version "2022.07.18")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/yt-dlp/yt-dlp/"
@@ -2482,7 +2482,7 @@ (define-public yt-dlp
                                   version "/yt-dlp.tar.gz"))
               (sha256
                (base32
-                "1nr6g3dhvjc10jzhyvgjrrxqhsgi3hiw8bswp8bi6bscimd9vhps"))
+                "1wmzfqhysx1mqdba4ikvm6nbahasihi4xgqwqad20y3vs701slyj"))
               (snippet
                '(begin
                   ;; Delete the pre-generated files, except for the man page
@@ -2497,40 +2497,38 @@ (define-public yt-dlp
      (substitute-keyword-arguments (package-arguments youtube-dl)
        ((#:tests? _) #t)
        ((#:phases phases)
-        `(modify-phases ,phases
-           ;; See the comment for the corresponding phase in youtube-dl.
-           (replace 'default-to-the-ffmpeg-input
-             (lambda _
-               (substitute* "yt_dlp/postprocessor/ffmpeg.py"
-                 (("\\.get_param\\('ffmpeg_location'\\)" match)
-                  (format #f "~a or '~a'" match (which "ffmpeg"))))))
-           (replace 'build-generated-files
-             (lambda _
-               ;; Avoid the yt-dlp.1 target, which requires pandoc.
-               (invoke "make" "PYTHON=python" "yt-dlp" "completions")))
-           (replace 'fix-the-data-directories
-             (lambda* (#:key outputs #:allow-other-keys)
-               (let ((prefix (assoc-ref outputs "out")))
-                 (substitute* "setup.py"
-                   (("'etc/")
-                    (string-append "'" prefix "/etc/"))
-                   (("'share/")
-                    (string-append "'" prefix "/share/"))))))
-           (delete 'install-completion)
-           (replace 'check
-             (lambda* (#:key tests? #:allow-other-keys)
-               (when tests?
-                 (invoke "pytest" "-k" "not download"))))))))
-    (inputs
-     `(("python-brotli" ,python-brotli)
-       ("python-certifi" ,python-certifi)
-       ("python-mutagen" ,python-mutagen)
-       ("python-pycryptodomex" ,python-pycryptodomex)
-       ("python-websockets" ,python-websockets)
-       ,@(package-inputs youtube-dl)))
-    (native-inputs
-     `(("python-pytest" ,python-pytest)
-       ,@(package-native-inputs youtube-dl)))
+         #~(modify-phases #$phases
+            ;; See the comment for the corresponding phase in youtube-dl.
+            (replace 'default-to-the-ffmpeg-input
+              (lambda _
+                (substitute* "yt_dlp/postprocessor/ffmpeg.py"
+                  (("\\.get_param\\('ffmpeg_location'\\)" match)
+                   (format #f "~a or '~a'" match (which "ffmpeg"))))))
+            (replace 'build-generated-files
+              (lambda _
+                ;; Avoid the yt-dlp.1 target, which requires pandoc.
+                (invoke "make" "PYTHON=python" "yt-dlp" "completions")))
+            (replace 'fix-the-data-directories
+              (lambda* (#:key outputs #:allow-other-keys)
+                (let ((prefix (assoc-ref outputs "out")))
+                  (substitute* "setup.py"
+                    (("'etc/")
+                     (string-append "'" prefix "/etc/"))
+                    (("'share/")
+                     (string-append "'" prefix "/share/"))))))
+            (delete 'install-completion)
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  (invoke "pytest" "-k" "not download"))))))))
+    (inputs (modify-inputs (package-inputs youtube-dl)
+              (append python-brotli
+                      python-certifi
+                      python-mutagen
+                      python-pycryptodomex
+                      python-websockets)))
+    (native-inputs (modify-inputs (package-native-inputs youtube-dl)
+                     (append python-pytest)))
     (description
      "yt-dlp is a small command-line program to download videos from
 YouTube.com and many more sites.  It is a fork of youtube-dl with a
-- 
2.37.1