diff mbox series

[bug#55903,v3,27/35] gnu: Add go-github-com-niemeyer-pretty.

Message ID 20220613194030.3540-27-paren@disroot.org
State New
Headers show
Series [bug#55903,v3,01/35] gnu: Add go-github-com-zenhack-go-notmuch. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

\( June 13, 2022, 7:40 p.m. UTC
From: "(unmatched-parenthesis" <paren@disroot.org>

* gnu/packages/golang.scm (go-github-com-niemeyer-pretty): New variable.
---
 gnu/packages/golang.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 5a9cd9fda1..aaca7ac621 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -10530,3 +10530,36 @@  (define-public go-github-com-emersion-go-smtp
      "The smtp package implements the Simple Mail Transfer Protocol as defined
 by RFC 5321.")
     (license license:expat)))
+
+(define-public go-github-com-niemeyer-pretty
+  (package
+    (name "go-github-com-niemeyer-pretty")
+    (version "0.0.0-20200227124842-a10e7caefd8e")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/niemeyer/pretty")
+                    (commit (go-version->git-ref version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1jmazh4xzaa3v6g46hz60q2z7nmqs9l9cxdzmmscn3kbcs2znq4v"))))
+    (build-system go-build-system)
+    (arguments
+     (list #:import-path "github.com/niemeyer/pretty"
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'int-to-string-with-rune
+                 (lambda* (#:key import-path #:allow-other-keys)
+                   (with-directory-excursion (string-append "src/" import-path)
+                     (substitute* "formatter.go"
+                       (("s \\+= string\\(i\\)")
+                        "s += string(rune(i))"))))))))
+    (propagated-inputs (list go-github-com-kr-text))
+    (home-page "https://github.com/niemeyer/pretty")
+    (synopsis "Pretty-print Go values")
+    (description
+     "The pretty package provides pretty-printing for Go values.  This is
+useful during debugging, to avoid wrapping long output lines in the
+terminal.")
+    (license license:expat)))