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

commit 4504b2190b5f7118fe9006a61271ca9dc2f40f3b
Author: Sharlatan Hellseher <sharlata...@gmail.com>
AuthorDate: Tue May 27 22:44:26 2025 +0100

    gnu: Add go-google-golang-org-genproto-googleapis-api.
    
    * gnu/packages/golang-web.scm 
(go-google-golang-org-genproto-googleapis-api): New variable.
    
    Change-Id: Id7078bf2b3b0f6c6cb75c479ad58ea7cf9d68324
---
 gnu/packages/golang-web.scm | 63 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/golang-web.scm b/gnu/packages/golang-web.scm
index f39f471b52..7ade70846d 100644
--- a/gnu/packages/golang-web.scm
+++ b/gnu/packages/golang-web.scm
@@ -10447,6 +10447,69 @@ the standard @code{context} package to store 
request-scoped values.")
     (description "This package is a Go Implementation of WireGuard.")
     (license license:expat)))
 
+(define-public go-google-golang-org-genproto-googleapis-api
+  (package
+    (name "go-google-golang-org-genproto-googleapis-api")
+    (version "0.0.0-20250519155744-55703ea1f237")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/googleapis/go-genproto";)
+             (commit (go-version->git-ref version #:subdir "googleapis/api"))))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-26)))
+       (snippet
+        #~(begin
+            ;; XXX: 'delete-all-but' is copied from the turbovnc package.
+            ;; Consider to implement it as re-usable procedure in
+            ;; guix/build/utils or guix/build-system/go.
+            (define (delete-all-but directory . preserve)
+              (define (directory? x)
+                (and=> (stat x #f)
+                       (compose (cut eq? 'directory <>) stat:type)))
+              (with-directory-excursion directory
+                (let* ((pred
+                        (negate (cut member <> (append '("." "..") preserve))))
+                       (items (scandir "." pred)))
+                  (for-each (lambda (item)
+                              (if (directory? item)
+                                  (delete-file-recursively item)
+                                  (delete-file item)))
+                            items))))
+            ;; Submodules with their own go.mod files and packaged separately:
+            ;;
+            ;; - google.golang.org/genproto/googleapis/api/apikeys
+            ;; - google.golang.org/genproto/googleapis/api/servicecontrol
+            ;; - google.golang.org/genproto/googleapis/api/servicemanagement
+            ;; - google.golang.org/genproto/googleapis/api/serviceusage
+            (for-each delete-file-recursively
+                      (list "googleapis/api/apikeys"
+                            "googleapis/api/servicecontrol"
+                            "googleapis/api/servicemanagement"
+                            "googleapis/api/serviceusage"))
+            (delete-all-but "googleapis" "api")
+            (delete-all-but "." "googleapis")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1ilf95lhx7930cqx2hmswxasxyxjz3xmbznd0cfcglzdl3d9k4rk"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:go go-1.23
+      #:import-path "google.golang.org/genproto/googleapis/api"
+      #:unpack-path "google.golang.org/genproto"))
+    (propagated-inputs
+     (list go-google-golang-org-genproto-googleapis-rpc
+           go-google-golang-org-grpc
+           go-google-golang-org-protobuf))
+    (home-page "https://github.com/googleapis/go-genproto";)
+    (synopsis "API implementation of Google Cloud Platform in Golang")
+    (description
+     "This package provides an API to interact with @acronym{GCP, Google Cloud 
Platform}.")
+    (license license:asl2.0)))
+
 (define-public go-google-golang-org-grpc
   (package
     (name "go-google-golang-org-grpc")

Reply via email to