diff mbox series

[bug#46012] Upgrade Nheko

Message ID 875z3ryvk0.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me
State Accepted
Headers show
Series [bug#46012] Upgrade Nheko | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Nicolò Balzarotti Jan. 21, 2021, 12:37 a.m. UTC
Hi guix! Today nheko 0.8.0 was released.

This patch series upgrades it and its dependency, mtxclient.
I alsotook some time to unbundle all its dependencies (adding
cpp-httplib, blurhash, and single-applicaiton-qt5).

About this last dependency (single-applicaiton-qt5), I'm unsure on how
to name it.  Also, devs are suggested to include its source directly,
and by default builds a static library.  The main SingleApplication
class inherit from a Qt*Application class which is choosen at build
time, so the library to be useful in the target program must be built
with the correct flag (I'm using the one used by nheko by default).

Nheko builds and run fine.  It should support voice call now, but I
cannot test it (I get `[error] WebRTC: failed to start device monitor',
not sure if the problem is in my setup, in gstreamer or in my package).
diff mbox series

Patch

From 5308eda5d0210beb1edfb0cdf44530a13673af41 Mon Sep 17 00:00:00 2001
From: nixo <nicolo@nixo.xyz>
Date: Wed, 20 Jan 2021 18:00:51 +0100
Subject: [PATCH 5/5] gnu: nheko: Update to 0.8.0.

* gnu/packages/messaging.scm (nheko): Update to 0.8.0.
---
 gnu/packages/messaging.scm | 50 +++++++++++++++++++++++++++++---------
 1 file changed, 39 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 0368780fa6..c5e0c828b0 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -2277,7 +2277,7 @@  for the Matrix protocol.  It is built on to of @code{Boost.Asio}.")
 (define-public nheko
   (package
     (name "nheko")
-    (version "0.7.2")
+    (version "0.8.0")
     (source
      (origin
        (method git-fetch)
@@ -2286,19 +2286,40 @@  for the Matrix protocol.  It is built on to of @code{Boost.Asio}.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1cbhgaf9klgxdirrxj571fqwspm0byl75c1xc40l727a6qswvp7s"))))
+        (base32 "00d6wx3lcgbks74jkdyifqxf8nlravqh88fyljd0sy7kzbah9msf"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           (delete-file-recursively "third_party")
+           #t))))
     (arguments
      `(#:tests? #f                      ;no test target
        #:configure-flags
-       (list
-        "-DCMAKE_BUILD_TYPE=Release"
-        "-DCMAKE_CXX_FLAGS=-fpermissive")
+       '("-DCMAKE_BUILD_TYPE=Release"
+         "-DBUILD_DOCS=ON"
+         ;; Fix required because we are using a static SingleApplication
+         "-DCMAKE_CXX_FLAGS= \"-DQAPPLICATION_CLASS=QApplication\" "
+         ;; Compile Qml will make Nheko faster, but you will need to recompile
+         ;; it, when you update Qt.  That's fine for us.
+         "-DCOMPILE_QML=ON")
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'remove-Werror
-           (lambda _
-             (substitute* "CMakeLists.txt"
-               (("-Werror") ""))
+         (add-after 'unpack 'unbundle-dependencies
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((single-app (assoc-ref inputs "single-application")))
+               (substitute* "CMakeLists.txt"
+                 ;; Remove include and source dirs,replace with the correct one
+                 (("third_party/blurhash/blurhash.cpp") "")
+                 (("third_party/cpp-httplib-0.5.12")
+                  (string-append "\"" single-app "/include\""))
+                 (("add_subdirectory.*third_party/SingleApplication.*") "")
+                 ;; Link using the correct static/shared libs
+                 (("SingleApplication::SingleApplication")
+                  (string-append
+                   ;; Dynamic libraries
+                   "httplib" "\n" "blurhash" "\n"
+                   ;; Static library
+                   single-app "/lib/libSingleApplication.a"))))
              #t))
          (add-after 'unpack 'fix-determinism
            (lambda _
@@ -2308,7 +2329,10 @@  for the Matrix protocol.  It is built on to of @code{Boost.Asio}.")
     (build-system qt-build-system)
     (inputs
      `(("boost" ,boost)
+       ("blurhash" ,blurhash)
+       ("cpp-httplib" ,cpp-httplib)
        ("cmark" ,cmark)
+       ("gst-plugins-bad" ,gst-plugins-bad) ; sdp & webrtc for calls
        ("json-modern-cxx" ,json-modern-cxx)
        ("libolm" ,libolm)
        ("lmdb" ,lmdb)
@@ -2317,6 +2341,7 @@  for the Matrix protocol.  It is built on to of @code{Boost.Asio}.")
        ("openssl" ,openssl)
        ("qtbase" ,qtbase)
        ("qtdeclarative" ,qtdeclarative)
+       ("qtkeychain" ,qtkeychain)
        ("qtgraphicaleffects" ,qtgraphicaleffects)
        ("qtmultimedia" ,qtmultimedia)
        ("qtquickcontrols2" ,qtquickcontrols2)
@@ -2325,8 +2350,11 @@  for the Matrix protocol.  It is built on to of @code{Boost.Asio}.")
        ("tweeny" ,tweeny)
        ("zlib" ,zlib)))
     (native-inputs
-     `(("pkg-config" ,pkg-config)
-       ("qtlinguist" ,qttools)))
+     `(("doxygen" ,doxygen)
+       ("graphviz" ,graphviz)
+       ("pkg-config" ,pkg-config)
+       ("qtlinguist" ,qttools)
+       ("single-application" ,single-application-qt5)))
     (home-page "https://github.com/Nheko-Reborn/nheko")
     (synopsis "Desktop client for Matrix using Qt and C++14")
     (description "@code{Nheko} want to provide a native desktop app for the
-- 
2.29.2