Subject: [bug#76274] [PATCH] gnu: Add chatterino

From: Vitor Hugo <[email-masked]>
Date: Sun, 13 Apr 2025 20:31:33 +0000

Below follows a reworked version of the package/patch.
I reached out on IRC and had some feedback on it.
I'd very much appreciate a response on if the patch has something wonky.
>From my testing both linter and style checks passed with no complaints.

* gnu/packages/messaging.scm (chatterino): New variable.

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 26db072b4a..60cfa22d8c 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -220,6 +220,56 @@ (define-public biboumi
 users take part in IRC discussions, using their favourite XMPP client.")
    (license license:zlib)))
 
+(define-public chatterino
+  (package
+    (name "chatterino")
+    (version "2.5.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Chatterino/chatterino2")
+             (commit (string-append "v" version))
+             (recursive? #t)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1fs13vdxbq2dbxr21wp9mvn33bhvnmg17rqdd6yawsgslab2lssv"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:configure-flags
+      #~(list "-DCMAKE_BUILD_TYPE=Release" "-DCHATTERINO_UPDATER=OFF")
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'check)
+          (add-before 'configure 'setvars
+            (lambda _
+              (setenv "GIT_HASH" "3f3a31db")))
+          (add-after 'install 'wrap-executable
+            (lambda* _
+              (let ((plugin-path (getenv "QT_PLUGIN_PATH")))
+                (wrap-program (string-append #$output "/bin/chatterino")
+                  `("QT_PLUGIN_PATH" ":" prefix
+                    (,plugin-path)))))))))
+    (native-inputs (list pkg-config))
+    (inputs (list qtbase
+                  qtsvg
+                  qttools
+                  qt5compat
+                  boost
+                  bash-minimal
+                  openssl
+                  libsecret
+                  libnotify
+                  qtwayland
+                  qtimageformats))
+    (synopsis "Chat client for Twitch")
+    (description
+     "Chatterino is a chat client for Twitch chat.
+It aims to be an improved/extended version of the Twitch web chat.")
+    (home-page "https://chatterino.com")
+    (license expat)))
+
 (define-public omemo-wget
   (package
     (name "omemo-wget")