aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/spidermonkey.rb86
1 files changed, 39 insertions, 47 deletions
diff --git a/Library/Formula/spidermonkey.rb b/Library/Formula/spidermonkey.rb
index 20468d714..962fac587 100644
--- a/Library/Formula/spidermonkey.rb
+++ b/Library/Formula/spidermonkey.rb
@@ -1,58 +1,50 @@
require 'formula'
class Spidermonkey <Formula
- url "http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz"
+ # 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'
+
homepage 'https://developer.mozilla.org/en/SpiderMonkey'
- md5 '5571134c3863686b623ebe4e6b1f6fe6'
- depends_on 'readline'
+ head 'hg://http://hg.mozilla.org/tracemonkey'
- def patches
- DATA
- end
+ depends_on 'readline'
+ depends_on 'autoconf213'
def install
- ENV.j1
-
- # Spidermonkey hardsets the CC and CCC environment variables to cc and g++
- # but homebrew uses compiler flags that aren't available in Apple's default cc (version 4.0.1)
- # instead use the compilers chosen by homebrew and set in the CC and CXX environment variables
- inreplace "src/config/Darwin.mk", 'CC = cc', "CC = #{ENV['CC']}"
- inreplace "src/config/Darwin.mk", 'CCC = g++', "CCC = #{ENV['CXX']}"
-
- # 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.
- ENV['CFLAGS'] = ENV['CFLAGS'].gsub(/-msse[^\s]+/, '')
-
- Dir.chdir "src" do
- system "make JS_DIST='#{prefix}' DEFINES=-DJS_C_STRINGS_ARE_UTF8 -f Makefile.ref"
- system "make JS_DIST='#{prefix}' -f Makefile.ref export"
- system "ranlib #{lib}/libjs.a"
+
+ 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]+/, '')
end
- end
-end
+ Dir.chdir "js/src" do
+ system "autoconf213"
+ # Remove the broken *(for anyone but FF) install_name
+ inreplace "config/rules.mk", "-install_name @executable_path/$(SHARED_LIBRARY) ", ""
+ end
-__END__
---- a/src/jsprf.c 2009-07-26 12:32:01.000000000 -0700
-+++ b/src/jsprf.c 2009-07-26 12:33:12.000000000 -0700
-@@ -58,6 +58,8 @@
- */
- #ifdef HAVE_VA_COPY
- #define VARARGS_ASSIGN(foo, bar) VA_COPY(foo,bar)
-+#elif defined(va_copy)
-+#define VARARGS_ASSIGN(foo, bar) va_copy(foo,bar)
- #elif defined(HAVE_VA_LIST_AS_ARRAY)
- #define VARARGS_ASSIGN(foo, bar) foo[0] = bar[0]
- #else
-
---- a/src/rules.mk 2006-07-06 22:12:02.000000000 -0400
-+++ b/src/rules.mk 2009-10-16 00:12:09.000000000 -0400
-@@ -115,7 +115,7 @@
- $(RANLIB) $@
-
- $(SHARED_LIBRARY): $(LIB_OBJS)
-- $(MKSHLIB) -o $@ $(LIB_OBJS) $(LDFLAGS) $(OTHER_LIBS)
-+ $(MKSHLIB) -o $@ $(LIB_OBJS) $(LDFLAGS) $(OTHER_LIBS) -install_name $(JS_DIST)/lib/$(notdir $@)
- endif
- endif
+ FileUtils.mkdir "brew-build";
+
+ Dir.chdir "brew-build" do
+ system "../js/src/configure", "--prefix=#{prefix}",
+ "--enable-readline"
+
+ 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