2012-10-21 22:44:45 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Jq < Formula
|
2013-04-07 02:34:41 +00:00
|
|
|
homepage 'http://stedolan.github.io/jq/'
|
2014-06-09 22:48:45 +00:00
|
|
|
url 'http://stedolan.github.io/jq/download/source/jq-1.4.tar.gz'
|
|
|
|
sha1 '71da3840839ec74ae65241e182ccd46f6251c43e'
|
|
|
|
|
|
|
|
depends_on 'bison' => :build # jq depends on bison > 2.5
|
2012-12-29 18:31:54 +00:00
|
|
|
|
2013-10-28 09:26:44 +00:00
|
|
|
head do
|
|
|
|
url 'https://github.com/stedolan/jq.git'
|
2012-10-21 22:44:45 +00:00
|
|
|
|
2014-06-19 02:20:36 +00:00
|
|
|
depends_on 'oniguruma'
|
2013-10-28 09:26:44 +00:00
|
|
|
depends_on 'autoconf' => :build
|
|
|
|
depends_on 'automake' => :build
|
2013-11-13 17:27:49 +00:00
|
|
|
depends_on 'libtool' => :build
|
2013-10-28 09:26:44 +00:00
|
|
|
end
|
2013-10-19 01:31:10 +00:00
|
|
|
|
2012-10-21 22:44:45 +00:00
|
|
|
def install
|
2013-11-13 17:27:49 +00:00
|
|
|
system "autoreconf", "-iv" if build.head?
|
2014-06-10 06:19:03 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--disable-silent-rules",
|
|
|
|
"--prefix=#{prefix}"
|
|
|
|
system "make", "install"
|
2012-10-21 22:44:45 +00:00
|
|
|
end
|
2014-02-13 21:02:19 +00:00
|
|
|
|
|
|
|
test do
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "2\n", pipe_output("#{bin}/jq .bar", '{"foo":1, "bar":2}')
|
2014-02-13 21:02:19 +00:00
|
|
|
end
|
2012-10-21 22:44:45 +00:00
|
|
|
end
|