[PATCH 1/3] gnu: Add python-readability.

  • Done
  • quality assurance status badge
Details
3 participants
  • Léo Le Bouter
  • Nicolas Goaziou
  • zimoun
Owner
unassigned
Submitted by
Léo Le Bouter
Severity
normal
L
L
Léo Le Bouter wrote on 27 Feb 2021 23:34
(address . guix-patches@gnu.org)(name . Léo Le Bouter)(address . lle-bout@zaclys.net)
20210227223440.18685-1-lle-bout@zaclys.net
* gnu/packages/python-xyz.scm (python-readability): New variable.
---
gnu/packages/python-xyz.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c10a55e8b6..1ff51d1b2c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -23985,3 +23985,26 @@ and frame grabber interface.")
(description
"A screencast tool to display your keys inspired by Screenflick.")
(license license:gpl3+)))
+
+(define-public python-readability
+ (package
+ (name "python-readability")
+ (version "0.3.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "readability" version))
+ (sha256
+ (base32
+ "1b8gq3g2zwvx0aivvdg56cc0bn7xw6f2v6psmxdx9aiipkw0s0zr"))))
+ (build-system python-build-system)
+ (home-page
+ "https://github.com/andreasvc/readability/")
+ (synopsis
+ "Measure the readability of a given text using surface
+characteristics")
+ (description
+ "An implementation of traditional readability measures based on simple
+surface characteristics. These measures are basically linear regressions
+based on the number of words, syllables, and sentences.")
+ (license license:asl2.0)))
--
2.30.1
L
L
Léo Le Bouter wrote on 27 Feb 2021 23:36
[PATCH 2/3] gnu: Add python-listparser.
(address . 46823@debbugs.gnu.org)(name . Léo Le Bouter)(address . lle-bout@zaclys.net)
20210227223631.18891-2-lle-bout@zaclys.net
* gnu/packages/python-xyz.scm (python-listparser): New variable.
---
gnu/packages/python-xyz.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 1ff51d1b2c..569a49ef36 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -23932,6 +23932,26 @@ and frame grabber interface.")
;; Yet another variant of the X/MIT license.
"https://github.com/python-pillow/Sane/blob/master/COPYING"))))
+(define-public python-listparser
+ (package
+ (name "python-listparser")
+ (version "0.18")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "listparser" version))
+ (sha256
+ (base32
+ "0hdqs1mmayw1r8yla43hgb4d9y3zqs5483vgf8j9ygczkd2wrq2b"))))
+ (build-system python-build-system)
+ (home-page
+ "https://github.com/kurtmckee/listparser")
+ (synopsis
+ "Parse subscription lists in Python")
+ (description
+ "Parse OPML, FOAF, and iGoogle subscription lists in Python.")
+ (license license:expat)))
+
(define-public python-screenkey
(package
(name "python-screenkey")
--
2.30.1
L
L
Léo Le Bouter wrote on 27 Feb 2021 23:36
[PATCH 3/3] gnu: Add gfeeds.
(address . 46823@debbugs.gnu.org)(name . Léo Le Bouter)(address . lle-bout@zaclys.net)
20210227223631.18891-3-lle-bout@zaclys.net
* gnu/packages/gnome-xyz.scm (gfeeds): New variable.
---
gnu/packages/gnome-xyz.scm | 68 ++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)

Toggle diff (97 lines)
diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index aa7949478c..47288b76fe 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -31,6 +31,7 @@
#:use-module (guix build-system gnu)
#:use-module (guix build-system copy)
#:use-module (guix build-system meson)
+ #:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -45,11 +46,16 @@
#:use-module (gnu packages inkscape)
#:use-module (gnu packages image)
#:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages ssh)
+ #:use-module (gnu packages time)
#:use-module (gnu packages tls)
#:use-module (gnu packages ruby)
+ #:use-module (gnu packages video)
#:use-module (gnu packages web)
+ #:use-module (gnu packages webkit)
#:use-module (gnu packages xml))
(define-public arc-icon-theme
@@ -929,3 +935,65 @@ pallete.")
outputs notifications to STDOUT in order to allow the user to process
notifications any way they prefer.")
(license license:expat))))
+
+(define-public gfeeds
+ (package
+ (name "gfeeds")
+ (version "0.16.2")
+ (source (origin
+ (method url-fetch)
+ (uri
+ (string-append
+ "https://gitlab.gnome.org/World/gfeeds/-/archive/" version
+ "/gfeeds-" version ".tar.bz2"))
+ (sha256
+ (base32
+ "05gwwzqfz29m477imd5vh84jfla1wnklwpc2sdxnqli72wg08fli"))))
+ (build-system meson-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-mpv-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "gfeeds/confManager.py"
+ (("mpv") (string-append (assoc-ref inputs "mpv") "/bin/mpv")))
+ #t))
+ (add-after 'install 'wrap-gfeeds
+ (lambda* (#:key outputs #:allow-other-keys)
+ (wrap-program (string-append
+ (assoc-ref outputs "out") "/bin/gfeeds")
+ `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
+ `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH")))
+ `("XDG_DATA_DIRS" ":" prefix (,(getenv "XDG_DATA_DIRS"))))
+ #t)))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("gobject-introspection" ,gobject-introspection)
+ ("glib:bin" ,glib "bin")
+ ("gtk+:bin" ,gtk+ "bin")))
+ (inputs
+ `(("python-pygobject" ,python-pygobject)
+ ("python-feedparser" ,python-feedparser)
+ ("python-pytz" ,python-pytz)
+ ("python-dateutil" ,python-dateutil)
+ ("python-requests" ,python-requests)
+ ("python-lxml" ,python-lxml)
+ ("python-html5lib" ,python-html5lib)
+ ("python-pillow" ,python-pillow)
+ ("python-beautifulsoup4" ,python-beautifulsoup4)
+ ("python-readability" ,python-readability)
+ ("python-pygments" ,python-pygments)
+ ("python-listparser" ,python-listparser)
+ ("python" ,python)
+ ("mpv" ,mpv)
+ ("webkitgtk" ,webkitgtk)
+ ("libhandy" ,libhandy)
+ ("glib" ,glib)
+ ("gtk+" ,gtk+)
+ ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
+ ("hicolor-icon-theme" ,hicolor-icon-theme)))
+ (home-page "https://gfeeds.gabmus.org/")
+ (synopsis "Easy-to-use GTK+ RSS/Atom feed reader")
+ (description "An RSS/Atom feed reader made with GTK+ with an
+easy-to-use graphical user interface.")
+ (license license:gpl3+)))
--
2.30.1
L
L
Léo Le Bouter wrote on 27 Feb 2021 23:42
[PATCH 1/3] gnu: Add python-readability.
(address . 46823@debbugs.gnu.org)
14e0b89e446e222d9b4cf40eeb5fbdbbdc0576e6.camel@zaclys.net
Hello!

If I do not wrap XDG_DATA_DIRS, then in a --pure environment gfeeds
cannot find gsettings-desktop-schemas and wont start.

I also figured I'd depend on mpv and specify it's full path in the
config by default (instead of just the PATH's relative "mpv") since it
is useful for basic functionality of the software (rss on feeds
providing video links). Depending on the user's profile, the user is
still free to change it. Does that sound OK to you?

Appreciate the review,

Thanks!
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFIvLi9gL+xax3g6RRaix6GvNEKYFAmA6yu0ACgkQRaix6GvN
EKZ3hxAAsWBbbSMb1wuLfLWOtSHbl3A48/cdp9uChmOcJH3Cooe29c8YUOh7PyOn
6t1DtSu7JfeEUDCxwHr24JiuSyl8JJp2gzd7+OLFVhOQMgtuJ3q6gpVMIPXeGVEp
sl8xqUp4sROmaa9Di7799QW4HX5dIFlr5w4yPY59j7tJhffPgIKdD10v75Iom5S9
e3rqRda3TCeyWz9/oabzJ1oiLU/TmXs4qJWqZQHg5OFddHX3V1J4Tp342ajj/+ti
TpYRYb6RnDz9jQ8Qw0OMVVeSSCggIeA31OK+1/YKCNeHJ048KusSMV/1AD/QVGFA
nz8TnChex9k6/p4MYjs4H1scRL+uRjf5PTSU0Nh12R2HxB0udxg4Jc2LyfxzmAKV
ZeDeJSSjymUvf7lJVluJpvr5TpC4s77kw19NzQ7pHBO/UoMsjvXWBYi2jEEuJI/7
Bhev8L6lzTmgEF1zMc3vwyze9s8l2G69mmVgXZQNJEXTLFI8vcy/4d71geH10+Js
8p2gIIigOLhcCYdERR+Y4T52d7ePuQ4iVo0Gqzkm8xWgcN3tFQqMhHUnmZMdWSAZ
JCDjCco/lnikLXdZAk2fadeTdK8JXjA0/yp57tpBdU26PmziWe0t0jx0utOTOqCJ
WQJgd6Auy5ym7th2Ke3EIFqdGhjjG7xCxCde41XQ6H9hwZ1RJ9E=
=PoIi
-----END PGP SIGNATURE-----


N
N
Nicolas Goaziou wrote on 5 Mar 2021 17:32
(name . Léo Le Bouter via Guix-patches via)(address . guix-patches@gnu.org)
87czwdef2t.fsf@nicolasgoaziou.fr
Hello,

Léo Le Bouter via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (3 lines)
> If I do not wrap XDG_DATA_DIRS, then in a --pure environment gfeeds
> cannot find gsettings-desktop-schemas and wont start.

It looks like a common deed across packages.

Toggle quote (6 lines)
> I also figured I'd depend on mpv and specify it's full path in the
> config by default (instead of just the PATH's relative "mpv") since it
> is useful for basic functionality of the software (rss on feeds
> providing video links). Depending on the user's profile, the user is
> still free to change it. Does that sound OK to you?

It is better than propagating it anyway. I think that's fine.

Note that (native-)inputs should be sorted alphabetically, and
descriptions ought to be full sentences.

Otherwise, LGTM.

Regards,
--
Nicolas Goaziou
L
L
Léo Le Bouter wrote on 6 Mar 2021 00:19
(address . 46823-done@debbugs.gnu.org)
37b77e5fee4340e717ef8a1105e2dd6d6ac2aa26.camel@zaclys.net
On Fri, 2021-03-05 at 17:32 +0100, Nicolas Goaziou wrote:

Thanks for the review!

Toggle quote (3 lines)
> Note that (native-)inputs should be sorted alphabetically, and
> descriptions ought to be full sentences.

I did the descriptions but did not sort all *inputs because it is quite
troublesome to do so editing commit history etc.. I don't like doing it
manually and don't have any tooling, also don't think it is very
worthwhile use of my time, nor do I think it adds much value to GNU
Guix. If you have any tooling to suggest to do it easily in Emacs then
I'll happily do that in every of my contributions by default.

I also moved gfeeds to gnu/packages/syndication.scm as that's where it
sits better I think, it not being an official GNOME project.

Pushed all in 373e5fc96724fd38bb1263e4af90932ea36f596b.

Léo
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFIvLi9gL+xax3g6RRaix6GvNEKYFAmBCvJIACgkQRaix6GvN
EKZE5hAAsvlb6rLbuDZj1NUAdHLKMnZLe3b0X9bX9lQ/pRkPloPFb7b9MHkornyT
oZacdWRdD0ewechXrnFIANdoZSIBw1bY/XP7+INiOgAJ2Opw47bZMwtnFzQKRO0I
3lfebGiaP+c2awxSjgllrPbJYY8ndw186z6Ac3qykGyf60/h1x3hZI90To4RJpBI
YVBkVxI2PsFOpB9SmIuZzSeUz4RO50hWCPfH6OUKwZ7LOVDhHyFReLjfyRCLCiqW
m3ELziYLXXIxSUnPqddqtisQPrhlR9s1n1fqdG+VaBnOh3/LET2DCcLzgO/M2bnN
mnZWY9v20gHVG6tdJDs8CArWosMUlmuoTjSWnwTKg516MlPxrwAJ0nSG50hHEDwJ
4LfCBQ/zVgZfL5NklnwAy3+jCd4KSm/sQOcD1YssMMBlKQNJ1D2RGyYqso1TE9tZ
+lh/+hOG7V911e5kHV8EmITcUx4bY9BEfzK7Ivh3flSvDI4mZf3tFXGIwzYhMD+0
nR6bB+3HBR7Bx0MF4hbh4miiJ5bPOgHXZXAby6vb81+iaplS/CU/izSwyjs4aQ9V
KA68oTfU0SJ6f4B6ugqEp623+MZjVTLQZ60ZhTOBUiK36Vp/aIvJyYaLcf6IDNBd
f+NkqIv3g+ab5aihbW4SNtS3hjQbnAmrKrbZLrUKC3CZ5LOlbkE=
=29ad
-----END PGP SIGNATURE-----


N
N
Nicolas Goaziou wrote on 6 Mar 2021 11:13
(name . Léo Le Bouter)(address . lle-bout@zaclys.net)
8735x8egin.fsf@nicolasgoaziou.fr
Hello,

Léo Le Bouter <lle-bout@zaclys.net> writes:

Toggle quote (11 lines)
> On Fri, 2021-03-05 at 17:32 +0100, Nicolas Goaziou wrote:

>> Note that (native-)inputs should be sorted alphabetically, and
>> descriptions ought to be full sentences.
>
> I did the descriptions but did not sort all *inputs because it is quite
> troublesome to do so editing commit history etc.. I don't like doing it
> manually and don't have any tooling, also don't think it is very
> worthwhile use of my time, nor do I think it adds much value to GNU
> Guix.

I obviously cannot tell what is worth of your time.

However, sorting inputs alphabetically has some value. For example, it
makes it easier to add more inputs later, as it becomes less tedious to
check for duplicates.

Toggle quote (3 lines)
> If you have any tooling to suggest to do it easily in Emacs then
> I'll happily do that in every of my contributions by default.

What about a basic M-x sort-lines ? Note that you need to be cautious
about the first and last inputs, as opening and closing parens should be
sent to another line there.

If you don't want to special-casing first and last inputs, there's the
more "advanced"

M-x sort-regexp-fields RET (".+?".*?) RET \& RET

while selecting the full input field (with C-M-SPC).

HTH,
--
Nicolas Goaziou
L
L
Léo Le Bouter wrote on 6 Mar 2021 18:44
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)(address . 46823-done@debbugs.gnu.org)
84123b4698fce44aa18e100a6020c58103c43594.camel@zaclys.net
On Sat, 2021-03-06 at 11:13 +0100, Nicolas Goaziou wrote:
Toggle quote (3 lines)
>
> I obviously cannot tell what is worth of your time.

What do you mean?

Toggle quote (6 lines)
> However, sorting inputs alphabetically has some value. For example,
> it
> makes it easier to add more inputs later, as it becomes less tedious
> to
> check for duplicates.

Agreed but seeing all that has to be done in GNU Guix.. we can
massively sort *-inputs another time can't we? Or if there's an
automated pre-commit hook or Emacs "guix-packageer-mode" someone can
make, I'll happily install it.

Toggle quote (5 lines)
> What about a basic M-x sort-lines ? Note that you need to be cautious
> about the first and last inputs, as opening and closing parens should
> be
> sent to another line there.

That's what I was using and yes first and last lines makes it quite
annoying.

Toggle quote (8 lines)
> If you don't want to special-casing first and last inputs, there's
> the
> more "advanced"
>
> M-x sort-regexp-fields RET (".+?".*?) RET \& RET
>
> while selecting the full input field (with C-M-SPC).

Thank you that's really great, will use!

Léo
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFIvLi9gL+xax3g6RRaix6GvNEKYFAmBDv4cACgkQRaix6GvN
EKZRUw/8DvWDp8j9+/ykxykBEV4IIKxRD5BfiMw181/XO+7yCfJl6fMwq1Ln+Ye4
drFzB5Kk2hFWny7zg0uxhv1L4Yjua3B6jK4Mwkm8u23sIi3/DhVg2quYg9bHIkzO
b8wWIoQAGRUB2NdvcWHGOlQlN1xjSSAR/JowRCnJRrXD2HEjHlkfhZMEhyXTo1Xx
T9E5/ldMyWGC7ooYZLz20ockr34UcPLDxrcI+QPHkITIH529BOwyjJYWwe8F746E
19klSpuTnmEOgFgBKdMDdBqJLxawk5HdeokthuOuVsaNxnYBGrg9BYyH7+QuI8MQ
GZgYOjb8rdzJ7D2Ny6GUKDqvGfQhpva/2hNYIb6gOVQ7A3XG4SAMTArml56je63T
huiPmSD3KiRNt4ocqkOyT2UlOD0k2n2Wvjby2ZzZmDRO+QQxVIlZzmLYaXawXV/F
s9rOUospYLGxnCn1DOFAiY7dfGhquaZ9c3jQXmZI79vAGpwVZTYmt/4vW0MFNm8o
LXM/xoWGAzg3X1MLQvFSrl7IXspTHKuMWbMi5o5WI9N4IaR8G3IFhT8MzLAtnS7t
TCdCU+8R+UpTtFOqfCPuWX9K3vIzf6H2rQ566fH4NiLRT4u8aaAi4ZQMIZOdZ49K
CobbsSsPrF/mVuKxyebVz8lbAktCnNZkWA037B/eduy94eXQNZg=
=e0nw
-----END PGP SIGNATURE-----


Closed
Z
Z
zimoun wrote on 8 Mar 2021 10:16
(address . 46823-done@debbugs.gnu.org)
865z2280pm.fsf@gmail.com
Hi,

On Sat, 06 Mar 2021 at 18:44, Léo Le Bouter via Guix-patches via <guix-patches@gnu.org> wrote:
Toggle quote (13 lines)
> On Sat, 2021-03-06 at 11:13 +0100, Nicolas Goaziou wrote:

>> However, sorting inputs alphabetically has some value. For example,
>> it
>> makes it easier to add more inputs later, as it becomes less tedious
>> to
>> check for duplicates.
>
> Agreed but seeing all that has to be done in GNU Guix.. we can
> massively sort *-inputs another time can't we? Or if there's an
> automated pre-commit hook or Emacs "guix-packageer-mode" someone can
> make, I'll happily install it.

I am not convinced tooling for sorting inputs is worth here. I mean
sorting the inputs (if there are not) or keeping sorted the inputs list
is so quick and easy compared to other parts of the packaging that
sorting is more a discipline than a concrete issue, similarly as two
spaces for the description’s sentences. IMHO.

However, “guix lint” could warn when the inputs are not sorted.

And it remembers me this bug report:



Cheers,
simon
Closed
?