From 573df59951429de53e867faf2198c69a0368dc7d Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Wed, 15 Apr 2015 18:40:28 +0100 Subject: casperjs: vendor phantomjs182 Closes #38632 Closes #38681. Signed-off-by: Mike McQuaid --- Library/Formula/casperjs.rb | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'Library') diff --git a/Library/Formula/casperjs.rb b/Library/Formula/casperjs.rb index 6dd9baf01..ecc41e7fd 100644 --- a/Library/Formula/casperjs.rb +++ b/Library/Formula/casperjs.rb @@ -1,22 +1,39 @@ -require 'formula' - class Casperjs < Formula - homepage 'http://www.casperjs.org/' - url 'https://github.com/n1k0/casperjs/archive/1.0.4.tar.gz' - sha1 '4e1bdbf2ce93506b6c0d193c90a6f9bcd58c6254' + homepage "http://www.casperjs.org/" + url "https://github.com/n1k0/casperjs/archive/1.0.4.tar.gz" + sha256 "d71b9dd77ac202f3fbb958f8876f12b89aee2a1b09b2c2c55fd11aa928a1fb1f" devel do - url 'https://github.com/n1k0/casperjs/archive/1.1-beta3.tar.gz' - sha1 'd1c31f6a19c0b636f3e4dc17ffeb8224c8af8aef' - version '1.1-beta3' + url "https://github.com/n1k0/casperjs/archive/1.1-beta3.tar.gz" + sha256 "bc286424fb52df6cf16cb9b8ef6534ee830bb8ab0b87d2625910d8c1824152dc" + version "1.1-beta3" end - head 'https://github.com/n1k0/casperjs.git' + head "https://github.com/n1k0/casperjs.git" + + # For embedded Phantomjs + depends_on :macos => :snow_leopard - depends_on 'phantomjs' + # https://github.com/Homebrew/homebrew/pull/38632 + resource "phantomjs" do + url "https://phantomjs.googlecode.com/files/phantomjs-1.8.2-macosx.zip" + sha256 "7d19c1cce6c66bb3153d335522b4effe68ddd249f427776b82f2662fb5ed81cf" + end def install - libexec.install Dir['*'] - bin.install_symlink libexec+'bin/casperjs' + libexec.install Dir["*"] + (libexec/"phantomjs").install resource("phantomjs") + + (bin/"casperjs").write <<-EOS.undent + #!/bin/bash + export PATH=#{libexec}/phantomjs/bin:$PATH + exec "#{libexec}/bin/casperjs" "$@" + EOS + end + + test do + # Change this test when we're no longer embedding an old PhantomJS + # It exists for now purely to make sure we're using the embedded PhantomJS. + assert_match /version 1.8.2/, shell_output("#{bin}/casperjs") end end -- cgit v1.2.3