homebrew-core/Formula/jq.rb

33 lines
728 B
Ruby
Raw Normal View History

require 'formula'
class Jq < Formula
2013-04-07 02:34:41 +00:00
homepage 'http://stedolan.github.io/jq/'
url 'http://stedolan.github.io/jq/download/source/jq-1.3.tar.gz'
sha1 'ac1f19e5d9921683af25251e97c2c4bfee895ca2'
2013-10-28 09:26:44 +00:00
head do
url 'https://github.com/stedolan/jq.git'
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
depends_on 'bison' => :build
end
def install
2013-11-13 17:27:49 +00:00
system "autoreconf", "-iv" if build.head?
system "./configure"
system "make"
bin.install 'jq'
man1.install 'jq.1'
end
test do
IO.popen("#{bin}/jq .bar", "w+") do |pipe|
pipe.puts '{"foo":1, "bar":2}'
pipe.close_write
assert_equal "2\n", pipe.read
end
end
end