2012-10-21 22:44:45 +00:00
|
|
|
class Jq < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Lightweight and flexible command-line JSON processor"
|
2015-02-18 14:07:57 +00:00
|
|
|
homepage "https://stedolan.github.io/jq/"
|
|
|
|
url "http://stedolan.github.io/jq/download/source/jq-1.4.tar.gz"
|
|
|
|
sha1 "71da3840839ec74ae65241e182ccd46f6251c43e"
|
2014-06-09 22:48:45 +00:00
|
|
|
|
2015-02-18 14:04:38 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha1 "da645f599da344172de00d756cf6a8ddea86aab5" => :yosemite
|
|
|
|
sha1 "29a8f7971976a860dadf00b5d5660f7887b50df5" => :mavericks
|
|
|
|
sha1 "4c33838662ed6f806ac21db87d433c8722f488a4" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2015-02-18 14:07:57 +00:00
|
|
|
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
|
2015-02-18 14:07:57 +00:00
|
|
|
url "https://github.com/stedolan/jq.git"
|
2012-10-21 22:44:45 +00:00
|
|
|
|
2015-02-18 14:07:57 +00:00
|
|
|
depends_on "oniguruma"
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
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
|