summaryrefslogtreecommitdiff
path: root/gnu/packages/serialization.scm
diff options
context:
space:
mode:
authorStephen Paul Weber <singpolyma@singpolyma.net>2021-09-26 18:35:12 -0500
committerLudovic Courtès <ludo@gnu.org>2021-10-13 11:48:03 +0200
commit1ec92a0633543f69307dcda8f51d72ca307a32e1 (patch)
tree883eda9fbe3626d87642e16e6dc7cfeb7ba0e926 /gnu/packages/serialization.scm
parent2779763b4076c91e7edc2f2d1e0fc9e97385d159 (diff)
downloadguix-patches-1ec92a0633543f69307dcda8f51d72ca307a32e1.tar
guix-patches-1ec92a0633543f69307dcda8f51d72ca307a32e1.tar.gz
gnu: Add JSON.sh
* gnu/packages/serialization.scm (JSON.sh): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/serialization.scm')
-rw-r--r--gnu/packages/serialization.scm50
1 files changed, 50 insertions, 0 deletions
diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 196141ace8..e24ef973b5 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -34,10 +34,13 @@
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix build-system cmake)
+ #:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
@@ -458,6 +461,53 @@ it a convenient format to store user input files.")
(base32
"1180ln8blrb0mwzpcf78k49hlki6di65q77rsvglf83kfcyh4d7z"))))))
+(define-public json.sh
+ (let ((commit "0d5e5c77365f63809bf6e77ef44a1f34b0e05840") ;no releases
+ (revision "1"))
+ (package
+ (name "json.sh")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/dominictarr/JSON.sh")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "14lxvp5xbdk0dcwkjbdp098z1108j8z48zaibndh4i731kkcz43i"))))
+ (build-system copy-build-system)
+ (arguments
+ `(#:install-plan '(("JSON.sh" "bin/"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'install 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests? (invoke "./all-tests.sh"))
+ #t))
+ (add-after 'install 'wrap-program
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (wrap-program (string-append (assoc-ref outputs "out") "/bin/JSON.sh")
+ `("PATH" ":" prefix
+ (,(string-join
+ (map (lambda (in) (string-append (assoc-ref inputs in) "/bin"))
+ '("grep" "sed"))
+ ":"))))
+ #t)))))
+ (inputs
+ `(("bash-minimal" ,bash-minimal)
+ ("grep" ,grep)
+ ("sed" ,sed)))
+ (synopsis "Pipeable JSON parser written in shell")
+ (description
+ "This package provides a JSON parser written in shell, compatible with
+ash, Bash, Dash and Zsh. Pipe JSON to it, and it traverses the JSON objects
+and prints out the path to the current object (as a JSON array) and then the
+object, without whitespace.")
+ (home-page "https://github.com/dominictarr/JSON.sh")
+ (license (list license:expat license:asl2.0))))) ;dual-licensed
+
(define-public capnproto
(package
(name "capnproto")