gnu: yt-dlp: Use new package style.

* gnu/packages/video.scm (yt-dlp)[source](snippet): Rewrite as a G-Expression.
[arguments]: Use G-Expressions.
[inputs]: Drop labels.
[native-inputs]: Likewise.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
kiasoc5 2022-08-06 01:28:37 -04:00 committed by Liliana Marie Prikler
parent 7f9b7ed0ff
commit d457a5ec09
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -2484,53 +2484,52 @@ (define-public yt-dlp
(base32 (base32
"1wmzfqhysx1mqdba4ikvm6nbahasihi4xgqwqad20y3vs701slyj")) "1wmzfqhysx1mqdba4ikvm6nbahasihi4xgqwqad20y3vs701slyj"))
(snippet (snippet
'(begin #~(begin
;; Delete the pre-generated files, except for the man page ;; Delete the pre-generated files, except for the man page
;; which requires 'pandoc' to build. ;; which requires 'pandoc' to build.
(for-each delete-file '("yt-dlp" (for-each delete-file
;;pandoc is needed to generate (list "yt-dlp"
;;"yt-dlp.1" ;;pandoc is needed to generate
"completions/bash/yt-dlp" ;;"yt-dlp.1"
"completions/fish/yt-dlp.fish" "completions/bash/yt-dlp"
"completions/zsh/_yt-dlp")))))) "completions/fish/yt-dlp.fish"
"completions/zsh/_yt-dlp"))))))
(arguments (arguments
(substitute-keyword-arguments (package-arguments youtube-dl) (substitute-keyword-arguments (package-arguments youtube-dl)
((#:tests? _) #t) ((#:tests? _) #t)
((#:phases phases) ((#:phases phases)
`(modify-phases ,phases #~(modify-phases #$phases
;; See the comment for the corresponding phase in youtube-dl. ;; See the comment for the corresponding phase in youtube-dl.
(replace 'default-to-the-ffmpeg-input (replace 'default-to-the-ffmpeg-input
(lambda _ (lambda _
(substitute* "yt_dlp/postprocessor/ffmpeg.py" (substitute* "yt_dlp/postprocessor/ffmpeg.py"
(("\\.get_param\\('ffmpeg_location'\\)" match) (("\\.get_param\\('ffmpeg_location'\\)" match)
(format #f "~a or '~a'" match (which "ffmpeg")))))) (format #f "~a or '~a'" match (which "ffmpeg"))))))
(replace 'build-generated-files (replace 'build-generated-files
(lambda _ (lambda _
;; Avoid the yt-dlp.1 target, which requires pandoc. ;; Avoid the yt-dlp.1 target, which requires pandoc.
(invoke "make" "PYTHON=python" "yt-dlp" "completions"))) (invoke "make" "PYTHON=python" "yt-dlp" "completions")))
(replace 'fix-the-data-directories (replace 'fix-the-data-directories
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((prefix (assoc-ref outputs "out"))) (let ((prefix (assoc-ref outputs "out")))
(substitute* "setup.py" (substitute* "setup.py"
(("'etc/") (("'etc/")
(string-append "'" prefix "/etc/")) (string-append "'" prefix "/etc/"))
(("'share/") (("'share/")
(string-append "'" prefix "/share/")))))) (string-append "'" prefix "/share/"))))))
(delete 'install-completion) (delete 'install-completion)
(replace 'check (replace 'check
(lambda* (#:key tests? #:allow-other-keys) (lambda* (#:key tests? #:allow-other-keys)
(when tests? (when tests?
(invoke "pytest" "-k" "not download")))))))) (invoke "pytest" "-k" "not download"))))))))
(inputs (inputs (modify-inputs (package-inputs youtube-dl)
`(("python-brotli" ,python-brotli) (append python-brotli
("python-certifi" ,python-certifi) python-certifi
("python-mutagen" ,python-mutagen) python-mutagen
("python-pycryptodomex" ,python-pycryptodomex) python-pycryptodomex
("python-websockets" ,python-websockets) python-websockets)))
,@(package-inputs youtube-dl))) (native-inputs (modify-inputs (package-native-inputs youtube-dl)
(native-inputs (append python-pytest)))
`(("python-pytest" ,python-pytest)
,@(package-native-inputs youtube-dl)))
(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