[PATCH 0/5] gnu: Add youtube-viewer.

  • Done
  • quality assurance status badge
Details
2 participants
  • Alex Vong
  • Marius Bakke
Owner
unassigned
Submitted by
Alex Vong
Severity
normal
A
A
Alex Vong wrote on 25 Feb 2018 00:27
(address . guix-patches@gnu.org)(address . alexvong1995@gmail.com)
87sh9qvuhz.fsf@gmail.com
Tags: patch

Hello,

This patch series adds youtube-viewer and its dependencies. It can be
used for searching youtube videos without running javascript. It also
plays nice with tor which is a plus.

Cheers,
Alex
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpH02AAKCRAcGaIXrbrA
rVW6AQD+AY9BhomxiCKHy9DEdA0JRT17vJEomNImGVsNgfvJVwEAyQJ7VLWGh/3Q
uf1qo/2prpb7g+/1e3U7ow0qpBqdgAg=
=F4a0
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 25 Feb 2018 00:30
[PATCH 1/5] gnu: Add perl-cairo.
(address . 30598@debbugs.gnu.org)(address . alexvong1995@gmail.com)
87o9kevuci.fsf@gmail.com
From 3099c40fff2441df1451b16665839c8cf92cf75b Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Sun, 25 Feb 2018 06:48:47 +0800
Subject: [PATCH 1/5] gnu: Add perl-cairo.

