gnu: Add giara.

* gnu/packages/syndication.scm (giara): New variable.
* gnu/packages/patches/giara-fix-login.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
This commit is contained in:
Raghav Gururajan 2021-03-10 07:54:40 -05:00
parent 7e863ecd3c
commit 8f9fdd31bd
Signed by: raghavgururajan
GPG Key ID: 5F5816647F8BE551
3 changed files with 91 additions and 0 deletions

View File

@ -1088,6 +1088,7 @@ dist_patch_DATA = \
%D%/packages/patches/ghostscript-no-header-id.patch \
%D%/packages/patches/ghostscript-no-header-uuid.patch \
%D%/packages/patches/ghostscript-no-header-creationdate.patch \
%D%/packages/patches/giara-fix-login.patch \
%D%/packages/patches/glib-appinfo-watch.patch \
%D%/packages/patches/glib-tests-timer.patch \
%D%/packages/patches/glib-CVE-2021-27218.patch \

View File

@ -0,0 +1,27 @@
From f4adc1f52d777cea3331b4acae0c3bdec4d0eb70 Mon Sep 17 00:00:00 2001
From: Paper <paper@tilde.institute>
Date: Fri, 12 Mar 2021 21:10:34 +0000
Subject: [PATCH] fix login by removing everything after # from URL
---
giara/__main__.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/giara/__main__.py b/giara/__main__.py
index 10b9ae2..d235332 100644
--- a/giara/__main__.py
+++ b/giara/__main__.py
@@ -53,8 +53,9 @@ class GApplication(Gtk.Application):
def open(self, app, files, *args):
target = files[0].get_uri()
print(target)
+ code = target.split('=')[-1].split('#')[0]
get_authorized_client(
- reddit=self._unauth_reddit, code=target.split('=')[-1]
+ reddit=self._unauth_reddit, code=code
)
self.continue_activate(self._unauth_reddit)
--
GitLab

View File

@ -23,6 +23,7 @@
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (guix build-system cargo)
#:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system gnu)
@ -36,6 +37,7 @@
#:use-module (gnu packages crates-io)
#:use-module (gnu packages curl)
#:use-module (gnu packages documentation)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages gettext)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
@ -59,6 +61,67 @@
#:use-module (gnu packages xml)
#:use-module (srfi srfi-1))
(define-public giara
(package
(name "giara")
(version "0.3")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.gnome.org/World/giara")
(commit version)))
(file-name (git-file-name name version))
;; To fix authentication while adding accounts.
(patches (search-patches "giara-fix-login.patch"))
(sha256
(base32 "004qmkfrgd37axv0b6hfh6v7nx4pvy987k5yv4bmlmkj9sbqm6f9"))))
(build-system meson-build-system)
(arguments
`(#:glib-or-gtk? #t
#:phases
(modify-phases %standard-phases
(add-after 'glib-or-gtk-wrap 'wrap-paths
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin/"))
(lib (string-append out "/lib/python"
,(version-major+minor
(package-version python))
"/site-packages")))
(wrap-program (string-append bin "giara")
`("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH") ,lib))
`("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH")))))
#t)))))
(native-inputs
`(("gettext" ,gettext-minimal)
("glib:bin" ,glib "bin")
("gobject-introspection" ,gobject-introspection)
("gtk+:bin" ,gtk+ "bin")
("pkg-config" ,pkg-config)
("xmllint" ,libxml2)))
(inputs
`(("glib" ,glib)
("gtk+" ,gtk+)
("gtksourceview" ,gtksourceview)
("libhandy" ,libhandy)
("python" ,python)
("python-beautifulsoup" ,python-beautifulsoup4)
("python-dateutil" ,python-dateutil)
("python-mistune" ,python-mistune)
("python-pillow" ,python-pillow)
("python-praw" ,python-praw)
("python-pycairo" ,python-pycairo)
("python-pygobject" ,python-pygobject)
("python-requests" ,python-requests)
("webkitgtk" ,webkitgtk)))
(propagated-inputs
`(("dconf" ,dconf)))
(synopsis "Client for Reddit")
(description "Giara is a reddit app, built with Python, GTK and Handy.")
(home-page "https://giara.gabmus.org/")
(license license:gpl3+)))
(define-public newsboat
(package
(name "newsboat")