2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-01 14:17:44 +00:00
|
|
|
|
2011-07-07 18:19:58 +00:00
|
|
|
# Private older version of autoconf required to compile Spidermonkey
|
|
|
|
class Autoconf213 < Formula
|
2011-11-07 17:16:02 +00:00
|
|
|
homepage 'http://www.gnu.org/software/autoconf/'
|
2011-09-12 16:31:30 +00:00
|
|
|
url 'http://ftpmirror.gnu.org/autoconf/autoconf-2.13.tar.gz'
|
2011-11-30 18:56:07 +00:00
|
|
|
mirror 'http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz'
|
2012-09-04 01:59:06 +00:00
|
|
|
sha1 'e4826c8bd85325067818f19b2b2ad2b625da66fc'
|
2011-07-07 18:19:58 +00:00
|
|
|
end
|
|
|
|
|
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
|
|
|
|
2012-03-16 03:23:08 +00:00
|
|
|
# This is terribly, terribly slow the first time.
|
|
|
|
# head 'https://hg.mozilla.org/tracemonkey', :using => :hg
|
|
|
|
head 'https://hg.mozilla.org/tracemonkey/archive/tip.tar.gz', :using => :curl
|
|
|
|
|
2009-12-01 01:02:36 +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
|
2011-04-08 18:16:37 +00:00
|
|
|
# aparently this flag causes the build to fail for ivanvc on 10.5 with a
|
|
|
|
# penryn (core 2 duo) CPU. So lets be cautious here and remove it.
|
2012-09-05 04:04:01 +00:00
|
|
|
ENV['CFLAGS'] = ENV['CFLAGS'].gsub(/-msse[^\s]+/, '') if MacOS.version == :leopard
|
2009-09-01 14:17:44 +00:00
|
|
|
|
2010-06-25 21:32:24 +00:00
|
|
|
# For some reason SpiderMonkey requires Autoconf-2.13
|
2012-05-08 06:11:40 +00:00
|
|
|
ac213_prefix = buildpath/'ac213'
|
2010-06-25 21:32:24 +00:00
|
|
|
Autoconf213.new.brew do |f|
|
2011-07-07 18:19:58 +00:00
|
|
|
# Force use of plain "awk"
|
2010-06-25 21:32:24 +00:00
|
|
|
inreplace 'configure', 'for ac_prog in mawk gawk nawk awk', 'for ac_prog in awk'
|
|
|
|
|
|
|
|
system "./configure", "--disable-debug",
|
|
|
|
"--program-suffix=213",
|
|
|
|
"--prefix=#{ac213_prefix}"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
|
2012-02-21 06:04:21 +00:00
|
|
|
cd "js/src" do
|
2010-06-25 21:32:24 +00:00
|
|
|
system "#{ac213_prefix}/bin/autoconf213"
|
2009-12-17 19:55:27 +00:00
|
|
|
|
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",
|
|
|
|
"--with-system-nspr"
|
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
|
2010-06-25 21:32:24 +00:00
|
|
|
|
2011-07-07 18:19:58 +00:00
|
|
|
def caveats; <<-EOS.undent
|
2011-10-18 10:13:50 +00:00
|
|
|
This formula installs Spidermonkey 1.8.5.
|
2011-07-07 18:19:58 +00:00
|
|
|
If you are trying to compile MongoDB from scratch, you will need 1.7.x instead.
|
|
|
|
EOS
|
|
|
|
end
|
2010-06-25 21:32:24 +00:00
|
|
|
end
|