[PATCH 1/4] gnu: Add go-github-com-nwidger-jsoncolor.

  • Done
  • quality assurance status badge
Details
2 participants
  • Joseph LaFreniere
  • Ludovic Courtès
Owner
unassigned
Submitted by
Joseph LaFreniere
Severity
normal
J
J
Joseph LaFreniere wrote on 29 Nov 2020 05:58
(address . guix-patches@gnu.org)
87r1ocdai5.fsf@lafreniere.xyz
Patch file attached.

--
Joseph LaFreniere
From 1db67f6b7cac25a16913776431c4d3bf97ba1c9f Mon Sep 17 00:00:00 2001
From: Joseph LaFreniere <joseph@lafreniere.xyz>
Date: Sat, 28 Nov 2020 22:25:35 -0600
Subject: [PATCH 1/4] gnu: Add go-github-com-nwidger-jsoncolor.

* gnu/packages/golang.scm (go-github-com-nwidger-jsoncolor): New variable.
---
gnu/packages/golang.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (40 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 92533cfd50..72f43efd8a 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -5134,6 +5134,33 @@ style your output, without you having to deal with all kinds of weird ANSI
escape sequences and color conversions.")
(license license:expat)))
+(define-public go-github-com-nwidger-jsoncolor
+ (package
+ (name "go-github-com-nwidger-jsoncolor")
+ (version "0.3.0")
+ (home-page "https://github.com/nwidger/jsoncolor")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "13rd146pnj7qm70r1333gyd1f61x40nafxlpvdxlci9h7mx8c5p8"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/nwidger/jsoncolor"))
+ (native-inputs
+ `(("go-github-com-fatih-color" ,go-github-com-fatih-color)))
+ (synopsis "Colorized JSON marshalling and encoding")
+ (description
+ "@code{jsoncolor} is a drop-in replacement for @code{encoding/json}'s
+@code{Marshal} and @code{MarshalIndent} functions and @code{Encoder} type
+which produce colorized output using github.com/fatih/color.")
+ (license license:expat)))
+
(define-public go-github-com-olekukonko-tablewriter
(package
(name "go-github-com-olekukonko-tablewriter")
--
2.29.2
J
J
Joseph LaFreniere wrote on 29 Nov 2020 06:08
[PATCH 2/4] gnu: go-github-com-mattn-go-colorable: Update to 0.1.8.
(address . 44940@debbugs.gnu.org)
20201129050802.47551-1-joseph@lafreniere.xyz
* gnu/packages/golang.scm (go-github-com-mattn-go-colorable): Update to 0.1.8.
---
gnu/packages/golang.scm | 48 ++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 25 deletions(-)

Toggle diff (62 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 72f43efd8a..cb7fe6e3bb 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -1965,32 +1965,30 @@ terminal.")
(license license:expat)))
(define-public go-github-com-mattn-go-colorable
- (let ((commit "efa589957cd060542a26d2dd7832fd6a6c6c3ade")
- (revision "0"))
- (package
- (name "go-github-com-mattn-go-colorable")
- (version (git-version "0.0.0" revision commit))
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/mattn/go-colorable")
- (commit commit)))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "0kshi4hvm0ayrsxqxy0599iv81kryhd2fn9lwjyczpj593cq069r"))))
- (build-system go-build-system)
- (native-inputs
- `(("go-github-com-mattn-go-isatty"
- ,go-github-com-mattn-go-isatty)))
- (arguments
- '(#:import-path "github.com/mattn/go-colorable"))
- (home-page "https://github.com/mattn/go-colorable")
- (synopsis "Handle ANSI color escapes on Windows")
- (description "This package provides @code{colorable}, a module that
+ (package
+ (name "go-github-com-mattn-go-colorable")
+ (version "0.1.8")
+ (home-page "https://github.com/mattn/go-colorable")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0q34zqwbnls72md8q8mhj368s7p3i4xspvs3rk8fs76s0pn7dr2l"))))
+ (build-system go-build-system)
+ (native-inputs
+ `(("go-github-com-mattn-go-isatty"
+ ,go-github-com-mattn-go-isatty)))
+ (arguments
+ '(#:import-path "github.com/mattn/go-colorable"))
+ (synopsis "Handle ANSI color escapes on Windows")
+ (description "This package provides @code{colorable}, a module that
makes it possible to handle ANSI color escapes on Windows.")
- (license license:expat))))
+ (license license:expat)))
(define-public go-github-com-mattn-go-pointer
(let ((commit "a0a44394634f41e4992b173b24f14fecd3318a67")
--
2.29.2
J
J
Joseph LaFreniere wrote on 29 Nov 2020 06:08
[PATCH 3/4] gnu: Add go-github-com-tomnomnom-gron.
(address . 44940@debbugs.gnu.org)
20201129050802.47551-2-joseph@lafreniere.xyz
* gnu/packages/golang.scm (go-github-com-tomnomnom-gron): New variable.
---
gnu/packages/golang.scm | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)

Toggle diff (53 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index cb7fe6e3bb..a4f0c80ce9 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -1135,6 +1135,46 @@ Features include:
optimized for performance yet simple to use.")
(license license:expat))))
+(define-public go-github-com-tomnomnom-gron
+ (package
+ (name "go-github-com-tomnomnom-gron")
+ (version "0.6.0")
+ (home-page "https://github.com/tomnomnom/gron")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "05f3w4zr15wd7xk75l12y5kip4gnv719a2x9w2hy23q3pnss9wk0"))))
+ (build-system go-build-system)
+ (arguments
+ (let ((import-path "github.com/tomnomnom/gron"))
+ `(#:import-path ,import-path
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'check 'remove-non-source
+ (lambda _
+ (for-each (lambda (dir)
+ (delete-file-recursively
+ (string-append "src/" ,import-path dir)))
+ '("/docs" "/script" "/testdata"))
+ #t))))))
+ (inputs
+ `(("github.com/fatih/color" ,go-github-com-fatih-color)
+ ("github.com/mattn/go-colorable" ,go-github-com-mattn-go-colorable)
+ ("github.com/mattn/go-isatty" ,go-github-com-mattn-go-isatty)
+ ("github.com/nwidger/jsoncolor" ,go-github-com-nwidger-jsoncolor)
+ ("github.com/pkg/errors" ,go-github-com-pkg-errors)))
+ (synopsis "Transform JSON to make it easier to grep")
+ (description
+ "This package transforms JSON into discrete assignments to make it easier
+to use line-based tools such as grep to search for what you want and see the
+absolute \"path\" to it.")
+ (license license:expat)))
+
(define-public go-github-com-tv42-httpunix
(let ((commit "2ba4b9c3382c77e7b9ea89d00746e6111d142a22")
(revision "0"))
--
2.29.2
J
J
Joseph LaFreniere wrote on 29 Nov 2020 06:08
[PATCH 4/4] gnu: Add gron.
(address . 44940@debbugs.gnu.org)
20201129050802.47551-3-joseph@lafreniere.xyz
* gnu/packages/golang.scm (gron): New variable.
---
gnu/packages/golang.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (15 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index a4f0c80ce9..2b4de0cd4f 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -1175,6 +1175,8 @@ to use line-based tools such as grep to search for what you want and see the
absolute \"path\" to it.")
(license license:expat)))
+(define-public gron go-github-com-tomnomnom-gron)
+
(define-public go-github-com-tv42-httpunix
(let ((commit "2ba4b9c3382c77e7b9ea89d00746e6111d142a22")
(revision "0"))
--
2.29.2
L
L
Ludovic Courtès wrote on 23 Dec 2020 17:07
Re: [bug#44940] [PATCH 2/4] gnu: go-github-com-mattn-go-colorable: Update to 0.1.8.
(name . Joseph LaFreniere)(address . joseph@lafreniere.xyz)(address . 44940-done@debbugs.gnu.org)
878s9owloc.fsf@gnu.org
Hi,

Joseph LaFreniere <joseph@lafreniere.xyz> skribis:

Toggle quote (2 lines)
> * gnu/packages/golang.scm (go-github-com-mattn-go-colorable): Update to 0.1.8.

Applied.

Toggle quote (2 lines)
> * gnu/packages/golang.scm (go-github-com-tomnomnom-gron): New variable.

Applied, but I changed the ‘name’ field to ‘gron’, as is commonly done
for applications.

Toggle quote (2 lines)
> * gnu/packages/golang.scm (gron): New variable.

This patch has no effect; perhaps what you wanted is for the package
name to be ‘gron’, like I did above?

Thanks,
Ludo’.
Closed
J
J
Joseph LaFreniere wrote on 27 Dec 2020 21:20
(name . Ludovic Courtès)(address . ludo@gnu.org)
87czyvuhl4.fsf@lafreniere.xyz
Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (7 lines)
>> * gnu/packages/golang.scm (go-github-com-tomnomnom-gron): New
>> variable.
>
> Applied, but I changed the ‘name’ field to ‘gron’, as is
> commonly done
> for applications.

Noted. I had originally provided the full, Go package-style name
in the event that gron were ever used as a dependency by another
Go package.

Toggle quote (6 lines)
>> * gnu/packages/golang.scm (gron): New variable.
>
> This patch has no effect; perhaps what you wanted is for the
> package
> name to be ‘gron’, like I did above?

Yes, that was my intent.

Thank you for merging!

--
Joseph LaFreniere
Closed
?