diff mbox series

[bug#54123,2/5] gnu: Add go-github-com-niemeyer-pretty.

Message ID 98ccc56c6c203acd07dcb8ec0a81c0a39db622b9.1645611835.git.efraim@flashner.co.il
State Accepted
Headers show
Series some golang packages | 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

Efraim Flashner Feb. 23, 2022, 10:29 a.m. UTC
* gnu/packages/golang.scm (go-github-com-niemeyer-pretty): New variable.
---
 gnu/packages/golang.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Comments

M Feb. 23, 2022, 12:39 p.m. UTC | #1
Efraim Flashner schreef op wo 23-02-2022 om 12:29 [+0200]:
> +    (arguments
> +     '(#:import-path "github.com/niemeyer/pretty"
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'patch-source
> +           (lambda _
> +             ;; https://github.com/kr/pretty/pull/66
> +             (substitute* "src/github.com/niemeyer/pretty/formatter.go"
> +               (("string\\(i\\)") "string(rune(i))")))))))

The 'patches' and 'snippet' fields of 'origin' are for patching
source code.  While patching in a phase works, an origin snippet
seems a more natural place to me.

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index e1d9d1fcde..95ef87385a 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -5511,6 +5511,36 @@  (define-public go-github-com-kr-pretty
     (home-page "https://github.com/kr/pretty")
     (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
+     '(#:import-path "github.com/niemeyer/pretty"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-source
+           (lambda _
+             ;; https://github.com/kr/pretty/pull/66
+             (substitute* "src/github.com/niemeyer/pretty/formatter.go"
+               (("string\\(i\\)") "string(rune(i))")))))))
+    (propagated-inputs
+     (list go-github-com-kr-text))
+    (home-page "https://github.com/niemeyer/pretty")
+    (synopsis "Pretty printer for Go values")
+    (description "This package provides a pretty printer for Go values.")
+    (license license:expat)))
+
 (define-public go-github-com-kylelemons-godebug
   (package
     (name "go-github-com-kylelemons-godebug")