diff mbox series

[bug#70317,v2,13/13] gnu: packages: Add soju

Message ID 20240426080315.25131-14-jesse@eisses.email
State New
Headers show
Series Add Soju | expand

Commit Message

Jesse Eisses April 26, 2024, 8:02 a.m. UTC
---
 gnu/packages/irc.scm | 77 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm
index 80b2e740ee..90dad61eb9 100644
--- a/gnu/packages/irc.scm
+++ b/gnu/packages/irc.scm
@@ -1032,3 +1032,80 @@  (define-public snuik
 now).  It has some basic functionality only, such as seen, tell, and
 what.")
     (license license:gpl3+)))
+
+(define-public soju
+  (package
+    (name "soju")
+    (version "0.7.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.sr.ht/~emersion/soju")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1a0mp8f5i1ajh67y6fasmzgca3w1ccaiz19sx87rflbyi1mrhdlz"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:import-path "git.sr.ht/~emersion/soju"
+      #:go go-1.19
+      #:install-source? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'build
+            (lambda* (#:key outputs #:allow-other-keys)
+              (with-directory-excursion "src/git.sr.ht/~emersion/soju"
+                (setenv "SYSCONFDIR"
+                        (string-append (assoc-ref outputs "out")
+                                       "/etc"))
+                (invoke "make"))))
+          (replace 'install
+            (lambda* (#:key outputs #:allow-other-keys)
+              (with-directory-excursion "src/git.sr.ht/~emersion/soju"
+                (let ((bin-dir (string-append (assoc-ref outputs "out")
+                                              "/bin"))
+                      (conf-dir (string-append (assoc-ref outputs
+                                                          "out")
+                                               "/etc/soju")))
+                  (install-file "soju" bin-dir)
+                  (install-file "sojudb" bin-dir)
+                  (install-file "sojuctl" bin-dir)
+                  ;; the default config file is not useful so we empty it for now
+                  (substitute* "config.in" ((".*") ""))
+                  (mkdir-p conf-dir)
+                  (copy-file "config.in"
+                             (string-append conf-dir "/config"))))))
+          (add-before 'build 'set-flags
+            (lambda _
+              (begin
+                (setenv "CGO_LDFLAGS"
+                        "-Wl,--unresolved-symbols=ignore-in-object-files") #t))))))
+    (native-inputs (list scdoc))
+    (inputs (list go-google-golang-org-protobuf go-1.19))
+    (propagated-inputs
+     (list go-nhooyr-io-websocket
+           go-gopkg-in-irc
+           go-golang-org-x-time
+           go-golang-org-x-crypto
+           go-github-com-prometheus-client-golang
+           go-github-com-pires-go-proxyproto
+           go-github-com-msteinert-pam
+           go-github-com-mattn-go-sqlite3
+           go-github-com-lib-pq
+           go-github-com-emersion-go-sasl
+           go-github-com-sherclockholmes-webpush-go
+           go-git-sr-ht-sircmpwn-go-bare
+           go-git-sr-ht-emersion-go-sqlite3-fts5
+           go-git-sr-ht-emersion-go-scfg))
+    (home-page "https://git.sr.ht/~emersion/soju")
+    (synopsis "User-friendly IRC bouncer") ;
+    (description
+     "Connects to upstream IRC servers on behalf of the user to provide
+extra functionality. soju supports many features
+such as multiple users, numerous @@url{https://ircv3.net/,IRCv3} extensions,
+chat history playback and detached channels.  It is well-suited for both small
+and large deployments.")
+    (license license:agpl3)))
+