From 1af79a0615094ba0d86f4c5580481ed8cd181cd9 Mon Sep 17 00:00:00 2001 From: Dominik Delgado Steuter Date: Sat, 20 May 2023 15:49:13 +0200 Subject: [PATCH] gnu: yt-dlp: Fix substitution for ffmpeg path. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- gnu/packages/video.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 40133bfbd4..ab19c2dd8c 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -64,6 +64,7 @@ ;;; Copyright © 2022 Chadwain Holness ;;; Copyright © 2022 Andy Tai ;;; Copyright © 2023 Ott Joon +;;; Copyright © 2023 Dominik Delgado Steuter ;;; ;;; This file is part of GNU Guix. ;;; @@ -2570,10 +2571,13 @@ (define-public yt-dlp #~(modify-phases #$phases ;; See the comment for the corresponding phase in youtube-dl. (replace 'default-to-the-ffmpeg-input - (lambda _ + (lambda* (#:key inputs #:allow-other-keys) (substitute* "yt_dlp/postprocessor/ffmpeg.py" - (("\\.get_param\\('ffmpeg_location'\\)" match) - (format #f "~a or '~a'" match (which "ffmpeg")))))) + (("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")