Subject: [bug#76015] [PATCH] gnu: haruna: Fix finding yt-dlp.

From: Z572 <[email-masked]>
Date: Fri, 07 Feb 2025 01:17:00 +0800

Sughosha via Guix-patches via <[email-masked]> writes:

> * gnu/packages/kde-multimedia.scm (yt-dlp)[arguments]<#:phases>: Add wrap-path.
>
> Change-Id: I4f2f7303b02441399c042d4bdd8e7586adfd9fe3
> ---
>  gnu/packages/kde-multimedia.scm | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/kde-multimedia.scm b/gnu/packages/kde-multimedia.scm
> index ad0b504268..4d859cdedb 100644
> --- a/gnu/packages/kde-multimedia.scm
> +++ b/gnu/packages/kde-multimedia.scm
> @@ -156,7 +156,15 @@ (define-public haruna
>                 (base32 "0gvwsxlrwn2s6i4agmwa0r1lq1fybfyxv933g2z3n76qnn9mkbrb"))))
>      (build-system qt-build-system)
>      (arguments
> -     (list #:qtbase qtbase))
> +     (list #:qtbase qtbase
> +           #:phases
> +           #~(modify-phases %standard-phases
> +               (add-after 'qt-wrap 'wrap-path
> +                 (lambda _
> +                   (wrap-program (string-append #$output "/bin/haruna")
> +                     `("PATH" ":" prefix
> +                       (,(string-append #$(this-package-input "yt-dlp")
> +                                       "/bin")))))))))

see src/application.cpp
QString Application::youtubeDlExecutable()
{
    auto ytDlp = QStandardPaths::findExecutable(u"yt-dlp"_s);
    if (!ytDlp.isEmpty()) {
        return ytDlp;
    }

    auto youtubeDl = QStandardPaths::findExecutable(u"youtube-dl"_s);
    if (!youtubeDl.isEmpty()) {
        return youtubeDl;
    }

    return QString();
}

It is better to replace findExecutable(u"yt-dlp"_s) with
findExecutable(u"/gnu/store/xxxx/bin/yt-dlp"_s)

>      (native-inputs
>       (list extra-cmake-modules))
>      (inputs
>
> base-commit: 070c073d508d3197f0235adc424aec287e7dd916