Subject: Update nheko and (some of) its dependencies

From: raingloom <[email-masked]>
Date: Sun, 26 Dec 2021 11:28:49 +0100

This is very belated.

As far as I know all dependency updates are necessary, especially the
qtkeychain one, due to a bug:
https://github.com/Nheko-Reborn/nheko/issues/715#issuecomment-914463594
>From bc12726a5b697d52bea400b843394425938b306f Mon Sep 17 00:00:00 2001
From: raingloom <[email-masked]>
Date: Sun, 26 Dec 2021 08:16:24 +0100
Subject: [PATCH 1/6] gnu: spdlog: Build shared library.

* gnu/packages/logging.scm (spdlog)[arguments]: Enable SPDLOG_BUILD_SHARED flag.
---
 gnu/packages/logging.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/logging.scm b/gnu/packages/logging.scm
index 7e07f4dd67..13dd74dadb 100644
--- a/gnu/packages/logging.scm
+++ b/gnu/packages/logging.scm
@@ -193,6 +193,7 @@ (define-public spdlog
     (arguments
      '(#:configure-flags
        (list "-DSPDLOG_BUILD_BENCH=OFF"
+             "-DSPDLOG_BUILD_SHARED=ON"
              "-DSPDLOG_BUILD_TESTS=ON")))
     (home-page "https://github.com/gabime/spdlog")
     (synopsis "Fast C++ logging library")
-- 
2.34.0

>From ae1b5d3038d815f8b252a2324648d8857a4b7067 Mon Sep 17 00:00:00 2001
From: raingloom <[email-masked]>
Date: Sun, 26 Dec 2021 08:39:07 +0100
Subject: [PATCH 2/6] gnu: Add coeurl.

* gnu/packages/curl.scm (coeurl): New variable.
---
 gnu/packages/curl.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm
index 9a9d788ceb..38f27e7c72 100644
--- a/gnu/packages/curl.scm
+++ b/gnu/packages/curl.scm
@@ -40,11 +40,15 @@ (define-module (gnu packages curl)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
+  #:use-module (guix build-system meson)
   #:use-module (gnu packages)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages golang)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages kerberos)
+  #:use-module (gnu packages logging)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libidn)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -333,3 +337,29 @@ (define-public h2c
      "Provided a set of HTTP request headers, h2c outputs how to invoke
 curl to obtain exactly that HTTP request.")
     (license license:expat)))
