gnu: yt-dlp: Fix substitution for ffmpeg path.

The old expression did not work; ffmpeg was not found
when using the --add-metadata flag.

* gnu/packages/video.scm (yt-dlp)
[arguments]: Adjust substitution in custom 'default-to-the-ffmpeg-input phase.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Dominik Delgado Steuter 2023-05-20 15:49:13 +02:00 committed by Ludovic Courtès
parent ca5696b1a3
commit 1af79a0615
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -64,6 +64,7 @@
;;; Copyright © 2022 Chadwain Holness <chadwainholness@gmail.com> ;;; Copyright © 2022 Chadwain Holness <chadwainholness@gmail.com>
;;; Copyright © 2022 Andy Tai <atai@atai.org> ;;; Copyright © 2022 Andy Tai <atai@atai.org>
;;; Copyright © 2023 Ott Joon <oj@vern.cc> ;;; Copyright © 2023 Ott Joon <oj@vern.cc>
;;; Copyright © 2023 Dominik Delgado Steuter <dds@disroot.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -2570,10 +2571,13 @@ (define-public yt-dlp
#~(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* (#:key inputs #:allow-other-keys)
(substitute* "yt_dlp/postprocessor/ffmpeg.py" (substitute* "yt_dlp/postprocessor/ffmpeg.py"
(("\\.get_param\\('ffmpeg_location'\\)" match) (("location = self.get_param(.*)$")
(format #f "~a or '~a'" match (which "ffmpeg")))))) (string-append
"location = '"
(dirname (search-input-file inputs "bin/ffmpeg"))
"'\n")))))
(replace 'build-generated-files (replace 'build-generated-files
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(if (assoc-ref inputs "pandoc") (if (assoc-ref inputs "pandoc")