diff options
-rw-r--r-- | var/spack/repos/builtin/packages/jq/input.json | 4 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/jq/package.py | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/jq/input.json b/var/spack/repos/builtin/packages/jq/input.json new file mode 100644 index 0000000000..a7dc7fd6dd --- /dev/null +++ b/var/spack/repos/builtin/packages/jq/input.json @@ -0,0 +1,4 @@ +{ + "foo": 1, + "bar": 2 +} diff --git a/var/spack/repos/builtin/packages/jq/package.py b/var/spack/repos/builtin/packages/jq/package.py index a97c6c4b9e..9e9ef3b666 100644 --- a/var/spack/repos/builtin/packages/jq/package.py +++ b/var/spack/repos/builtin/packages/jq/package.py @@ -4,15 +4,25 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * +import os.path class Jq(AutotoolsPackage): """jq is a lightweight and flexible command-line JSON processor.""" homepage = "https://stedolan.github.io/jq/" - url = "https://github.com/stedolan/jq/archive/jq-1.5.tar.gz" + url = "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-1.6.tar.gz" - version('1.5', sha256='d5667641d28c27d0c1e70de83e7f9bd8b2fed7fbf6a1d68731177d400a533c65') + version('1.6', sha256='5de8c8e29aaa3fb9cc6b47bb27299f271354ebb72514e3accadc7d38b5bbaa72') + version('1.5', sha256='c4d2bfec6436341113419debf479d833692cc5cdab7eb0326b5a4d4fbe9f493c') depends_on('oniguruma') depends_on('bison@3.0:', type='build') + + @run_after('install') + @on_package_attributes(run_tests=True) + def installtest(self): + jq = self.spec['jq'].command + f = os.path.join(os.path.dirname(__file__), 'input.json') + + assert jq('.bar', input=f, output=str) == '2\n' |