* gnu/packages/perl.scm (perl-cairo): New public variable.
---
gnu/packages/perl.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (54 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index cef42847c..c9de36a45 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -19,6 +19,7 @@
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -45,6 +46,7 @@
#:use-module (guix build-system perl)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages gtk)
#:use-module (gnu packages perl-check)
#:use-module (gnu packages perl-web)
#:use-module (gnu packages pkg-config))
@@ -680,6 +682,31 @@ processes can safely access the cache at the same time. It uses a basic LRU
algorithm to keep the most used entries in the cache.")
(license (package-license perl))))
+(define-public perl-cairo
+ (package
+ (name "perl-cairo")
+ (version "1.106")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/X/XA/XAOC/Cairo-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1i25kks408c54k2zxskvg54l5k3qadzm8n72ffga9jy7ic0h6j76"))))
+ (build-system perl-build-system)
+ (native-inputs
+ `(("perl-extutils-depends" ,perl-extutils-depends)
+ ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
+ (inputs
+ `(("cairo" ,cairo)))
+ (home-page "http://search.cpan.org/dist/Cairo/")
+ (synopsis "Perl interface to the cairo 2d vector graphics library")
+ (description "Cairo provides Perl bindings for the vector graphics library
+cairo. It supports multiple output targets, including PNG, PDF and SVG. Cairo
+produces identical output on all those targets.")
+ (license lgpl2.1+)))
+
(define-public perl-capture-tiny
(package
(name "perl-capture-tiny")
--
2.16.2
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpH1nQAKCRAcGaIXrbrA
rUkcAQCIledV5eQKYi60UeC3E5l0LrLVVZLpq5qk5lLCz/9fIgEAjkkZWjlIOOgF
rKQUZB8W7xyRM/hC47Rk75j3la97kwQ=
=LZRo
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 25 Feb 2018 00:31
[PATCH 2/5] gnu: Add perl-glib.
(address . 30598@debbugs.gnu.org)(address . alexvong1995@gmail.com)
87k1v2vua8.fsf@gmail.com
From 34eca4250f6cd4e4ce7e7c5850f25bbb7f6ab9f7 Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Sun, 25 Feb 2018 06:49:54 +0800
Subject: [PATCH 2/5] gnu: Add perl-glib.

* gnu/packages/perl.scm (perl-glib): New public variable.
---
gnu/packages/perl.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index c9de36a45..628019986 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -46,6 +46,7 @@
#:use-module (guix build-system perl)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages glib)
#:use-module (gnu packages gtk)
#:use-module (gnu packages perl-check)
#:use-module (gnu packages perl-web)
@@ -3794,6 +3795,33 @@ vaguely inspired by John Ousterhout's Tk_ParseArgv.")
"Getopt-Tabular-" version))
(license (package-license perl))))
+(define-public perl-glib
+ (package
+ (name "perl-glib")
+ (version "1.326")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/X/XA/XAOC/Glib-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0prn9kkdpwjq9qmzqashbhk3pq4gvlrmvm3b10xf1dhc48406382"))))
+ (build-system perl-build-system)
+ (native-inputs
+ `(("perl-extutils-depends" ,perl-extutils-depends)
+ ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
+ (inputs
+ `(("glib" ,glib)))
+ (home-page "http://search.cpan.org/dist/Glib/")
+ (synopsis "Perl wrappers for the GLib utility and Object libraries")
+ (description "This module provides perl access to GLib and GLib's GObject
+libraries. GLib is a portability and utility library; GObject provides a
+generic type system with inheritance and a powerful signal system. Together
+these libraries are used as the foundation for many of the libraries that make
+up the Gnome environment, and are used in many unrelated projects.")
+ (license lgpl2.1+)))
+
(define-public perl-graph
(package
(name "perl-graph")
--
2.16.2
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpH17wAKCRAcGaIXrbrA
rQECAP4kUPE3hGSrBy5Bw6VQfeoVuAYWwFF+NflT1j3uzIqUIAEA7FZHw3VmsZ4u
/rJc5afKD9R4MsVX5QDuS0rg+Bh+xwY=
=RbuL
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 25 Feb 2018 00:32
[PATCH 3/5] gnu: Add perl-pango.
(address . 30598@debbugs.gnu.org)(address . alexvong1995@gmail.com)
87fu5qvu9c.fsf@gmail.com
From 6f47089ff55964fd4129ac91af651ffca7fb79ea Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Sun, 25 Feb 2018 06:51:43 +0800
Subject: [PATCH 3/5] gnu: Add perl-pango.

* gnu/packages/perl.scm (perl-pango): New public variable.
---
gnu/packages/perl.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (50 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 628019986..9ec581abf 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -6469,6 +6469,43 @@ show those variables which are in scope at the point of the call. PadWalker
is particularly useful for debugging.")
(license (package-license perl))))
+(define-public perl-pango
+ (package
+ (name "perl-pango")
+ (version "1.227")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://cpan/authors/id/X/XA/XAOC/Pango-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0wdcidnfnb6nm79fzfs39ivawj3x8m98a147fmcxgv1zvwia9c1l"))))
+ (build-system perl-build-system)
+ (native-inputs
+ `(("perl-extutils-depends" ,perl-extutils-depends)
+ ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
+ (inputs
+ `(("pango" ,pango)))
+ (propagated-inputs
+ `(("perl-cairo" ,perl-cairo)
+ ("perl-glib" ,perl-glib)))
+ (home-page "http://search.cpan.org/dist/Pango/")
+ (synopsis "Layout and render international text")
+ (description "Pango is a library for laying out and rendering text, with an
+emphasis on internationalization. Pango can be used anywhere that text layout
+is needed, but using Pango in conjunction with Cairo and/or Gtk2 provides a
+complete solution with high quality text handling and graphics rendering.
+
+Dynamically loaded modules handle text layout for particular combinations of
+script and font backend. Pango provides a wide selection of modules, including
+modules for Hebrew, Arabic, Hangul, Thai, and a number of Indic scripts.
+Virtually all of the world's major scripts are supported.
+
+In addition to the low level layout rendering routines, Pango includes
+@code{Pango::Layout}, a high level driver for laying out entire blocks of text,
+and routines to assist in editing internationalized text.")
+ (license lgpl2.1+)))
+
(define-public perl-parallel-forkmanager
(package
(name "perl-parallel-forkmanager")
--
2.16.2
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpH2DwAKCRAcGaIXrbrA
rabyAQCf18kxpDrwNlgsXqpjPb2lrWl98wf1hxCJeP1Zel177gD9F2VmqAzzcR2S
7fJtnGlh7lZt07l4n5U0kCREcQ4VOwo=
=S4tt
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 25 Feb 2018 00:33
[PATCH 4/5] gnu: Add perl-gtk2.
(address . 30598@debbugs.gnu.org)(address . alexvong1995@gmail.com)
87bmgevu7y.fsf@gmail.com
From 8e946345fa5948e4990dfc84d2b5a7defb7f24e7 Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Sun, 25 Feb 2018 06:51:09 +0800
Subject: [PATCH 4/5] gnu: Add perl-gtk2.

* gnu/packages/perl.scm (perl-gtk2): New public variable.
---
gnu/packages/perl.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (40 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 9ec581abf..7dfd21009 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -3843,6 +3843,33 @@ up the Gnome environment, and are used in many unrelated projects.")
the abstract data structures.")
(license (package-license perl))))
+(define-public perl-gtk2
+ (package
+ (name "perl-gtk2")
+ (version "1.24992")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://cpan/authors/id/X/XA/XAOC/Gtk2-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1044rj3wbfmgaif2jb0k28m2aczli6ai2n5yvn6pr7zjyw16kvd2"))))
+ (build-system perl-build-system)
+ (native-inputs
+ `(("perl-extutils-depends" ,perl-extutils-depends)
+ ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
+ (inputs
+ `(("gtk+" ,gtk+-2)))
+ (propagated-inputs
+ `(("perl-pango" ,perl-pango)))
+ (home-page "http://search.cpan.org/dist/Gtk2/")
+ (synopsis "Perl interface to the 2.x series of the Gimp Toolkit library")
+ (description "Perl bindings to the 2.x series of the Gtk+ widget set.
+This module allows you to write graphical user interfaces in a Perlish and
+object-oriented way, freeing you from the casting and memory management in C,
+yet remaining very close in spirit to original API.")
+ (license lgpl2.1+)))
+
(define-public perl-guard
(package
(name "perl-guard")
--
2.16.2
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpH2QQAKCRAcGaIXrbrA
rbvLAP9ufBe3NDOWJtPOf8hVT4gvfQ/dbFLHYAcmevG1UAH1ywEAkE0ARvyJ5s7a
uDwJCFv/o/RTUwe6ux8rm5w8xaiJAwI=
=M70V
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 25 Feb 2018 00:33
[PATCH 5/5] gnu: Add youtube-viewer.
(address . 30598@debbugs.gnu.org)(address . alexvong1995@gmail.com)
877er2vu73.fsf@gmail.com
From c6106691811adea6d71cf1837d9278f76e14af00 Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Sun, 25 Feb 2018 06:52:10 +0800
Subject: [PATCH 5/5] gnu: Add youtube-viewer.

* gnu/packages/video.scm (youtube-viewer): New public variable.
---
gnu/packages/video.scm | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)

Toggle diff (60 lines)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index bf7a3960d..c87f2fbfb 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -53,6 +53,7 @@
#:use-module (guix build-system gnu)
#:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system meson)
+ #:use-module (guix build-system perl)
#:use-module (guix build-system python)
#:use-module (guix build-system waf)
#:use-module (gnu packages)
@@ -1311,6 +1312,45 @@ audio, images) from the Web. It can use either mpv or vlc for playback.")
(home-page "https://you-get.org/")
(license license:expat)))
+(define-public youtube-viewer
+ (package
+ (name "youtube-viewer")
+ (version "3.3.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/trizen/youtube-viewer/archive/"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1j572his6qmazlmyrbnfq62s9bqml875ay7wy26byy9hfc7m0vgk"))))
+ (build-system perl-build-system)
+ (native-inputs
+ `(("perl-module-build" ,perl-module-build)))
+ ;;; FIXME: Add optional dependencies once available.
+ (propagated-inputs
+ `(("perl-data-dump" ,perl-data-dump)
+ ("perl-file-sharedir" ,perl-file-sharedir)
+ ("perl-gtk2" ,perl-gtk2)
+ ("perl-json" ,perl-json)
+ ("perl-libwww" ,perl-libwww)
+ ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
+ ("perl-mozilla-ca" ,perl-mozilla-ca)
+ ("perl-unicode-linebreak" ,perl-unicode-linebreak)))
+ (arguments
+ `(#:module-build-flags '("--gtk")))
+ (synopsis
+ "Lightweight application for searching and streaming videos from YouTube")
+ (description
+ "Youtube-viewer searches and plays YouTube videos in a native player.
+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).
+Both command-line and GTK2 interface are available.")
+ (home-page "https://github.com/trizen/youtube-viewer")
+ (license license:perl-license)))
+
(define-public libbluray
(package
(name "libbluray")
--
2.16.2
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpH2YAAKCRAcGaIXrbrA
rZIyAP9dB/IwagvxPQ7Qp0+xDEHSf5FmY5bR+ZrjNuADRvNlGAD/XCupyZ+/0lTj
YOWUC58M7ynYbNGMYoMGOCYjg8h+dwc=
=Fjl9
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 26 Feb 2018 01:58
(address . alexvong1995@gmail.com)
87muzwwoqn.fsf@fastmail.com
Alex Vong <alexvong1995@gmail.com> writes:

Toggle quote (44 lines)
> From c6106691811adea6d71cf1837d9278f76e14af00 Mon Sep 17 00:00:00 2001
> From: Alex Vong <alexvong1995@gmail.com>
> Date: Sun, 25 Feb 2018 06:52:10 +0800
> Subject: [PATCH 5/5] gnu: Add youtube-viewer.
>
> * gnu/packages/video.scm (youtube-viewer): New public variable.
> ---
> gnu/packages/video.scm | 40 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
> index bf7a3960d..c87f2fbfb 100644
> --- a/gnu/packages/video.scm
> +++ b/gnu/packages/video.scm
> @@ -53,6 +53,7 @@
> #:use-module (guix build-system gnu)
> #:use-module (guix build-system glib-or-gtk)
> #:use-module (guix build-system meson)
> + #:use-module (guix build-system perl)
> #:use-module (guix build-system python)
> #:use-module (guix build-system waf)
> #:use-module (gnu packages)
> @@ -1311,6 +1312,45 @@ audio, images) from the Web. It can use either mpv or vlc for playback.")
> (home-page "https://you-get.org/")
> (license license:expat)))
>
> +(define-public youtube-viewer
> + (package
> + (name "youtube-viewer")
> + (version "3.3.3")
> + (source (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://github.com/trizen/youtube-viewer/archive/"
> + version ".tar.gz"))
> + (file-name (string-append name "-" version ".tar.gz"))
> + (sha256
> + (base32
> + "1j572his6qmazlmyrbnfq62s9bqml875ay7wy26byy9hfc7m0vgk"))))
> + (build-system perl-build-system)
> + (native-inputs
> + `(("perl-module-build" ,perl-module-build)))
> + ;;; FIXME: Add optional dependencies once available.

Which dependencies are those? :-)

Also, only two semicolons for normal comments.

Toggle quote (10 lines)
> + (propagated-inputs
> + `(("perl-data-dump" ,perl-data-dump)
> + ("perl-file-sharedir" ,perl-file-sharedir)
> + ("perl-gtk2" ,perl-gtk2)
> + ("perl-json" ,perl-json)
> + ("perl-libwww" ,perl-libwww)
> + ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
> + ("perl-mozilla-ca" ,perl-mozilla-ca)
> + ("perl-unicode-linebreak" ,perl-unicode-linebreak)))

I haven't built this yet, but assuming it's a single executable, could
you try to wrap it with the PERL5LIB variable? That way we don't have
to propagate all of these in end user profiles.

Toggle quote (18 lines)
> + (arguments
> + `(#:module-build-flags '("--gtk")))
> + (synopsis
> + "Lightweight application for searching and streaming videos from YouTube")
> + (description
> + "Youtube-viewer searches and plays YouTube videos in a native player.
> +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).
> +Both command-line and GTK2 interface are available.")
> + (home-page "https://github.com/trizen/youtube-viewer")
> + (license license:perl-license)))
> +
> (define-public libbluray
> (package
> (name "libbluray")
> --
> 2.16.2
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqTW8AACgkQoqBt8qM6
VPq4OQgAxr34pARz6nUyxJ0e1aUGLDBMPkhykxLQeZdStoXY/r6tmM7Fb7rAg7ux
lWrL2p0AxZ8WLFBCgEnxRzbYrtS2SbK4/EEOyUHcZm2nUWNDzteAWExkRTx/mnJp
lYS50zk/EN/VP/nZ3miOMpZerNlzq6XFCjh0eOg2Bhf40rxrZb3AKGWZK3/sCD8l
N+sTh7Ce0MK2Z0coHTY9e07WA2Yu6RVAH6/60mYCueMfQ7qtklzS/Grry408/RO+
RZJ1youOxnmD7yP/5Pf+S+KfLijD1AYJJihyJv5uDL/c3WJ4tMXL/NSP+jVD3SFg
l9R1DLXDzlDUQ2sdQWF3RFbrlFcHyQ==
=m9W4
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 26 Feb 2018 02:03
Re: [bug#30598] [PATCH 0/5] gnu: Add youtube-viewer.
(address . alexvong1995@gmail.com)
87k1v0woiv.fsf@fastmail.com
Alex Vong <alexvong1995@gmail.com> writes:

Toggle quote (8 lines)
> Tags: patch
>
> Hello,
>
> This patch series adds youtube-viewer and its dependencies. It can be
> used for searching youtube videos without running javascript. It also
> plays nice with tor which is a plus.

Thanks for this series! The patches LGTM, but can you move the perl
packages to gtk.scm and glib.scm respectively? That seems more
appropriate, as we already have e.g. pygtk in gtk.scm, and also avoids
some top-module cross-references.

(Additionally, perl.scm is huge, so it's good to spread the load to
appease the Guile compiler)

Thanks in advance! :-)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqTXNgACgkQoqBt8qM6
VPoYlQf/WskI+VR2aMkDB+Nxg6Vrm60JTpL4OZGlRJUA/7Harc1BJTFarLgNvhs4
qHqqn5943mr3d8CtIcPmbL2eBdCtonFR8WjGHJ0l+nRzSOa+T2pfSGd5TpiP5EvQ
jzGUvp9j9h/TKxPr99AkQxbROQoJI4N9U3TqHWQVfRd+/xU0qTpBMlpUgShs9to6
RcC1wEbqFytXd+IdYxXQugrsGWAe1E1F9Aiuk/KRro/uFYTVWFOh/K83wyuGx9IT
PFHxkGXuhMgSITPLz20dMALbJAKSyU6a40UShq/GZoaHAyl1tLeVila7rLkAgSL2
yLpdQRAW7lUd7sSui3iR99bfd/V9lA==
=fKl9
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 26 Feb 2018 19:49
[PATCH 1/5] gnu: Add perl-cairo.
(address . 30598@debbugs.gnu.org)(address . alexvong1995@gmail.com)
87fu5nmvrk.fsf@gmail.com
From f541d27bcc6e7670e612ee83478a1ccec891cfec Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Sun, 25 Feb 2018 06:48:47 +0800
Subject: [PATCH 1/5] gnu: Add perl-cairo.

* gnu/packages/perl.scm (perl-cairo): New public variable.
---
gnu/packages/perl.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (54 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index cef42847c..c9de36a45 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -19,6 +19,7 @@
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -45,6 +46,7 @@
#:use-module (guix build-system perl)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages gtk)
#:use-module (gnu packages perl-check)
#:use-module (gnu packages perl-web)
#:use-module (gnu packages pkg-config))
@@ -680,6 +682,31 @@ processes can safely access the cache at the same time. It uses a basic LRU
algorithm to keep the most used entries in the cache.")
(license (package-license perl))))
+(define-public perl-cairo
+ (package
+ (name "perl-cairo")
+ (version "1.106")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/X/XA/XAOC/Cairo-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1i25kks408c54k2zxskvg54l5k3qadzm8n72ffga9jy7ic0h6j76"))))
+ (build-system perl-build-system)
+ (native-inputs
+ `(("perl-extutils-depends" ,perl-extutils-depends)
+ ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
+ (inputs
+ `(("cairo" ,cairo)))
+ (home-page "http://search.cpan.org/dist/Cairo/")
+ (synopsis "Perl interface to the cairo 2d vector graphics library")
+ (description "Cairo provides Perl bindings for the vector graphics library
+cairo. It supports multiple output targets, including PNG, PDF and SVG. Cairo
+produces identical output on all those targets.")
+ (license lgpl2.1+)))
+
(define-public perl-capture-tiny
(package
(name "perl-capture-tiny")
--
2.16.2
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpRWrwAKCRAcGaIXrbrA
rX5zAP9BGYgGECnCtZJDCMWp6xXUMcvBcKjCKFQEFLi9jAGA3QEAwMaJifqd4S47
QXYjHxq0IvKncS+GZFE2E95wOvSf7gg=
=5F7i
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 26 Feb 2018 19:49
[PATCH 2/5] gnu: Add perl-glib.
(address . 30598@debbugs.gnu.org)(address . alexvong1995@gmail.com)
87bmgbmvqq.fsf@gmail.com
From 169a401d4b2b3ed77b2f050a3fbbc6d8f74915af Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Sun, 25 Feb 2018 06:49:54 +0800
Subject: [PATCH 2/5] gnu: Add perl-glib.

* gnu/packages/glib.scm (perl-glib): New public variable.
---
gnu/packages/glib.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index d32472b85..fb5989665 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Petter <petter@mykolab.ch>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -622,6 +623,33 @@ useful for C++.")
("python-pycairo" ,python2-pycairo)
("gobject-introspection" ,gobject-introspection)))))
+(define-public perl-glib
+ (package
+ (name "perl-glib")
+ (version "1.326")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/X/XA/XAOC/Glib-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0prn9kkdpwjq9qmzqashbhk3pq4gvlrmvm3b10xf1dhc48406382"))))
+ (build-system perl-build-system)
+ (native-inputs
+ `(("perl-extutils-depends" ,perl-extutils-depends)
+ ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
+ (inputs
+ `(("glib" ,glib)))
+ (home-page "http://search.cpan.org/dist/Glib/")
+ (synopsis "Perl wrappers for the GLib utility and Object libraries")
+ (description "This module provides perl access to GLib and GLib's GObject
+libraries. GLib is a portability and utility library; GObject provides a
+generic type system with inheritance and a powerful signal system. Together
+these libraries are used as the foundation for many of the libraries that make
+up the Gnome environment, and are used in many unrelated projects.")
+ (license license:lgpl2.1+)))
+
(define telepathy-glib
(package
(name "telepathy-glib")
--
2.16.2
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpRWzQAKCRAcGaIXrbrA
rdB6AQD647zAtiChH+kYZNBQTgoSpXT4qh6g/Ta29fDAi2wYFwD/bpnoCTV5Alp8
A9R14OJNPsDdVLd14pNqyw/VLSOGtws=
=w9wi
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 26 Feb 2018 19:50
[PATCH 3/5] gnu: Add perl-pango.
(address . 30598@debbugs.gnu.org)(address . alexvong1995@gmail.com)
877eqzmvq3.fsf@gmail.com
From 32c5cc61a5aefbb69de2bf95e377acc65d77499f Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Sun, 25 Feb 2018 06:51:43 +0800
Subject: [PATCH 3/5] gnu: Add perl-pango.

* gnu/packages/perl.scm (perl-pango): New public variable.
---
gnu/packages/perl.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (58 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index c9de36a45..a276df6fb 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -46,6 +46,7 @@
#:use-module (guix build-system perl)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages glib)
#:use-module (gnu packages gtk)
#:use-module (gnu packages perl-check)
#:use-module (gnu packages perl-web)
@@ -6441,6 +6442,43 @@ show those variables which are in scope at the point of the call. PadWalker
is particularly useful for debugging.")
(license (package-license perl))))
+(define-public perl-pango
+ (package
+ (name "perl-pango")
+ (version "1.227")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://cpan/authors/id/X/XA/XAOC/Pango-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0wdcidnfnb6nm79fzfs39ivawj3x8m98a147fmcxgv1zvwia9c1l"))))
+ (build-system perl-build-system)
+ (native-inputs
+ `(("perl-extutils-depends" ,perl-extutils-depends)
+ ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
+ (inputs
+ `(("pango" ,pango)))
+ (propagated-inputs
+ `(("perl-cairo" ,perl-cairo)
+ ("perl-glib" ,perl-glib)))
+ (home-page "http://search.cpan.org/dist/Pango/")
+ (synopsis "Layout and render international text")
+ (description "Pango is a library for laying out and rendering text, with an
+emphasis on internationalization. Pango can be used anywhere that text layout
+is needed, but using Pango in conjunction with Cairo and/or Gtk2 provides a
+complete solution with high quality text handling and graphics rendering.
+
+Dynamically loaded modules handle text layout for particular combinations of
+script and font backend. Pango provides a wide selection of modules, including
+modules for Hebrew, Arabic, Hangul, Thai, and a number of Indic scripts.
+Virtually all of the world's major scripts are supported.
+
+In addition to the low level layout rendering routines, Pango includes
+@code{Pango::Layout}, a high level driver for laying out entire blocks of text,
+and routines to assist in editing internationalized text.")
+ (license lgpl2.1+)))
+
(define-public perl-parallel-forkmanager
(package
(name "perl-parallel-forkmanager")
--
2.16.2
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpRW5AAKCRAcGaIXrbrA
raE8AQCVZQCtuKyCjcAsa3uYm/Ge9yeIiolq8StUvDTqazpbnAEA2l9r3UOvp8mh
oI28S4ImVoPISkLmbc741WAJugN+8A4=
=O5Zi
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 26 Feb 2018 19:51
[PATCH 4/5] gnu: Add perl-gtk2.
(address . 30598@debbugs.gnu.org)(address . alexvong1995@gmail.com)
87371nmvop.fsf@gmail.com
From 92c6e1eedf87c38eb24a76aff41e8a1366ea6ebc Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Sun, 25 Feb 2018 06:51:09 +0800
Subject: [PATCH 4/5] gnu: Add perl-gtk2.

* gnu/packages/gtk.scm (perl-gtk2): New public variable.
---
gnu/packages/gtk.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 2939e4f64..1eb1bffb6 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -40,6 +41,7 @@
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system perl)
#:use-module (guix build-system python)
#:use-module (guix build-system waf)
#:use-module (gnu packages)
@@ -1238,6 +1240,33 @@ targeted at GTK 2.x, and can be used in conjunction with gnome-python to
write GNOME applications.")
(license license:lgpl2.1+)))
+(define-public perl-gtk2
+ (package
+ (name "perl-gtk2")
+ (version "1.24992")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://cpan/authors/id/X/XA/XAOC/Gtk2-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1044rj3wbfmgaif2jb0k28m2aczli6ai2n5yvn6pr7zjyw16kvd2"))))
+ (build-system perl-build-system)
+ (native-inputs
+ `(("perl-extutils-depends" ,perl-extutils-depends)
+ ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
+ (inputs
+ `(("gtk+" ,gtk+-2)))
+ (propagated-inputs
+ `(("perl-pango" ,perl-pango)))
+ (home-page "http://search.cpan.org/dist/Gtk2/")
+ (synopsis "Perl interface to the 2.x series of the Gimp Toolkit library")
+ (description "Perl bindings to the 2.x series of the Gtk+ widget set.
+This module allows you to write graphical user interfaces in a Perlish and
+object-oriented way, freeing you from the casting and memory management in C,
+yet remaining very close in spirit to original API.")
+ (license license:lgpl2.1+)))
+
(define-public girara
(package
(name "girara")
--
2.16.2
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpRXFgAKCRAcGaIXrbrA
rZcuAP0Vd4Sktekvtc6zBcblrg/HlJqtTSJFGMnHkE2hB69eDAEA4ixk4761GM3Q
83dLN80bA6KGxXbNeKNo+1vQXGvwLgs=
=mAOb
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 26 Feb 2018 19:51
[PATCH 5/5] gnu: Add youtube-viewer.
(address . 30598@debbugs.gnu.org)(address . alexvong1995@gmail.com)
87y3jflh3b.fsf@gmail.com
From 5334e61ed866f67af38688dac077f53f85ad013b Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Sun, 25 Feb 2018 06:52:10 +0800
Subject: [PATCH 5/5] gnu: Add youtube-viewer.

* gnu/packages/video.scm (youtube-viewer): New public variable.
---
gnu/packages/video.scm | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Toggle diff (74 lines)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index bf7a3960d..48b86a5ac 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -53,6 +53,7 @@
#:use-module (guix build-system gnu)
#:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system meson)
+ #:use-module (guix build-system perl)
#:use-module (guix build-system python)
#:use-module (guix build-system waf)
#:use-module (gnu packages)
@@ -1311,6 +1312,59 @@ audio, images) from the Web. It can use either mpv or vlc for playback.")
(home-page "https://you-get.org/")
(license license:expat)))
+(define-public youtube-viewer
+ (package
+ (name "youtube-viewer")
+ (version "3.3.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/trizen/youtube-viewer/archive/"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1j572his6qmazlmyrbnfq62s9bqml875ay7wy26byy9hfc7m0vgk"))))
+ (build-system perl-build-system)
+ (native-inputs
+ `(("perl-module-build" ,perl-module-build)))
+ ;; FIXME: Add optional dependencies once available:
+ ;; perl-lwp-useragent-cached and perl-term-readline-gnu
+ (inputs
+ `(("perl-data-dump" ,perl-data-dump)
+ ("perl-file-sharedir" ,perl-file-sharedir)
+ ("perl-gtk2" ,perl-gtk2)
+ ("perl-json" ,perl-json)
+ ("perl-libwww" ,perl-libwww)
+ ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
+ ("perl-mozilla-ca" ,perl-mozilla-ca)
+ ("perl-unicode-linebreak" ,perl-unicode-linebreak)))
+ (arguments
+ `(#:modules ((guix build perl-build-system)
+ (guix build utils)
+ (srfi srfi-26))
+ #:module-build-flags '("--gtk")
+ #:phases (modify-phases %standard-phases
+ (add-after 'install 'wrap-program
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((bin-dir (string-append (assoc-ref outputs "out")
+ "/bin/"))
+ (perl-path (getenv "PERL5LIB")))
+ (for-each (cut wrap-program <>
+ `("PERL5LIB" ":" prefix (,perl-path)))
+ (find-files bin-dir))
+ #t))))))
+ (synopsis
+ "Lightweight application for searching and streaming videos from YouTube")
+ (description
+ "Youtube-viewer searches and plays YouTube videos in a native player.
+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).
+Both command-line and GTK2 interface are available.")
+ (home-page "https://github.com/trizen/youtube-viewer")
+ (license license:perl-license)))
+
(define-public libbluray
(package
(name "libbluray")
--
2.16.2
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpRXOAAKCRAcGaIXrbrA
rXHpAP9GnpptHkobyRls4hQYRxjRYD8982zvLuTYZpY/okAZEQD+LxdEHj46Tjrv
Brw/WImfsRAK3zdSPdAX4cc7pHgy7A0=
=CbcT
-----END PGP SIGNATURE-----

A
A
Alex Vong wrote on 26 Feb 2018 20:30
Re: [bug#30598] [PATCH 0/5] gnu: Add youtube-viewer.
(name . Marius Bakke)(address . mbakke@fastmail.com)
87efl74khh.fsf@gmail.com
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (20 lines)
> Alex Vong <alexvong1995@gmail.com> writes:
>
>> Tags: patch
>>
>> Hello,
>>
>> This patch series adds youtube-viewer and its dependencies. It can be
>> used for searching youtube videos without running javascript. It also
>> plays nice with tor which is a plus.
>
> Thanks for this series! The patches LGTM, but can you move the perl
> packages to gtk.scm and glib.scm respectively? That seems more
> appropriate, as we already have e.g. pygtk in gtk.scm, and also avoids
> some top-module cross-references.
>
> (Additionally, perl.scm is huge, so it's good to spread the load to
> appease the Guile compiler)
>
> Thanks in advance! :-)

(I messed up my mail settings, so I am re-sending.)

The next patch series should fix everything you've mentioned so far. I
don't understand why wrap-program is used before but now I do.

Thanks for your review also!
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQTdXC2pN4kXBjiMDs8cGaIXrbrArQUCWpRgSgAKCRAcGaIXrbrA
rckoAPoDrfLONE6Smi2Rs0AV0OMNCo2GwHVlDk+h/+aMP9JQmQD+K4mB79HkBMrf
TBHxERlj23d4wb8UYpXAo3F3uew86gY=
=GMZe
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 28 Feb 2018 17:07
(name . Alex Vong)(address . alexvong1995@gmail.com)
877eqxumgf.fsf@fastmail.com
Alex Vong <alexvong1995@gmail.com> writes:

Toggle quote (27 lines)
> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Alex Vong <alexvong1995@gmail.com> writes:
>>
>>> Tags: patch
>>>
>>> Hello,
>>>
>>> This patch series adds youtube-viewer and its dependencies. It can be
>>> used for searching youtube videos without running javascript. It also
>>> plays nice with tor which is a plus.
>>
>> Thanks for this series! The patches LGTM, but can you move the perl
>> packages to gtk.scm and glib.scm respectively? That seems more
>> appropriate, as we already have e.g. pygtk in gtk.scm, and also avoids
>> some top-module cross-references.
>>
>> (Additionally, perl.scm is huge, so it's good to spread the load to
>> appease the Guile compiler)
>>
>> Thanks in advance! :-)
>
> (I messed up my mail settings, so I am re-sending.)
>
> The next patch series should fix everything you've mentioned so far. I
> don't understand why wrap-program is used before but now I do.

Excellent, thank you! I moved the perl-cairo and perl-pango packages to
gtk.scm as well and pushed the series as b0a2c9cbe..6f45e45d4.

Toggle quote (2 lines)
> Thanks for your review also!

:-)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqW09AACgkQoqBt8qM6
VPoH+wf/fk7NCFMluzqdm4W21PMog4hzwva8z4kB/JgWe34R1ru9dk2HmwGp+6qm
ry2Qe4VETIeMbZhsTKXJKc9girND9yx/d2E5LuilP94RAy6wBSE4DCjSIlxXEUk1
9vo3LBY/WtZ+j728Uc7A6MDpFPdVVB2rBKWtBRiJmXIPJDyj588YgGg45hixTOIA
QD/xtGlBtcq8t2ow8CcubFAUp3ndhcsdwyaGRWPesqXFvE9T1m6p3iqXwDVDvkpu
04Cnqta/9qeD69gJsqLOTYazzWGfAfCnkyYO+eLuzJjoWhZfRAPit3R3PKy39AXG
PfqTiLblT/qf7VzNn+9uB7fE0T21UA==
=HPzr
-----END PGP SIGNATURE-----

Closed
?