From 354d66b2eba83f5e0ed1d7f55f6055d0be3f962e Mon Sep 17 00:00:00 2001
* gnu/packages/video.scm (youtube-viewer-cli): New variable.
gnu/packages/video.scm | 62 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
Toggle diff (75 lines)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index dfcfc121a..c6bd9063c 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -1521,6 +1521,68 @@ Both command-line and GTK2 interface are available.")
(home-page "https://github.com/trizen/youtube-viewer")
(license license:perl-license)))
+(define-public youtube-viewer-cli
+ (name "youtube-viewer-cli")
+ (url "https://github.com/trizen/youtube-viewer.git")
+ (file-name (git-file-name name version))
+ "0axgb95lx81psgrb2a5rfdd8gl4mhsrzf41jas6l58d1xkaj54ri"))))
+ (build-system perl-build-system)
+ `(("perl-module-build" ,perl-module-build)))
+ ;; FIXME: Add optional dependencies once available:
+ ;; perl-lwp-useragent-cached
+ `(("perl-data-dump" ,perl-data-dump)
+ ("perl-file-sharedir" ,perl-file-sharedir)
+ ("perl-json" ,perl-json)
+ ("perl-libwww" ,perl-libwww)
+ ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
+ ;; The LWP::UserAgent::Cache module is recommended
+ ("perl-mozilla-ca" ,perl-mozilla-ca)
+ ;; ("perl-term-readline-gnu" ,perl-term-readline-gnu) not in guix yet
+ ("perl-unicode-linebreak" ,perl-unicode-linebreak)))
+ `(#:modules ((guix build perl-build-system)
+ (modify-phases %standard-phases
+ (add-after 'install 'wrap-program
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin-dir (string-append out "/bin/"))
+ (site-dir (string-append out "/lib/perl5/site_perl/"))
+ (lib-path (getenv "PERL5LIB")))
+ (for-each (cut wrap-program <>
+ `("PERL5LIB" ":" prefix (,lib-path ,site-dir)))
+ (add-after 'wrap-program 'rename
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin-dir (string-append out "/bin/")))
+ (rename-file "youtube-viewer"
+ "youtube-viewer-cli")))))))
+ "CLI application for searching and streaming videos from YouTube")
+ "Youtube-viewer-cli searches and plays YouTube videos from the command line.
+It comes with various search options; it can search for videos, playlists
+and/or channels. The videos are streamed directly in a selected video player
+at the best resolution (customizable) and with closed-captions (if available).
+GTK2 interface is available in @package{youtube-viewer-gtk}.")
+ (home-page "https://github.com/trizen/youtube-viewer")
+ (license license:perl-license)))