diff mbox series

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

Message ID 20220325133211.5128-26-hello@lnikki.la
State New
Headers show
Series [bug#54560,01/47] gnu: Add go-google-golang-org-protobuf. | expand

Commit Message

Leo Nikkilä March 25, 2022, 1:31 p.m. UTC
* gnu/packages/golang.scm (go-github-com-simonpasquier-klog-gokit): New
variable.
---
 gnu/packages/golang.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
diff mbox series

Patch

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")