diff mbox series

[bug#63117] gnu: yt-dlp: Fix substitution for ffmpeg path.

Message ID 20230505195053.1752-1-dds@disroot.org
State New
Headers show
Series [bug#63117] gnu: yt-dlp: Fix substitution for ffmpeg path. | expand

Commit Message

Dominik Delgado Steuter May 5, 2023, 7:50 p.m. UTC
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.
---
 gnu/packages/video.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


base-commit: 6922069bcbe5c08da09c00e5aad44e390ebd1cc7

Comments

Liliana Marie Prikler May 6, 2023, 4:23 a.m. UTC | #1
Am Freitag, dem 05.05.2023 um 21:50 +0200 schrieb Dominik Delgado
Steuter:
> 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.
> ---
>  gnu/packages/video.scm | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
> index 65fd92e..1301b79 100644
> --- a/gnu/packages/video.scm
> +++ b/gnu/packages/video.scm
> @@ -64,6 +64,7 @@
>  ;;; Copyright © 2022 Chadwain Holness <chadwainholness@gmail.com>
>  ;;; Copyright © 2022 Andy Tai <atai@atai.org>
>  ;;; Copyright © 2023 Ott Joon <oj@vern.cc>
> +;;; Copyright © 2023 Dominik Delgado Steuter <dds@disroot.org>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -2570,8 +2571,8 @@ (define-public yt-dlp
>              (replace 'default-to-the-ffmpeg-input
>                (lambda _
>                  (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 = '" #$ffmpeg
> "/bin'\n")))))
The proper expression would be 
  (dirname (search-input-file inputs "bin/ffmpeg"))
You also need to make the (lambda _ ...) into a 
(lambda* (#:key inputs #:allow-other-keys) ...)
>              (replace 'build-generated-files
>                (lambda* (#:key inputs #:allow-other-keys)
>                  (if (assoc-ref inputs "pandoc")
> 
> base-commit: 6922069bcbe5c08da09c00e5aad44e390ebd1cc7

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 65fd92e..1301b79 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -64,6 +64,7 @@ 
 ;;; Copyright © 2022 Chadwain Holness <chadwainholness@gmail.com>
 ;;; Copyright © 2022 Andy Tai <atai@atai.org>
 ;;; Copyright © 2023 Ott Joon <oj@vern.cc>
+;;; Copyright © 2023 Dominik Delgado Steuter <dds@disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2570,8 +2571,8 @@  (define-public yt-dlp
             (replace 'default-to-the-ffmpeg-input
               (lambda _
                 (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 = '" #$ffmpeg "/bin'\n")))))
             (replace 'build-generated-files
               (lambda* (#:key inputs #:allow-other-keys)
                 (if (assoc-ref inputs "pandoc")