homebrew-core/Formula/phantomjs.rb

40 lines
1.1 KiB
Ruby
Raw Normal View History

2014-04-11 14:36:22 +00:00
require "formula"
2011-03-10 05:11:03 +00:00
class Phantomjs < Formula
2014-04-11 14:36:22 +00:00
homepage "http://www.phantomjs.org/"
url "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-source.zip"
sha1 "124b017d493d5ccabd22afaf078d0650ac048840"
2013-09-10 20:40:58 +00:00
bottle do
cellar :any
2014-05-08 12:43:49 +00:00
revision 1
sha1 "3f775a08beeee3c2ec1f491b9621e1ec93ace92a" => :mavericks
sha1 "e3a2b1e5a77afea0b3d8913dfa3f791eee3aab9c" => :mountain_lion
sha1 "273dbe33d1edbdd034c903d919278d33d7ebe5dd" => :lion
end
2014-03-17 02:35:22 +00:00
patch do
2014-04-11 14:36:22 +00:00
url "https://github.com/ariya/phantomjs/commit/fe6a96.diff"
sha1 "d3efd38e0f3f0da08530d0bf603ea72ebdf06b78"
end
def install
2014-05-13 10:12:57 +00:00
inreplace "src/qt/preconfig.sh", "-arch x86", "-arch x86_64" if MacOS.prefer_64_bit?
system "./build.sh", "--confirm", "--jobs", ENV.make_jobs
bin.install "bin/phantomjs"
(share+"phantomjs").install "examples"
end
test do
path = testpath/"test.js"
path.write <<-EOS
2014-05-13 10:12:57 +00:00
console.log("hello");
phantom.exit();
EOS
output = `#{bin}/phantomjs #{path}`.strip
assert_equal "hello", output
assert_equal 0, $?.exitstatus
end
end