2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-01 14:17:44 +00:00
|
|
|
|
|
|
|
class Spidermonkey <Formula
|
2009-12-01 01:02:36 +00:00
|
|
|
# There are no proper releases of spidermonkey. So pick a specific/constant
|
|
|
|
# revision: r35345
|
|
|
|
url 'http://hg.mozilla.org/tracemonkey/archive/57a6ad20eae9.tar.gz'
|
|
|
|
md5 '4a143399f69d6509bd980073096af6d4'
|
|
|
|
|
|
|
|
version '1.9.2'
|
|
|
|
|
2009-10-04 14:43:04 +00:00
|
|
|
homepage 'https://developer.mozilla.org/en/SpiderMonkey'
|
2009-09-01 14:17:44 +00:00
|
|
|
|
2009-12-01 01:02:36 +00:00
|
|
|
head 'hg://http://hg.mozilla.org/tracemonkey'
|
2009-09-01 14:17:44 +00:00
|
|
|
|
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
|
2009-12-01 01:02:36 +00:00
|
|
|
if MACOS_VERSION == 10.5
|
|
|
|
# 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.
|
|
|
|
# It might not be need with newer spidermonkeys anymore tho.
|
|
|
|
ENV['CFLAGS'] = ENV['CFLAGS'].gsub(/-msse[^\s]+/, '')
|
2009-09-01 14:17:44 +00:00
|
|
|
end
|
|
|
|
|
2010-02-23 15:40:02 +00:00
|
|
|
# For some reason SpiderMonkey requires Autoconf-2.13
|
|
|
|
ac213_prefix = Pathname.pwd.join('ac213').to_s
|
|
|
|
Autoconf213.new.brew do |f|
|
|
|
|
# probably no longer required, see issue #751
|
|
|
|
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
|
|
|
|
|
2009-12-01 01:02:36 +00:00
|
|
|
Dir.chdir "js/src" do
|
2010-01-23 21:38:59 +00:00
|
|
|
# Fixes a bug with linking against CoreFoundation. Tests all pass after
|
|
|
|
# building like this. See: http://openradar.appspot.com/7209349
|
|
|
|
inreplace "configure.in", "LDFLAGS=\"$LDFLAGS -framework Cocoa\"", ""
|
2010-02-23 15:40:02 +00:00
|
|
|
system "#{ac213_prefix}/bin/autoconf213"
|
2009-12-01 01:02:36 +00:00
|
|
|
# Remove the broken *(for anyone but FF) install_name
|
|
|
|
inreplace "config/rules.mk", "-install_name @executable_path/$(SHARED_LIBRARY) ", ""
|
|
|
|
end
|
2009-09-15 18:05:24 +00:00
|
|
|
|
2009-12-01 01:02:36 +00:00
|
|
|
FileUtils.mkdir "brew-build";
|
|
|
|
|
|
|
|
Dir.chdir "brew-build" do
|
|
|
|
system "../js/src/configure", "--prefix=#{prefix}",
|
2010-01-23 21:38:59 +00:00
|
|
|
"--enable-readline",
|
|
|
|
"--enable-threadsafe",
|
|
|
|
"--with-system-nspr"
|
2009-12-01 01:02:36 +00:00
|
|
|
|
|
|
|
inreplace "js-config", /JS_CONFIG_LIBS=.*?$/, "JS_CONFIG_LIBS=''"
|
|
|
|
|
|
|
|
# Can't do `make install` right off the bat sadly
|
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
|
|
|
|
# The `js` binary ins't installed. Lets do that too, eh?
|
|
|
|
bin.install "shell/js"
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
2010-02-23 15:40:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Autoconf213 <Formula
|
|
|
|
url 'http://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.13.tar.gz'
|
|
|
|
md5 '9de56d4a161a723228220b0f425dc711'
|
|
|
|
homepage 'http://www.gnu.org/software/autoconf/'
|
|
|
|
end
|