me
/
guix
Archived
1
0
Fork 0

gnu: yt-dlp: Don't inherit from youtube-dl.

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
master
Leo Famulari 2024-06-18 22:11:51 -04:00
parent ddbbb78786
commit 66e9ce2bae
No known key found for this signature in database
GPG Key ID: 6AAC1963757F47FF
1 changed files with 49 additions and 46 deletions

View File

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