diff mbox series

[bug#54335,v4,08/12] gnu: Add go-google-golang-org-protobuf.

Message ID 20240211182830.3631-9-levenson@mmer.org
State New
Headers show
Series gnu: Add nebula. | expand

Commit Message

Alexey Abramov Feb. 11, 2024, 6:28 p.m. UTC
From: Dominic Martinez <dom@dominicm.dev>

* gnu/packages/golang.scm (go-google-golang-org-protobuf): New variable.
---
 gnu/packages/golang.scm | 42 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index b87e820db1..2f419fe35d 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -11845,6 +11845,48 @@  (define-public go-github-com-songgao-water
 etc..  Use waterutil with it to work with TUN/TAP packets/frames.")
     (license license:bsd-3)))
 
+(define-public go-google-golang-org-protobuf
+  (package
+    (name "go-google-golang-org-protobuf")
+    (version "1.28.0")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://go.googlesource.com/protobuf")
+               (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32 "1nzcc4qc00afi24nb7nlnwyzvvr6b8s8qdrn1sw085nygh2y2x8r"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "google.golang.org/protobuf"
+       #:phases
+       ;; Build and test all sub-packages
+       (let ((glob-path "google.golang.org/protobuf/..."))
+         (modify-phases %standard-phases
+           (replace 'build
+             (lambda args
+               (apply (assoc-ref %standard-phases
+                                 'build)
+                      `(,@args #:import-path
+                               ,glob-path))))
+           (replace 'check
+             (lambda args
+               (apply (assoc-ref %standard-phases
+                                 'check)
+                      `(,@args #:import-path
+                               ,glob-path))))))))
+    (native-inputs (list go-github-com-google-go-cmp-cmp))
+    (synopsis "Go support for Google's protocol buffers")
+    (description
+     "Go implementation for protocol buffers, which is a
+language-neutral, platform-neutral, extensible mechanism for serializing
+structured data.  The protocol buffer language is a language for
+specifying the schema for structured data.  This schema is compiled into
+language specific bindings.")
+    (home-page "https://go.googlesource.com/protobuf")
+    (license license:bsd-3)))
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar