diff mbox series

[bug#48810] gnu: Add matterbridge.

Message ID 20210603132231.10168-1-GNUtoo@cyberdimension.org
State Accepted
Headers show
Series [bug#48810] gnu: Add matterbridge. | expand

Commit Message

Denis 'GNUtoo' Carikli June 3, 2021, 1:22 p.m. UTC
* gnu/packages/messaging.scm (matterbridge): New variable.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 gnu/packages/messaging.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Comments

Mathieu Othacehe June 4, 2021, 12:07 p.m. UTC | #1
Hello,

The linter reports two problems:

--8<---------------cut here---------------start------------->8---
gnu/packages/messaging.scm:2977:5: matterbridge@1.22.2: the source file name should contain the package name
gnu/packages/messaging.scm:2977:5: matterbridge@1.22.2: the source URI should not be an autogenerated tarball
--8<---------------cut here---------------end--------------->8---

which means that you should use:

> +      (method url-fetch)

git-fetch here,

> +      (sha256
> +       (base32
> +        "1p3mkfzv4xwm7vz8ja7qsa99qwxb9s61hnjjv65dkkjivlsif5hk"))))

and introduce something like:

--8<---------------cut here---------------start------------->8---
       (file-name (git-file-name name version))
--8<---------------cut here---------------end--------------->8---

here. Could you please send an updated patch?

Thanks,

Mathieu
Denis 'GNUtoo' Carikli June 4, 2021, 4:16 p.m. UTC | #2
On Fri, 04 Jun 2021 14:07:50 +0200
Mathieu Othacehe <othacehe@gnu.org> wrote:

> Hello,
Hi,

> The linter reports two problems:
> 
> --8<---------------cut here---------------start------------->8---
> gnu/packages/messaging.scm:2977:5: matterbridge@1.22.2: the source
> file name should contain the package name
> gnu/packages/messaging.scm:2977:5: matterbridge@1.22.2: the source
> URI should not be an autogenerated tarball --8<---------------cut
> here---------------end--------------->8---
>
> which means that you should use:
> 
> > +      (method url-fetch)
> 
> git-fetch here,
> 
> > +      (sha256
> > +       (base32
> > +        "1p3mkfzv4xwm7vz8ja7qsa99qwxb9s61hnjjv65dkkjivlsif5hk"))))
> 
> and introduce something like:
> 
> --8<---------------cut here---------------start------------->8---
>        (file-name (git-file-name name version))
> --8<---------------cut here---------------end--------------->8---
Thanks a lot.

I've seen these warnings but I ignored thinking I couldn't fix it as I
didn't find any alternate files for the releases.

I've now sent an updated version.

By the way, I don't know much about go, and I'm pretty new to Guix, so
I did this package through trial and error and also looking at how
things were done in Parabola (through the Arch Linux Community
repository where the matterbridge package comes from).

And the Submitting Patches section of the manual[1] has the following:
> Make sure the package does not use bundled copies of software
> already available as separate packages. 

Here I'm unsure of what is being done under the hood, but at least
Parabola / Arch Linux don't seem to do anything special with that.

In any case I've already started deploying a matterbridge service by
using this package (with Guix pack) and a modified systemd service
file from Arch Linux on top of Trisquel 9 to bridge several IRC
channels, and so far it worked fine.

References:
-----------
[1]https://guix.gnu.org/manual/en/guix.html#Submitting-Patches 

Denis.
diff mbox series

Patch

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index b326b68952..8554f9230a 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -28,6 +28,7 @@ 
 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
 ;;; Copyright © 2020, 2021 Robert Karszniewicz <avoidr@posteo.de>
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
+;;; Copyright © 2021 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -123,6 +124,7 @@ 
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system go)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
@@ -2967,4 +2969,30 @@  designed for experienced users.")
     (description "This package contains Zulip's official terminal client.")
     (license license:asl2.0)))
 
+(define-public matterbridge
+  (package
+    (name "matterbridge")
+    (version "1.22.2")
+    (source
+     (origin
+      (method url-fetch)
+      (uri
+       (string-append
+        "https://github.com/42wim/matterbridge/archive/v" version ".tar.gz"))
+      (sha256
+       (base32
+        "1p3mkfzv4xwm7vz8ja7qsa99qwxb9s61hnjjv65dkkjivlsif5hk"))))
+    (build-system go-build-system)
+    (arguments
+     `(#:import-path "github.com/42wim/matterbridge"
+       #:unpack-path "github.com/42wim/matterbridge"))
+    (synopsis "Bridge together channels from various messaging networks and protocols")
+    (description "Relays messages between different channels from various
+messaging networks and protocols.  So far it supports mattermost, IRC, gitter,
+xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp,
+keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API.
+Mattermost is not required.")
+    (home-page "https://github.com/42wim/matterbridge")
+    (license license:asl2.0)))
+
 ;;; messaging.scm ends here