Subject: [PATCH v1] gnu: matterbridge: Unbundle most golang.org dependencies.
From: Denis 'GNUtoo' Carikli <[email-masked]>
To: [email-masked], Sharlatan Hellseher <[email-masked]>
Cc: Denis 'GNUtoo' Carikli <[email-masked]>
Date: Sun, 27 Oct 2024 19:12:46 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

The vendor/golang.org/x/net dependency was kept because removing it redults in
a compilation failure:
    %exception #<&invoke-error program: "go" arguments: ("install" "-v" "-x"
     "-ldflags=-s -w" "-trimpath" "github.com/42wim/matterbridge")
     exit-status: 1 term-signal: #f stop-signal: #f>

* gnu/packages/messaging.scm (matterbridge) [source]:
  Add snippet removing the unbundled dependencies.
  [arguments]: Add new unbundled dependencies.

Signed-off-by: Denis 'GNUtoo' Carikli <[email-masked]>
Change-Id: I67afeff8721833d34a54fd52684a4acbcbcaf179
---
 gnu/packages/messaging.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index c482cd469e..86f6ff0e04 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -3302,6 +3302,19 @@ (define-public matterbridge
                     (url "https://github.com/42wim/matterbridge")
                     (commit (string-append "v" version))))
               (file-name (git-file-name name version))
+              (modules '((guix build utils)))
+              (snippet '(for-each delete-file-recursively
+                                  ;; TODO: unbundle the rest as well
+                                  '("vendor/golang.org/x/crypto"
+                                    "vendor/golang.org/x/image"
+                                    "vendor/golang.org/x/mod"
+                                    "vendor/golang.org/x/oauth2"
+                                    "vendor/golang.org/x/sys"
+                                    "vendor/golang.org/x/term"
+                                    "vendor/golang.org/x/text"
+                                    "vendor/golang.org/x/time"
+                                    "vendor/golang.org/x/tools")))
+
               (sha256
                (base32
                 "0939fiy7z53izznfhlr7c6vaskbmkbj3ncb09fzx5dmz9cjngy80"))))
@@ -3309,6 +3322,15 @@ (define-public matterbridge
     (arguments
      (list
       #:import-path "github.com/42wim/matterbridge"))
+    (inputs (list go-golang-org-x-crypto
+                  go-golang-org-x-image
+                  go-golang-org-x-mod
+                  go-golang-org-x-oauth2
+                  go-golang-org-x-sys
+                  go-golang-org-x-term
+                  go-golang-org-x-text
+                  go-golang-org-x-time
+                  go-golang-org-x-tools))
     (synopsis "Bridge together various messaging networks and protocols")
     (description
      "Relays messages between different channels from various
-- 
2.46.0