gnu: youtube-viewer: Refer to youtube-dl.

* gnu/packages/video.scm (youtube-viewer)[inputs]: Add youtube-dl.
[arguments]: Add ‘refer-to-inputs’ phase.
This commit is contained in:
Tobias Geerinckx-Rice 2019-06-17 03:02:34 +02:00
parent a157fb2723
commit 58637415be
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
1 changed files with 11 additions and 1 deletions

View File

@ -1627,7 +1627,10 @@ audio, images) from the Web. It can use either mpv or vlc for playback.")
("perl-libwww" ,perl-libwww) ("perl-libwww" ,perl-libwww)
("perl-lwp-protocol-https" ,perl-lwp-protocol-https) ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
("perl-mozilla-ca" ,perl-mozilla-ca) ("perl-mozilla-ca" ,perl-mozilla-ca)
("perl-unicode-linebreak" ,perl-unicode-linebreak))) ("perl-unicode-linebreak" ,perl-unicode-linebreak)
;; Some videos play without youtube-dl, but others silently fail to.
("youtube-dl" ,youtube-dl)))
(arguments (arguments
`(#:modules ((guix build perl-build-system) `(#:modules ((guix build perl-build-system)
(guix build utils) (guix build utils)
@ -1635,6 +1638,13 @@ audio, images) from the Web. It can use either mpv or vlc for playback.")
#:module-build-flags '("--gtk") #:module-build-flags '("--gtk")
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'refer-to-inputs
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "lib/WWW/YoutubeViewer.pm"
(("'youtube-dl'")
(format #f "'~a/bin/youtube-dl'"
(assoc-ref inputs "youtube-dl"))))
#t))
(add-after 'install 'install-desktop (add-after 'install 'install-desktop
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))