unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo Famulari <leo@famulari.name>
To: 71640@debbugs.gnu.org
Subject: [bug#71640] [PATCH 1/6] gnu: yt-dlp: Don't inherit from youtube-dl.
Date: Tue, 18 Jun 2024 22:13:10 -0400	[thread overview]
Message-ID: <a6a1674cfdb0b3be3c17598a06928b579ac3b3d1.1718763195.git.leo@famulari.name> (raw)
In-Reply-To: <ZnI4PGcTvEstwOuG@jasmine.lan>

yt-dlp has diverged from youtube-dl sufficiently that package inheritance
hinders package maintenance.

* gnu/packages/video.scm (yt-dlp): Don't inherit from YOUTUBE-DL.
[build-system, synopsis, license]: New fields.
[arguments]: Adjust accordingly.
[inputs]: Add FFMPEG.

Change-Id: I14c4cfb6a75ba0421c62eac778072ab3e76c72a1
---
 gnu/packages/video.scm | 95 ++++++++++++++++++++++--------------------
 1 file changed, 49 insertions(+), 46 deletions(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index e7e61303a9..76e4a8a02f 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -3135,7 +3135,7 @@ (define-public youtube-dl
     (license license:public-domain)))
 
 (define-public yt-dlp
-  (package/inherit youtube-dl
+  (package
     (name "yt-dlp")
     (version "2023.10.13")
     (source
@@ -3147,51 +3147,52 @@ (define-public yt-dlp
        (file-name (git-file-name name version))
        (sha256
         (base32 "1cy8cpqwq6yfsbrnln3qqp9lsjckn20m6w7b890ha7jahyir5m1n"))))
+    (build-system python-build-system)
     (arguments
-     (substitute-keyword-arguments (package-arguments youtube-dl)
-       ((#:tests? _) (not (%current-target-system)))
-       ((#:phases phases)
-        #~(modify-phases #$phases
-            ;; See the comment for the corresponding phase in youtube-dl.
-            (replace 'default-to-the-ffmpeg-input
-              (lambda* (#:key inputs #:allow-other-keys)
-                (substitute* "yt_dlp/postprocessor/ffmpeg.py"
-                  (("location = self.get_param(.*)$")
-                   (string-append
-                     "location = '"
-                     (dirname (search-input-file inputs "bin/ffmpeg"))
-                     "'\n")))))
-            (replace 'build-generated-files
-              (lambda* (#:key inputs #:allow-other-keys)
-                (if (assoc-ref inputs "pandoc")
-                  (invoke "make"
-                          "PYTHON=python"
-                          "yt-dlp"
-                          "yt-dlp.1"
-                          "completions")
-                  (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)))
+     `(#:tests? ,(not (%current-target-system))
+       #:phases
+       (modify-phases %standard-phases
+         ;; See <https://issues.guix.gnu.org/43418#5>.
+         ;; ffmpeg is big but required to request free formats from, e.g.,
+         ;; YouTube so pull it in unconditionally.  Continue respecting the
+         ;; --ffmpeg-location argument.
+         (add-after 'unpack 'default-to-the-ffmpeg-input
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "yt_dlp/postprocessor/ffmpeg.py"
+               (("location = self.get_param(.*)$")
+                (string-append
+                  "location = '"
+                  (dirname (search-input-file inputs "bin/ffmpeg"))
+                  "'\n")))))
+         (add-before 'build 'build-generated-files
+           (lambda* (#:key inputs #:allow-other-keys)
+             (if (assoc-ref inputs "pandoc")
+               (invoke "make"
+                       "PYTHON=python"
+                       "yt-dlp"
+                       "yt-dlp.1"
+                       "completions")
+               (invoke "make"
+                       "PYTHON=python"
+                       "yt-dlp"
+                       "completions"))))
+         (add-before 'install '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/"))))))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "pytest" "-k" "not download")))))))
+    (inputs (list ffmpeg python-brotli
+                  python-certifi
+                  python-mutagen
+                  python-pycryptodomex
+                  python-websockets))
     (native-inputs
      (append
        ;; To generate the manpage.
@@ -3199,13 +3200,15 @@ (define-public yt-dlp
          (list pandoc)
          '())
        (list python-pytest zip)))
+    (synopsis "Download videos from YouTube.com and other sites")
     (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
 focus on adding new features while keeping up-to-date with the
 original project.")
     (properties '((release-monitoring-url . "https://pypi.org/project/yt-dlp/")))
-    (home-page "https://github.com/yt-dlp/yt-dlp")))
+    (home-page "https://github.com/yt-dlp/yt-dlp")
+    (license license:public-domain)))
 
 (define-public you-get
   (package

base-commit: b993f4735d41e690dbafb8ee2e17fce996a8cf20
-- 
2.41.0





  reply	other threads:[~2024-06-19  2:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19  1:45 [bug#71640] yt-dlp: Update to 2024-05-27 Leo Famulari
2024-06-19  2:13 ` Leo Famulari [this message]
2024-06-19  2:13   ` [bug#71640] [PATCH 2/6] gnu: Add python-requests 2.31.0 Leo Famulari
2024-06-19  2:13   ` [bug#71640] [PATCH 3/6] gnu: Add python-urllib3 1.26.17 Leo Famulari
2024-06-19  2:13   ` [bug#71640] [PATCH 4/6] gnu: python-pytest-sanic: Further relax the websockets version requirements Leo Famulari
2024-06-19  2:13   ` [bug#71640] [PATCH 5/6] gnu: python-websockets: Update to 12.0 Leo Famulari
2024-06-24  2:00     ` [bug#71640] yt-dlp: Update to 2024-05-27 Maxim Cournoyer
2024-06-27 17:07       ` Leo Famulari
2024-06-19  2:13   ` [bug#71640] [PATCH 6/6] gnu: yt-dlp: Update to 2024.05.27 Leo Famulari
2024-06-24  1:58     ` [bug#71640] yt-dlp: Update to 2024-05-27 Maxim Cournoyer
2024-06-27 17:05       ` Leo Famulari
2024-06-29  0:27         ` Maxim Cournoyer
2024-07-04  1:48           ` bug#71640: " Leo Famulari
2024-06-24  2:03   ` [bug#71640] " Maxim Cournoyer
2024-07-01 12:19 ` [bug#71640] Deprecation Andreas Enge
2024-07-04  0:36   ` Leo Famulari
2024-07-04  0:49     ` Leo Famulari

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=a6a1674cfdb0b3be3c17598a06928b579ac3b3d1.1718763195.git.leo@famulari.name \
    --to=leo@famulari.name \
    --cc=71640@debbugs.gnu.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).