From ccc11345c945e4cd8c568e17428542d8b0d38f26 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 20 May 2013 11:17:20 +0400 Subject: [PATCH] Adding jq JSON processor --- .../upstream-updater/urls-from-page.sh | 2 +- pkgs/development/tools/jq/default.nix | 28 +++++++++++++++++++ pkgs/development/tools/jq/default.upstream | 1 + pkgs/top-level/all-packages.nix | 2 ++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/tools/jq/default.nix create mode 100644 pkgs/development/tools/jq/default.upstream diff --git a/pkgs/build-support/upstream-updater/urls-from-page.sh b/pkgs/build-support/upstream-updater/urls-from-page.sh index 3c494114e914..d456794a563d 100755 --- a/pkgs/build-support/upstream-updater/urls-from-page.sh +++ b/pkgs/build-support/upstream-updater/urls-from-page.sh @@ -9,6 +9,6 @@ relpath="${path#$server}" echo "URL: $url" >&2 -curl -L -k "$url" | sed -re 's/^/-/;s/[hH][rR][eE][fF]=("([^"]*)"|([^" <>&]+)[ <>&])/\n+\2\3\n-/g' | \ +curl -L -k "$url" | sed -re 's/^/-/;s/[hH][rR][eE][fF]=("([^"]*)"|'\''([^'\'']*)'\''|([^"'\'' <>&]+)[ <>&])/\n+\2\3\4\n-/g' | \ sed -e '/^-/d; s/^[+]//; /^#/d;'"s/^\\//$protocol:\\/\\/$server\\//g" | \ sed -re 's`^[^:]*$`'"$protocol://$basepath/&\`" diff --git a/pkgs/development/tools/jq/default.nix b/pkgs/development/tools/jq/default.nix new file mode 100644 index 000000000000..f0c32fc0e9ec --- /dev/null +++ b/pkgs/development/tools/jq/default.nix @@ -0,0 +1,28 @@ +{stdenv, fetchurl}: +let + s = # Generated upstream information + rec { + baseName="jq"; + version="1.3"; + name="${baseName}-${version}"; + hash="1mzy9cj3d19y1m56mwk6slls543gnlhz8302hmnxkhdzdb1j6gv2"; + url="http://stedolan.github.io/jq/download/source/jq-1.3.tar.gz"; + sha256="1mzy9cj3d19y1m56mwk6slls543gnlhz8302hmnxkhdzdb1j6gv2"; + }; + buildInputs = [ + ]; +in +stdenv.mkDerivation { + inherit (s) name version; + inherit buildInputs; + src = fetchurl { + inherit (s) url sha256; + }; + meta = { + inherit (s) version; + description = ''A lightweight and flexible command-line JSON processor''; + license = stdenv.lib.licenses.mit ; + maintainers = [stdenv.lib.maintainers.raskin]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/development/tools/jq/default.upstream b/pkgs/development/tools/jq/default.upstream new file mode 100644 index 000000000000..1ad914d717e0 --- /dev/null +++ b/pkgs/development/tools/jq/default.upstream @@ -0,0 +1 @@ +url http://stedolan.github.io/jq/download/ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e6e7f80788a2..8ed2c9dd08d2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1046,6 +1046,8 @@ let jnettop = callPackage ../tools/networking/jnettop { }; + jq = callPackage ../development/tools/jq {}; + jscoverage = callPackage ../development/tools/misc/jscoverage { }; jwhois = callPackage ../tools/networking/jwhois { };