homebrew-core/Formula/jq.rb

37 lines
1.1 KiB
Ruby
Raw Normal View History

class Jq < Formula
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"
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
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"
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
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"
end
test do
2014-05-04 19:12:41 +00:00
assert_equal "2\n", pipe_output("#{bin}/jq .bar", '{"foo":1, "bar":2}')
end
end