diff mbox series

[bug#65034,v2,3/3] gnu: go-github-com-golang-protobuf-proto: Rename to go-github-com-golang-protobuf.

Message ID fb3bff6d7f0e9f689ace38481d9b112304a7b24c.1695521520.git.hako@ultrarare.space
State New
Headers show
Series gnu: go-google-golang-org-protobuf: Update to 1.31.0. | expand

Commit Message

Hilton Chain Sept. 24, 2023, 2:39 a.m. UTC
* gnu/packages/golang.scm (go-github-com-golang-protobuf-proto): Rename to...
(go-github-com-golang-protobuf): ... this.
[arguments]<#:import-path>: Set to "github.com/golang/protobuf".
<#:unpack-path>: Remove argument.
<#:phases>: Build all Go packages and run tests for them.
(go-github-com-lucas-clemente-quic-go,go-github-com-prometheus-common)
(go-github-com-prometheus-client-golang,go-github-com-onsi-gomega)
[propagated-inputs]: Adjust accordingly.
* gnu/packages/syncthing.scm (go-github-com-prometheus-client-model)
(go-github-com-matttproud-golang-protobuf-extensions-pbutil)
[propagated-inputs]: Likewise.
---
 gnu/packages/golang.scm    | 47 ++++++++++++++++++++++++++++++--------
 gnu/packages/syncthing.scm |  4 ++--
 2 files changed, 40 insertions(+), 11 deletions(-)

Comments

Maxim Cournoyer Jan. 21, 2024, 11 p.m. UTC | #1
Hi Hilton,

Hilton Chain <hako@ultrarare.space> writes:

> * gnu/packages/golang.scm (go-github-com-golang-protobuf-proto): Rename to...
> (go-github-com-golang-protobuf): ... this.
> [arguments]<#:import-path>: Set to "github.com/golang/protobuf".
> <#:unpack-path>: Remove argument.
> <#:phases>: Build all Go packages and run tests for them.
> (go-github-com-lucas-clemente-quic-go,go-github-com-prometheus-common)
> (go-github-com-prometheus-client-golang,go-github-com-onsi-gomega)
> [propagated-inputs]: Adjust accordingly.
> * gnu/packages/syncthing.scm (go-github-com-prometheus-client-model)
> (go-github-com-matttproud-golang-protobuf-extensions-pbutil)
> [propagated-inputs]: Likewise.

I wanted to apply this to core-updates but I think I had merge
conflicts.  Could you check if it still applies cleanly, else upload a
v3?
Hilton Chain Jan. 25, 2024, 5:10 p.m. UTC | #2
Hi Maxim,

On Mon, 22 Jan 2024 07:00:43 +0800,
Maxim Cournoyer wrote:
>
> Hi Hilton,
>
> Hilton Chain <hako@ultrarare.space> writes:
>
> > * gnu/packages/golang.scm (go-github-com-golang-protobuf-proto): Rename to...
> > (go-github-com-golang-protobuf): ... this.
> > [arguments]<#:import-path>: Set to "github.com/golang/protobuf".
> > <#:unpack-path>: Remove argument.
> > <#:phases>: Build all Go packages and run tests for them.
> > (go-github-com-lucas-clemente-quic-go,go-github-com-prometheus-common)
> > (go-github-com-prometheus-client-golang,go-github-com-onsi-gomega)
> > [propagated-inputs]: Adjust accordingly.
> > * gnu/packages/syncthing.scm (go-github-com-prometheus-client-model)
> > (go-github-com-matttproud-golang-protobuf-extensions-pbutil)
> > [propagated-inputs]: Likewise.
>
> I wanted to apply this to core-updates but I think I had merge
> conflicts.  Could you check if it still applies cleanly, else upload a
> v3?

That's because of the go-github-com-quic-go-quic-go name change, I'll send v3.
diff mbox series

Patch

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index f8a0d48b73..6fc7b13fef 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8023,7 +8023,7 @@  (define-public go-github-com-lucas-clemente-quic-go
      (list go-golang-org-x-crypto go-github-com-cheekybits-genny
            go-github-com-marten-seemann-chacha20
            go-github-com-marten-seemann-qtls
-           go-github-com-golang-protobuf-proto))
+           go-github-com-golang-protobuf))
     (synopsis "QUIC in Go")
     (description "This package provides a Go language implementation of the QUIC
 network protocol.")
@@ -8820,9 +8820,9 @@  (define-public gotestsum
     (home-page "https://github.com/gotestyourself/gotestsum")
     (license license:asl2.0)))
 
