2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-01 14:17:44 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Spidermonkey < Formula
|
2009-10-04 14:43:04 +00:00
|
|
|
homepage 'https://developer.mozilla.org/en/SpiderMonkey'
|
2011-10-18 10:13:50 +00:00
|
|
|
url 'http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz'
|
|
|
|
version '1.8.5'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '52a01449c48d7a117b35f213d3e4263578d846d6'
|
2009-09-01 14:17:44 +00:00
|
|
|
|
2013-05-28 05:32:27 +00:00
|
|
|
head 'https://hg.mozilla.org/tracemonkey/archive/tip.tar.gz'
|
2012-03-16 03:23:08 +00:00
|
|
|
|
2014-06-09 16:05:57 +00:00
|
|
|
bottle do
|
|
|
|
sha1 "c23bfeffb2cdfba00957c13444d123a6de5ac42c" => :mavericks
|
|
|
|
sha1 "cfb242ee6fa552a68036f5a736abb805359453e4" => :mountain_lion
|
|
|
|
sha1 "2a4e8a21f64c3516782e8ab649962e4b215d37a8" => :lion
|
|
|
|
end
|
|
|
|
|
2013-11-06 06:09:48 +00:00
|
|
|
conflicts_with 'narwhal', :because => 'both install a js binary'
|
|
|
|
|
2012-11-11 03:12:26 +00:00
|
|
|
depends_on 'readline'
|
2010-01-23 21:38:59 +00:00
|
|
|
depends_on 'nspr'
|
2009-09-01 14:17:44 +00:00
|
|
|
|
|
|
|
def install
|
2012-02-21 06:04:21 +00:00
|
|
|
cd "js/src" do
|
2010-06-25 21:32:24 +00:00
|
|
|
# Remove the broken *(for anyone but FF) install_name
|
2009-12-17 19:55:27 +00:00
|
|
|
inreplace "config/rules.mk",
|
2010-11-09 15:45:09 +00:00
|
|
|
"-install_name @executable_path/$(SHARED_LIBRARY) ",
|
2009-12-17 19:55:27 +00:00
|
|
|
"-install_name #{lib}/$(SHARED_LIBRARY) "
|
2010-06-25 21:32:24 +00:00
|
|
|
end
|
|
|
|
|
2012-02-22 04:48:36 +00:00
|
|
|
mkdir "brew-build" do
|
2010-06-25 21:32:24 +00:00
|
|
|
system "../js/src/configure", "--prefix=#{prefix}",
|
|
|
|
"--enable-readline",
|
|
|
|
"--enable-threadsafe",
|
2013-11-11 05:56:31 +00:00
|
|
|
"--with-system-nspr",
|
|
|
|
"--enable-macos-target=#{MacOS.version}"
|
2009-12-01 01:02:36 +00:00
|
|
|
|
2010-06-25 21:32:24 +00:00
|
|
|
inreplace "js-config", /JS_CONFIG_LIBS=.*?$/, "JS_CONFIG_LIBS=''"
|
2011-07-07 18:19:58 +00:00
|
|
|
# These need to be in separate steps.
|
2009-12-01 01:02:36 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
|
2011-07-07 18:19:58 +00:00
|
|
|
# Also install js REPL.
|
2009-12-01 01:02:36 +00:00
|
|
|
bin.install "shell/js"
|
|
|
|
end
|
|
|
|
end
|
2014-02-18 00:12:53 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
path = testpath/"test.js"
|
|
|
|
path.write "print('hello');"
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "hello", shell_output("#{bin}/js #{path}").strip
|
2014-02-18 00:12:53 +00:00
|
|
|
end
|
2010-06-25 21:32:24 +00:00
|
|
|
end
|