Skip to content
Browse files

Make this build on 10.6

I had to do some hackery to get this building on 10.6 with Homebrew. I
mostly hacked together a fake nspr.pc and dropped it in [1] so that
the pkgconfig stuff in setup.py would work. There's a copy of this
file in the "extra" directory in this repo. I also added a patch
for the va_copy like MacPorts does.

If anyone would like to tear out the embedded copy of Spidermonkey
that this package ships with and update the build system to use
either what Homebrew installs or is found in the xulrunner package
on Ubuntu, that would be awesome.

[1] /usr/local/lib/pkgconfig/nspr.c
  • Loading branch information...
1 parent 00df0a8 commit 6e3d647f7b04e5ea325d28d2e00fda5df40ea72c @davisp committed Feb 15, 2011
Showing with 15 additions and 9 deletions.
  1. +12 −0 extra/nspr.pc
  2. +2 −0 spidermonkey/libjs/jsprf.c
  3. +1 −9 tests/test-syntax-error.py
View
12 extra/nspr.pc
@@ -0,0 +1,12 @@
+prefix=/usr/local/
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: nspr
+Description: nspr library
+Version: 4.8.6
+Requires:
+Conflicts:
+Libs: -L${libdir} -lplds4 -lplc4 -lnspr4
+Cflags: -I${includedir}/nspr
View
2 spidermonkey/libjs/jsprf.c
@@ -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
View
10 tests/test-syntax-error.py
@@ -5,17 +5,9 @@
import t
import traceback
-ERROR = 'File "<JavaScript>", line 1, in ' \
- 'SyntaxError: missing ) after formal parameters'
-
@t.cx()
def test_syntax_error(cx):
- try:
- cx.execute("function(asdf;")
- t.eq(1, 0)
- except:
- line = traceback.format_exc().split("\n")[-3].strip()
- t.eq(line, ERROR)
+ t.raises(t.JSError, cx.execute, "function(asdf;")
@t.cx()
def test_invalid_octal(cx):

0 comments on commit 6e3d647

Please sign in to comment.
Something went wrong with that request. Please try again.