Subject: [bug#54560] [PATCH 26/47] gnu: Add go-github-com-simonpasquier-klog-gokit.

From: Leo Nikkilä <[email-masked]>
Date: Fri, 25 Mar 2022 15:31:50 +0200

* gnu/packages/golang.scm (go-github-com-simonpasquier-klog-gokit): New
variable.
---
 gnu/packages/golang.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index da399aaafd..9931c460d4 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -10363,6 +10363,41 @@ (define-public go-github-com-oklog-ulid
     (home-page "https://github.com/oklog/ulid")
     (license license:asl2.0)))
 
+(define-public go-github-com-simonpasquier-klog-gokit
+  (package
+    (name "go-github-com-simonpasquier-klog-gokit")
+    (version "0.3.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/simonpasquier/klog-gokit")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "061hxp1x7akgfdg9iy4kk5528rzq70cq7pj8azygf4149i7nsssk"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/simonpasquier/klog-gokit"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-source
+           (lambda* (#:key import-path #:allow-other-keys)
+             ;; `go-kit/kit' is large and unpackaged, however the log
+             ;; library has been extracted out and can be swapped in.
+             (substitute* (find-files (string-append "src/" import-path)
+                                      "\\.go")
+               (("github.com/go-kit/kit/log") "github.com/go-kit/log"))
+             #t)))))
+    (propagated-inputs (list go-github-com-go-kit-log))
+    (native-inputs (list go-github-com-stretchr-testify))
+    (synopsis "Replacement for klog for projects using the go-kit
+logger")
+    (description "Replacement for @code{k8s.io/klog} in projects that
+use the @code{github.com/go-kit/log} module for logging.")
+    (home-page "https://github.com/simonpasquier/klog-gokit")
+    (license license:asl2.0)))
+
 (define-public go-google-golang-org-protobuf
   (package
     (name "go-google-golang-org-protobuf")
-- 
2.34.0