From 0652d8ab484a4d24057e3dc35514dbd7d413a44e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <raghavgururajan@disroot.org>
Date: Tue, 22 Sep 2020 18:40:18 -0400
Subject: [PATCH 5/7] gnu: Add gajim-next.

* gnu/packages/gajim.scm (gajim-next): New variable.
---
 gnu/packages/gajim.scm | 105 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 104 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gajim.scm b/gnu/packages/gajim.scm
index dfccbaf19d..d6d52594ed 100644
--- a/gnu/packages/gajim.scm
+++ b/gnu/packages/gajim.scm
@@ -19,10 +19,19 @@
 
 (define-module (gnu packages gajim)
   #:use-module (gnu packages)
+  #:use-module (gnu packages avahi)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gstreamer)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-crypto)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages xorg)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system python)
   #:use-module (guix download)
   #:use-module ((guix licenses) #:prefix license:)
@@ -58,4 +67,98 @@ of xmpppy.")
     (home-page "https://dev.gajim.org/gajim/python-nbxmpp")
     (license license:gpl3+)))
 
-;;; End of gajim.scm
\ No newline at end of file
+(define-public gajim-next
+  (package
+    (name "gajim-next")
+    (version "1.2.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "https://gajim.org/downloads/"
+                       (version-major+minor version)
+                       "/gajim-" version ".tar.gz"))
+       (sha256
+        (base32 "1gfcp3b5nq43xxz5my8vfhfxnnli726j3hzcgwh9fzrzzd9ic3gx"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:imported-modules
+       (,@%python-build-system-modules
+        (guix build glib-or-gtk-build-system))
+       #:modules
+       ((guix build python-build-system)
+        ((guix build glib-or-gtk-build-system)
+         #:prefix glib-or-gtk:)
+        (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             ;; Tests require a running X server.
+             (system "Xvfb :1 +extension GLX &")
+             (setenv "DISPLAY" ":1")
+             ;; For missing '/etc/machine-id'.
+             (setenv "DBUS_FATAL_WARNINGS" "0")
+             (invoke "dbus-launch" "python" "./setup.py" "test")
+             #t))
+         (add-after 'install 'glib-or-gtk-compile-schemas
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+         (add-after 'install 'glib-or-gtk-wrap
+           (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
+         (add-after 'install 'wrap-env
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (for-each
+                (lambda (name)
+                  (let ((file (string-append out "/bin/" name))
+                        (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))
+                        (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
+                    (wrap-program file
+                      `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))
+                      `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))
+                '("gajim" "gajim-remote" "gajim-history-manager")))
+             #t)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("python-distutils-extra" ,python-distutils-extra)
+       ("python-setuptools" ,python-setuptools)
+       ("xorg-server" ,xorg-server-for-tests)))
+    (inputs
+     `(("avahi" ,avahi)
+       ("dbus" ,dbus)
+       ("farstream" ,farstream)
+       ("geoclue" ,geoclue)
+       ("glib" ,glib)
+       ("glib-networking" ,glib-networking)
+       ("gnome-keyring" ,gnome-keyring)
+       ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
+       ("gsound",gsound)
+       ("gspell" ,gspell)
+       ("gstreamer" ,gstreamer)
+       ("gst-plugins-base" ,gst-plugins-base)
+       ("gtk+" ,gtk+)
+       ("gupnp-igd" ,gupnp-igd)
+       ("libsoup" ,libsoup)
+       ("libxss" ,libxscrnsaver)
+       ("network-manager" ,network-manager)
+       ("python-css-parser" ,python-css-parser)
+       ("python-keyring" ,python-keyring)
+       ("python-nbxmpp" ,python-nbxmpp-next)
+       ("python-packaging" ,python-packaging)
+       ("python-pillow" ,python-pillow)
+       ("python-precis-i18n" ,python-precis-i18n)
+       ("python-pycairo" ,python-pycairo)
+       ("python-pygobject" ,python-pygobject)
+       ("python-pyopenssl" ,python-pyopenssl)))
+    (propagated-inputs
+     `(("dconf" ,dconf)))
+    (synopsis "A fully-featured XMPP client")
+    (description "Gajim aims to be an easy to use and fully-featured XMPP chat
+client.")
+    (home-page "https://gajim.org/")
+    (license license:gpl3+)))
+
+;;; End of gajim.scm
-- 
2.28.0