-(define-public go-github-com-golang-protobuf-proto
+(define-public go-github-com-golang-protobuf
   (package
-    (name "go-github-com-golang-protobuf-proto")
+    (name "go-github-com-golang-protobuf")
     (version "1.5.3")
     (source (origin
               (method git-fetch)
@@ -8835,8 +8835,38 @@  (define-public go-github-com-golang-protobuf-proto
                 "03f1w2cd4s8a3xhl61x7yjx81kbzlrjpvnnwmbhqnz814yi7h43i"))))
     (build-system go-build-system)
     (arguments
-     '(#:import-path "github.com/golang/protobuf/proto"
-       #:unpack-path "github.com/golang/protobuf"))
+     (list #:import-path "github.com/golang/protobuf"
+           ;; XXX: Workaround for go-build-system's lack of Go modules support
+           #:phases
+           #~(let ((go-packages '("proto"
+                                  "jsonpb"
+                                  "ptypes"
+                                  "ptypes/any"
+                                  "ptypes/empty"
+                                  "ptypes/timestamp"
+                                  "ptypes/duration"
+                                  "ptypes/wrappers"
+                                  "ptypes/struct"
+                                  "protoc-gen-go/descriptor"
+                                  "protoc-gen-go/plugin"
+                                  "protoc-gen-go")))
+               (modify-phases %standard-phases
+                 (replace 'build
+                   (lambda* (#:key import-path build-flags #:allow-other-keys)
+                     (for-each
+                      (lambda (pkg)
+                        ((assoc-ref %standard-phases 'build)
+                         #:import-path (format #f "~a/~a" import-path pkg)
+                         #:build-flags build-flags))
+                      go-packages)))
+                 (replace 'check
+                   (lambda* (#:key tests? import-path #:allow-other-keys)
+                     (for-each
+                      (lambda (pkg)
+                        ((assoc-ref %standard-phases 'check)
+                         #:tests? tests?
+                         #:import-path (format #f "~a/~a" import-path pkg)))
+                      go-packages)))))))
     (propagated-inputs
      (list go-google-golang-org-protobuf))
     (synopsis "Go support for Protocol Buffers")
@@ -10697,7 +10727,7 @@  (define-public go-github-com-prometheus-common
          ;; Source-only package
          (delete 'build))))
     (propagated-inputs
-     (list go-github-com-golang-protobuf-proto
+     (list go-github-com-golang-protobuf
            go-github-com-matttproud-golang-protobuf-extensions-pbutil
            go-github-com-prometheus-client-model))
     (synopsis "Prometheus metrics")
@@ -10754,7 +10784,7 @@  (define-public go-github-com-prometheus-client-golang
          (delete 'build))))
     (propagated-inputs
      (list go-github-com-beorn7-perks-quantile
-           go-github-com-golang-protobuf-proto
+           go-github-com-golang-protobuf
            go-github-com-prometheus-client-model
            go-github-com-prometheus-common
            go-github-com-prometheus-procfs
@@ -13937,11 +13967,10 @@  (define-public go-github-com-onsi-gomega
            ;; Unless we disable the tests, we have a circular dependency on
            ;; ginkgo/v2.
            #:tests? #f))
-    (propagated-inputs (list go-github-com-golang-protobuf-proto
+    (propagated-inputs (list go-github-com-golang-protobuf
                              go-golang-org-x-net
                              go-golang-org-x-sys
                              go-golang-org-x-text
-                             go-google-golang-org-protobuf
                              go-gopkg-in-yaml-v2))
     (home-page "https://github.com/onsi/gomega")
     (synopsis "Matcher library for Ginkgo")
diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm
index 5570aa9361..30ec34e8f3 100644
--- a/gnu/packages/syncthing.scm
+++ b/gnu/packages/syncthing.scm
@@ -828,7 +828,7 @@  (define-public go-github-com-prometheus-client-model
            ;; Source-only package
            (delete 'build))))
       (propagated-inputs
-       (list go-github-com-golang-protobuf-proto))
+       (list go-github-com-golang-protobuf))
       (synopsis "Data model artifacts for Prometheus")
       (description "This package provides data model artifacts for Prometheus.")
       (home-page "https://github.com/prometheus/client_model")
@@ -856,7 +856,7 @@  (define-public go-github-com-matttproud-golang-protobuf-extensions-pbutil
        '(#:import-path "github.com/matttproud/golang_protobuf_extensions/pbutil"
          #:unpack-path "github.com/matttproud/golang_protobuf_extensions"))
       (propagated-inputs
-       (list go-github-com-golang-protobuf-proto))
+       (list go-github-com-golang-protobuf))
       (synopsis "Streaming Protocol Buffers in Go")
       (description "This package provides various Protocol Buffer
 extensions for the Go language, namely support for record length-delimited