From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oEqSKOcDUWGYXAEAgWs5BA (envelope-from ) for ; Mon, 27 Sep 2021 01:36:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SPQhJOcDUWGwHwAAB5/wlQ (envelope-from ) for ; Sun, 26 Sep 2021 23:36:07 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 68CCEB3A1 for ; Mon, 27 Sep 2021 01:36:07 +0200 (CEST) Received: from localhost ([::1]:44500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUdgk-0004SS-JM for larch@yhetil.org; Sun, 26 Sep 2021 19:36:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUdgg-0004SF-MV for guix-patches@gnu.org; Sun, 26 Sep 2021 19:36:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUdgg-0004wE-FU for guix-patches@gnu.org; Sun, 26 Sep 2021 19:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUdgg-0006mC-Ca for guix-patches@gnu.org; Sun, 26 Sep 2021 19:36:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50793] [PATCH v3 1/2] gnu: Add JSON.sh References: <20210925013848.GA2384@singpolyma-beefy.lan> In-Reply-To: <20210925013848.GA2384@singpolyma-beefy.lan> Resent-From: Stephen Paul Weber Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 26 Sep 2021 23:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50793 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50793@debbugs.gnu.org Cc: Stephen Paul Weber , iskarian@mgsn.dev Received: via spool by 50793-submit@debbugs.gnu.org id=B50793.163269932425997 (code B ref 50793); Sun, 26 Sep 2021 23:36:02 +0000 Received: (at 50793) by debbugs.gnu.org; 26 Sep 2021 23:35:24 +0000 Received: from localhost ([127.0.0.1]:38996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUdg3-0006lA-IY for submit@debbugs.gnu.org; Sun, 26 Sep 2021 19:35:23 -0400 Received: from singpolyma.net ([192.99.233.116]:43041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUdg0-0006kt-Qn for 50793@debbugs.gnu.org; Sun, 26 Sep 2021 19:35:21 -0400 Received: by singpolyma.net (Postfix, from userid 1000) id A2429486168B; Sun, 26 Sep 2021 23:35:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=singpolyma.net; s=iweb; t=1632699320; bh=5KLt7LaSb4Z+UElHZbhhyY7lHfT+6SXwCvGIkERU79M=; h=From:To:Cc:Subject:Date:From; b=Ls693d7WV5xSs57jRHqOTPTWmpaTFe8OOQ0NXrvA6InJ+/gcHL8SdGY9J4pjyKV5m uifnfzP+TbywlLb+Bx2aTCITk5m9geEpLJa7GOOXtuG1wMwMl8QckQRT0t9pimFAWg 5gHgnJypJLXVRtRxHmxtOXbgiNlp3mXuS0/FsjoI= From: Stephen Paul Weber Date: Sun, 26 Sep 2021 18:35:12 -0500 Message-Id: <20210926233513.3710-1-singpolyma@singpolyma.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632699367; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Om4fX3kWCQZixiZ8pJI7wJXxEhvRHI4m4A2iJBKRojc=; b=dKzRYWg2R6+YWs1fiVekTCBCCxa9czRy1VoegpblBEZnX+swyoE9UfyoDXSLeos2EkUsWa M7UMZ+LW2Epj9w/JrYRb3ia/qPg+pij15cGrsP7CZ3xi3EMfodddPfbjxu63BWreCwpYTJ /wltPnVikeuKm2hNKvxGhTMon4FjOnicPA5btrtFKPHMIlUzpk4BhSule0rCF2nRF1p1Rg P6fa5uqye09yIk/Pc/xnNEKPjnyFjqnjN4xQravkt5F9FWlOFdO6O8a7gG86Ok5c1m3NU3 UAiRIhaMorcAyNzswSRLRDnycUeOx5pcjINSvlC1P0kqoqOmzE+nYrUnSEq6Hw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632699367; a=rsa-sha256; cv=none; b=Mo7x5v8t0SYESgew6jZLEA+bB4zUABcXcic2jTf4PniYDf3bbom5IpCrLrYi4+yULnFXO/ To94WPYTJdRmTDmizXZpMcdf3xEyHhBQ7v9SPyHtwTrG79wcpB/B+2CYjt0YCzIsqtMDTa QDGlFikBdI+ck1dNI94R0IPGeEA/KVVM+DgkmHIMMje4O7sHAOLE0zwlrQ9+G9n2a5XMF9 i8AAXULvNAPrq1Z+nQd6DgD4G+aghm2Tc8EJRO4SPqVNl0RWCxymGsdZZJdetj6YuvzYsv 5ZWu/8cWlJPF3qnYKjyFSh7U40hP9jQPDoMFJkONjsuPA3FW08bqFL71VAlQtQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=singpolyma.net header.s=iweb header.b=Ls693d7W; dmarc=fail reason="SPF not aligned (strict)" header.from=singpolyma.net (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.71 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=singpolyma.net header.s=iweb header.b=Ls693d7W; dmarc=fail reason="SPF not aligned (strict)" header.from=singpolyma.net (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 68CCEB3A1 X-Spam-Score: 3.71 X-Migadu-Scanner: scn0.migadu.com X-TUID: fiQzkV8OS0YG * gnu/packages/serialization.scm (JSON.sh): New variable. --- gnu/packages/serialization.scm | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm index 196141ace8..07ce5f2537 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") + (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 + "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))))) + (define-public capnproto (package (name "capnproto") -- 2.20.1