[PATCH] gnu: Add matterbridge.

  • Done
  • quality assurance status badge
Details
2 participants
  • Denis 'GNUtoo' Carikli
  • Mathieu Othacehe
Owner
unassigned
Submitted by
Denis 'GNUtoo' Carikli
Severity
normal
D
D
Denis 'GNUtoo' Carikli wrote on 3 Jun 2021 15:22
(address . guix-patches@gnu.org)(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
20210603132231.10168-1-GNUtoo@cyberdimension.org
* 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(+)

Toggle diff (53 lines)
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
--
2.31.1
M
M
Mathieu Othacehe wrote on 4 Jun 2021 14:07
(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)(address . 48810@debbugs.gnu.org)
87im2testl.fsf@gnu.org
Hello,

The linter reports two problems:

Toggle snippet (4 lines)
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

which means that you should use:

Toggle quote (2 lines)
> + (method url-fetch)

git-fetch here,

Toggle quote (4 lines)
> + (sha256
> + (base32
> + "1p3mkfzv4xwm7vz8ja7qsa99qwxb9s61hnjjv65dkkjivlsif5hk"))))

and introduce something like:

Toggle snippet (3 lines)
(file-name (git-file-name name version))

here. Could you please send an updated patch?

Thanks,

Mathieu
D
D
Denis 'GNUtoo' Carikli wrote on 4 Jun 2021 18:11
[PATCH v2] gnu: Add matterbridge.
(address . othacehe@gnu.org)
20210604161141.8929-1-GNUtoo@cyberdimension.org
* gnu/packages/messaging.scm (matterbridge): New variable.

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

Toggle diff (54 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 96cbf95fe9..021888cfae 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,31 @@ 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 git-fetch)
+ (uri (git-reference
+ (url "https://github.com/42wim/matterbridge")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "07rgdc4v043fhzsalmlhickqizk6xjlpjkzn6l5v9ryp5gmv580z"))))
+ (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
--
2.31.1
D
D
Denis 'GNUtoo' Carikli wrote on 4 Jun 2021 18:16
Re: bug#48810: [PATCH] gnu: Add matterbridge.
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 48810@debbugs.gnu.org)
20210604181602.0d04d3f5@primarylaptop.localdomain
On Fri, 04 Jun 2021 14:07:50 +0200
Mathieu Othacehe <othacehe@gnu.org> wrote:

Toggle quote (1 lines)
> Hello,
Hi,

Toggle quote (24 lines)
> 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:
Toggle quote (3 lines)
> 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:
-----------

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmC6UcMACgkQX138wUF3
4mO+qw/+Jl4Q7sBr/Raq6j8zq5mfe8OjNGYsHaVX2h9poI1U4b9tNt3RfobFMJrt
WF9SDxOU/epbSTA54zNiUGKHGZNculNaVeuiGIPXfZCIH5jidryfvWkYAF/lv4YK
PeErFPdJumKuaz9XKVB1i0BlwWwQEg62SOtkqIux5qvEscIn+IhwZITOGJUzVSZ5
Ou3h45TrZAJzJMHz0lrjXB3ZfmmrjJhuDEwDjy2iDuaXkIuh6fTXV7g8gTpPSViS
2QByr3qPcYEnFIrxa+xbOQXHGWl7j4myLvDn2KuHdLSmCKK2tVVZpvO7nePwliv9
/SwWuecRgUXQwxA9oYrN8vzCK17ibFc87mSiiOc4h6AbMDW1AnunWHjrS8wxN4Ga
51I/7F1w4Y8sIG/wMjCOLMd/V2nZ5zm+RW+1zRsT6neYnxSfK4PaxWidcI0Bz9bf
0erHvSoAGnDbc/hjwSXKBVtT6EQZI3lo5mBzPYQ4E7eXgx7uFhiEGG4q2I6oqbbO
axiTjPi4gHSMa1K4y5ith6xh7uyaqhkYxWG4lUZQHaYSi5r+FLKd2So9ITtK00Ri
gBRgsuFb/k+r1sh94Rl2y2kWWEBWYQ/9ImSFC8QkfMLLACeZ5NYtnbHkmd0cKQZG
7pmTiXlftT4zojSJhnQRk4GS1lgXZ5VhVo8Oku5Q1WQuAQeBQTg=
=agzz
-----END PGP SIGNATURE-----


M
M
Mathieu Othacehe wrote on 6 Jun 2021 18:34
Re: [PATCH v2] gnu: Add matterbridge.
(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)(address . 48810-done@debbugs.gnu.org)
87eedfost3.fsf@gnu.org
Hello Denis,

Toggle quote (2 lines)
> * gnu/packages/messaging.scm (matterbridge): New variable.

Thanks for this new version. I fixed the indentation, edited a bit the
synopsis and description and pushed as
3c401ca6df385b737363e5caea7396d3aa55863f.

Thanks,

Mathieu
Closed
?