sharlatan pushed a commit to branch go-team
in repository guix.

commit fa7c4a265ff89cc9c3db1c9f08cb575e5de49f3e
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Thu Feb 13 14:45:16 2025 +0000

    gnu: Add mautrix-whatsapp.
    
    It was proposed in #62284 on <2023-03-20>.
    
    * gnu/packages/matrix.scm: Add (gnu packages golang), (gnu packages
    golang-build), (gnu packages golang-web), (gnu packages golang-xyz)
    and (guix build-system go).
    (mautrix-whatsapp): New variable.
    
    Co-authored-by: conses <[email protected]>
    Co-authored-by: Miguel Ángel Moreno <[email protected]>
    Change-Id: I4371f3f0d5939e875e7d7dc4748b9f82558e1248
---
 gnu/packages/matrix.scm | 83 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/gnu/packages/matrix.scm b/gnu/packages/matrix.scm
index be3edae0dc..c8edaf5d5a 100644
--- a/gnu/packages/matrix.scm
+++ b/gnu/packages/matrix.scm
@@ -5,8 +5,11 @@
 ;;; Copyright © 2020 Giacomo Leidi <[email protected]>
 ;;; Copyright © 2022 Aleksandr Vityazev <[email protected]>
 ;;; Copyright © 2022 Morgan Smith <[email protected]>
+;;; Copyright © 2023 Miguel Ángel Moreno <[email protected]>
+;;; Copyright © 2023 conses <[email protected]>
 ;;; Copyright © 2025 Ricardo Wurmus <[email protected]>
 ;;; Copyright © 2025 Arjan Adriaanse <[email protected]>
+;;; Copyright © 2025 Sharlatan Hellseher <[email protected]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +32,11 @@
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages golang)
+  #:use-module (gnu packages golang-build)
+  #:use-module (gnu packages golang-crypto)
+  #:use-module (gnu packages golang-web)
+  #:use-module (gnu packages golang-xyz)
   #:use-module (gnu packages monitoring)
   #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-check)
@@ -36,6 +44,7 @@
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages xml)
+  #:use-module (guix build-system go)
   #:use-module (guix build-system pyproject)
   #:use-module (guix build-system python)
   #:use-module (guix download)
@@ -43,6 +52,80 @@
   #:use-module (guix git-download)
   #:use-module (guix packages))
 
+(define-public mautrix-whatsapp
+  (package
+    (name "mautrix-whatsapp")
+    (version "0.11.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mautrix/whatsapp";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0wn9kldhh865w5mbg3cl61m0db9nr7zl1j8lqs2dixsaihv1lbnx"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:go go-1.23
+      #:install-source? #f
+      #:tests? #f ; no tests provided
+      #:import-path "go.mau.fi/mautrix-whatsapp/cmd/mautrix-whatsapp"
+      #:unpack-path "go.mau.fi/mautrix-whatsapp"
+      #:build-flags
+      #~(list (string-append "-ldflags=-X main.Tag=" #$version))
+      #:embed-files
+      #~(list
+         ;; go.mau.fi/whatsmeow/proto/<...> pattern <...>.pb.raw: cannot embed
+         ;; irregular file <...>.pb.raw
+         ".*\\.pb\\.raw$"
+         ;; maunium.net/go/mautrix/bridgev2/database/upgrades/upgrades.go
+         ;; maunium.net/go/mautrix/crypto/sql_store_upgrade/upgrade.go
+         ;; maunium.net/go/mautrix/sqlstatestore/statestore.go
+         ;;
+         ;; pattern *.sql: cannot embed irregular file <...>.sql
+         ".*\\.sql"
+         ;; golang.org/x/net/publicsuffix/table.go:63:12: pattern
+         ;; data/children: cannot embed irregular file data/children
+         "children"
+         ;; golang.org/x/net/publicsuffix/table.go:48:12: pattern data/nodes:
+         ;; cannot embed irregular file data/nodes
+         "nodes"
+         ;; golang.org/x/net/publicsuffix/table.go:33:12: pattern data/text:
+         ;; cannot embed irregular file data/text
+         "text"
+         ;; maunium.net/go/mautrix/bridgev2/matrix/mxmain/config.go:17:12:
+         ;; pattern example-config.yaml: cannot embed irregular file
+         ;; example-config.yaml
+         "example-config\\.yaml"
+         ;; go.mau.fi/webp/webp.go:14:12: pattern internal: cannot embed
+         ;; directory internal: contains no embeddable files
+         ".*\\.c"
+         ".*\\.h")))
+    (native-inputs
+     (list olm
+           go-github-com-gorilla-mux
+           go-github-com-gorilla-websocket
+           go-github-com-lib-pq
+           go-github-com-rs-zerolog
+           go-go-mau-fi-util
+           go-go-mau-fi-webp
+           go-go-mau-fi-whatsmeow
+           go-golang-org-x-exp
+           go-golang-org-x-image
+           go-golang-org-x-net
+           go-golang-org-x-sync
+           go-google-golang-org-protobuf
+           go-gopkg-in-yaml-v3
+           go-maunium-net-go-mautrix))
+    (home-page "https://go.mau.fi/mautrix-whatsapp";)
+    (synopsis "Matrix <-> WhatsApp puppeting bridge")
+    (description
+     "This package provides a @code{Matrix<->WhatsApp} puppeting bridge based
+on @url{https://github.com/tulir/whatsmeow, whatsmeow}.")
+    (license license:agpl3+)))
+
 (define-public python-matrix-client
   (package
     (name "python-matrix-client")

Reply via email to