summary refs log tree commit diff
diff options
context:
space:
mode:
authorRaghav Gururajan <rg@raghavgururajan.name>2021-03-10 07:54:40 -0500
committerRaghav Gururajan <rg@raghavgururajan.name>2021-05-11 18:07:09 -0400
commit8f9fdd31bd87ec43787723f04417b65bc558e095 (patch)
tree231992ac92ec0f1173895521a2dcc5141db79224
parent7e863ecd3cd3c3ce684a56b6a81d84d801474aaf (diff)
downloadguix-8f9fdd31bd87ec43787723f04417b65bc558e095.tar.gz
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.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/giara-fix-login.patch27
-rw-r--r--gnu/packages/syndication.scm63
3 files changed, 91 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index c4bd88714c..01d495d41d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -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		\
diff --git a/gnu/packages/patches/giara-fix-login.patch b/gnu/packages/patches/giara-fix-login.patch
new file mode 100644
index 0000000000..f15caaf559
--- /dev/null
+++ b/gnu/packages/patches/giara-fix-login.patch
@@ -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
+
diff --git a/gnu/packages/syndication.scm b/gnu/packages/syndication.scm
index 5f0aa1bd8b..3d0b9c39c8 100644
--- a/gnu/packages/syndication.scm
+++ b/gnu/packages/syndication.scm
@@ -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")