+
+(define-public coeurl
+  (package
+    (name "coeurl")
+    (version "0.1.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://nheko.im/nheko-reborn/coeurl")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32
+         "0sqciagagyc0qv90g0qw8fkyvy4l8h7nbaz04chiz9gnv89hg28p"))))
+    (build-system meson-build-system)
+    (inputs
+     `(("curl" ,curl)
+       ("doctest" ,doctest) ;; for tests
+       ("spdlog" ,spdlog)
+       ("libevent" ,libevent)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (home-page "https://nheko.im/nheko-reborn/coeurl")
+    (synopsis "Simple async wrapper around CURL for C++")
+    (description "Simple library to do http requests asynchronously via CURL in C++.")
+    (license license:expat)))
-- 
2.34.0

>From 49b29cf2d1c8dc1389495f31788f36c4b97e27f6 Mon Sep 17 00:00:00 2001
From: raingloom <[email-masked]>
Date: Fri, 10 Dec 2021 02:39:56 +0100
Subject: [PATCH 3/6] gnu: mtxclient: Update to 0.6.1.

* gnu/packages/messaging.scm (mtxclient): Update to 0.6.1.
[inputs]: Add curl, coeurl and libevent.
---
 gnu/packages/messaging.scm | 63 ++++++++++++++++++++------------------
 1 file changed, 34 insertions(+), 29 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 68d95bd5fa..81bc9533b5 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -88,6 +88,7 @@ (define-module (gnu packages messaging)
   #:use-module (gnu packages kerberos)
   #:use-module (gnu packages less)
   #:use-module (gnu packages libcanberra)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages libidn)
   #:use-module (gnu packages libreoffice)
@@ -549,31 +550,31 @@ (define-public libotr
 
 (define-public libsignal-protocol-c
   (package
-  (name "libsignal-protocol-c")
-  (version "2.3.3")
-  (source (origin
-           (method git-fetch)
-           (uri (git-reference
-                  (url "https://github.com/WhisperSystems/libsignal-protocol-c")
-                  (commit (string-append "v" version))))
-           (file-name (git-file-name name version))
-           (sha256
-            (base32
-             "0z5p03vk15i6h870azfjgyfgxhv31q2vq6rfhnybrnkxq2wqzwhk"))))
-  (arguments
-   `(;; Required for proper linking and for tests to run.
-     #:configure-flags '("-DBUILD_SHARED_LIBS=on" "-DBUILD_TESTING=1")))
-  (build-system cmake-build-system)
-  (inputs (list ;; Required for tests:
-                check openssl))
-  (native-inputs (list pkg-config))
-  (home-page "https://github.com/WhisperSystems/libsignal-protocol-c")
-  (synopsis "Implementation of a ratcheting forward secrecy protocol")
-  (description "libsignal-protocol-c is an implementation of a ratcheting
+   (name "libsignal-protocol-c")
+   (version "2.3.3")
+   (source (origin
+            (method git-fetch)
+            (uri (git-reference
+                   (url "https://github.com/WhisperSystems/libsignal-protocol-c")
+                   (commit (string-append "v" version))))
+            (file-name (git-file-name name version))
+            (sha256
+             (base32
+              "0z5p03vk15i6h870azfjgyfgxhv31q2vq6rfhnybrnkxq2wqzwhk"))))
+   (arguments
+    `(;; Required for proper linking and for tests to run.
+      #:configure-flags '("-DBUILD_SHARED_LIBS=on" "-DBUILD_TESTING=1")))
+   (build-system cmake-build-system)
+   (inputs (list ;; Required for tests:
+                 check openssl))
+   (native-inputs (list pkg-config))
+   (home-page "https://github.com/WhisperSystems/libsignal-protocol-c")
+   (synopsis "Implementation of a ratcheting forward secrecy protocol")
+   (description "libsignal-protocol-c is an implementation of a ratcheting
 forward secrecy protocol that works in synchronous and asynchronous
 messaging environments.  It can be used with messaging software to provide
 end-to-end encryption.")
-  (license license:gpl3+)))
+   (license license:gpl3+)))
 
 (define-public axc
   (package
@@ -1663,9 +1664,9 @@ (define-public utox
             (wrap-program (string-append (assoc-ref outputs "out")
                                          "/bin/utox")
             ;; For GtkFileChooserDialog.
-            `("GSETTINGS_SCHEMA_DIR" =
-              (,(string-append (assoc-ref inputs "gtk+")
-                               "/share/glib-2.0/schemas")))))))))
+             `("GSETTINGS_SCHEMA_DIR" =
+               (,(string-append (assoc-ref inputs "gtk+")
+                                "/share/glib-2.0/schemas")))))))))
    (inputs
     `(("dbus" ,dbus)
       ("filteraudio" ,filteraudio)
@@ -2286,7 +2287,7 @@ (define-public libqmatrixclient
 (define-public mtxclient
   (package
     (name "mtxclient")
-    (version "0.5.1")
+    (version "0.6.1")
     (source
      (origin
        (method git-fetch)
@@ -2295,9 +2296,10 @@ (define-public mtxclient
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1xznfx2bhw0ahwmkxm0rs05vz05ijk5k4190rj6qp3bvb9byiajh"))))
+        (base32 "1a3ki45rf1fm7y4b74li76aqd4qc4y5ga5r163s0cwcpj9mp8c45"))))
     (arguments
-     `(#:configure-flags
+     `(;#:parallel-build? #f ;; there seems to be a bug lurking somewhere that goes away with --cores=1
+       #:configure-flags
        (list
         ;; Disable example binaries (not installed)
         "-DBUILD_LIB_EXAMPLES=OFF")
@@ -2306,13 +2308,16 @@ (define-public mtxclient
          (add-before 'configure 'disable-network-tests
            (lambda _
              (substitute* "CMakeLists.txt"
-               (("add_test\\((BasicConnectivity|ClientAPI|MediaAPI|Encryption|Pushrules)")
+               (("add_test\\((BasicConnectivity|ClientAPI|Devices|MediaAPI|Encryption|Pushrules)")
                 "# add_test"))
              #t)))))
     (build-system cmake-build-system)
     (inputs
      (list boost
+           coeurl
+           curl
            json-modern-cxx
+           libevent
            libolm
            libsodium
            openssl
-- 
2.34.0

>From 7f172a931e077f6a471be25aa1c3446afac8e562 Mon Sep 17 00:00:00 2001
From: raingloom <[email-masked]>
Date: Sun, 26 Dec 2021 08:20:06 +0100
Subject: [PATCH 4/6] gnu: Update qtkeychain to 0.13.2.

* gnu/packages/qt.scm (qtkeychain): Update 0.13.2.
---
 gnu/packages/qt.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 01bf961bbf..4c971aa51d 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -70,6 +70,7 @@ (define-module (gnu packages qt)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gperf)
   #:use-module (gnu packages graphics)
@@ -2402,7 +2403,7 @@ (define-public python-pyqt+qscintilla
 (define-public qtkeychain
   (package
     (name "qtkeychain")
-    (version "0.9.1")
+    (version "0.13.2")
     (source
       (origin
         (method git-fetch)
@@ -2412,12 +2413,12 @@ (define-public qtkeychain
         (file-name (git-file-name name version))
         (sha256
          (base32
-          "0h4wgngn2yl35hapbjs24amkjfbzsvnna4ixfhn87snjnq5lmjbc"))))
+          "1zk6r2vc1q48qs7mw2h47bpgrfbb9r7lf9cwq4sb1a4nls87zznk"))))
     (build-system cmake-build-system)
     (native-inputs
      (list pkg-config qttools))
     (inputs
-     (list qtbase-5))
+     (list libsecret qtbase-5))
     (arguments
      `(#:tests? #f ; No tests included
        #:phases
-- 
2.34.0

>From d03f147a0d6a8952049a72f2ed1628f30754944d Mon Sep 17 00:00:00 2001
From: raingloom <[email-masked]>
Date: Fri, 10 Dec 2021 02:40:25 +0100
Subject: [PATCH 5/6] gnu: nheko: Update to 0.9.0.

* gnu/packages/messaging.scm (nheko): Update to 0.9.0.
[inputs]: Add coeurl, curl, libevent and xcb-util-wm.
---
 gnu/packages/messaging.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 81bc9533b5..9e0f797996 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -2334,7 +2334,7 @@ (define-public mtxclient
 (define-public nheko
   (package
     (name "nheko")
-    (version "0.8.2")
+    (version "0.9.0")
     (source
      (origin
        (method git-fetch)
@@ -2343,7 +2343,7 @@ (define-public nheko
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0362hkbprc6jqlgmvzwxyvify4b1ldjakyqdz55m25xsypbpv2f3"))
+        (base32 "1akhnngxkxbjwjkg5ispl6j5s2ylbcj92r3zxqqry4gbfxbjpx8k"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -2392,10 +2392,13 @@ (define-public nheko
        ("blurhash" ,blurhash)
        ("cpp-httplib" ,cpp-httplib)
        ("cmark" ,cmark)
+       ("coeurl" ,coeurl)
+       ("curl" ,curl)
        ("gst-plugins-base" ,gst-plugins-base)
        ("gst-plugins-bad" ,gst-plugins-bad)   ; sdp & webrtc for voip
        ("gst-plugins-good" ,gst-plugins-good) ; rtpmanager for voip
        ("json-modern-cxx" ,json-modern-cxx)
+       ("libevent" ,libevent)
        ("libnice" ,libnice)                   ; for voip
        ("libolm" ,libolm)
        ("lmdb" ,lmdb)
@@ -2411,6 +2414,7 @@ (define-public nheko
        ("qtsvg" ,qtsvg)
        ("spdlog" ,spdlog)
        ("single-application" ,single-application-qt5)
+       ("xcb-util-wm" ,xcb-util-wm)
        ("zlib" ,zlib)))
     (native-inputs
      `(("doxygen" ,doxygen)
-- 
2.34.0