unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: kiasoc5 via Guix-patches via <guix-patches@gnu.org>
To: 56983@debbugs.gnu.org
Cc: kiasoc5 <kiasoc5@disroot.org>
Subject: [bug#56983] [PATCH 2/2] gnu: yt-dlp: Use new package style.
Date: Sat,  6 Aug 2022 01:28:37 -0400	[thread overview]
Message-ID: <20220806052833.183236-3-kiasoc5@disroot.org> (raw)
In-Reply-To: <20220806052833.183236-1-kiasoc5@disroot.org>

* gnu/packages/video.scm
(yt-dlp)[source](snippet): Rewrite snippet as a gexp.
[arguments]: Use gexps.
[inputs]: Use new style.
[native-inputs]: Likewise.
---
 gnu/packages/video.scm | 85 +++++++++++++++++++++---------------------
 1 file changed, 42 insertions(+), 43 deletions(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 017c0d3857..c681165f2e 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -2484,53 +2484,52 @@ (define-public yt-dlp
                (base32
                 "1wmzfqhysx1mqdba4ikvm6nbahasihi4xgqwqad20y3vs701slyj"))
               (snippet
-               '(begin
-                  ;; Delete the pre-generated files, except for the man page
-                  ;; which requires 'pandoc' to build.
-                  (for-each delete-file '("yt-dlp"
-                                          ;;pandoc is needed to generate
-                                          ;;"yt-dlp.1"
-                                          "completions/bash/yt-dlp"
-                                          "completions/fish/yt-dlp.fish"
-                                          "completions/zsh/_yt-dlp"))))))
+               #~(begin
+                   ;; Delete the pre-generated files, except for the man page
+                   ;; which requires 'pandoc' to build.
+                   (for-each delete-file
+                             (list "yt-dlp"
+                                   ;;pandoc is needed to generate
+                                   ;;"yt-dlp.1"
+                                   "completions/bash/yt-dlp"
+                                   "completions/fish/yt-dlp.fish"
+                                   "completions/zsh/_yt-dlp"))))))
     (arguments
      (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





  parent reply	other threads:[~2022-08-06  5:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 20:37 [bug#56983] [PATCH] gnu: yt-dlp: Update to 2022.07.18 kiasoc5 via Guix-patches via
2022-08-04 20:41 ` ( via Guix-patches via
2022-08-05  5:30 ` [bug#56983] [PATCH] gnu: yt-dlp: Update to 2022.07.18, use gexps and new style inputs kiasoc5 via Guix-patches via
2022-08-05  8:01   ` Liliana Marie Prikler
2022-08-06  5:28 ` kiasoc5 via Guix-patches via
2022-08-06  5:28   ` [bug#56983] [PATCH 1/2] gnu: yt-dlp: Update to 2022.07.18 kiasoc5 via Guix-patches via
2022-08-06  5:28   ` kiasoc5 via Guix-patches via [this message]
2022-08-06 14:40     ` bug#56983: [PATCH 2/2] gnu: yt-dlp: Use new package style Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220806052833.183236-3-kiasoc5@disroot.org \
    --to=guix-patches@gnu.org \
    --cc=56983@debbugs.gnu.org \
    --cc=kiasoc5@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).