Paul J. Davis  committed e5248c7

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 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

  • Participants
  • Parent commits 8b27620
  • Branches default

Comments (0)

Files changed (3)

File extra/nspr.pc

+Name: nspr
+Description: nspr library
+Version: 4.8.6
+Libs: -L${libdir} -lplds4 -lplc4 -lnspr4
+Cflags: -I${includedir}/nspr

File spidermonkey/libjs/jsprf.c

 #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]

File tests/

 import t
 import traceback
-ERROR = 'File "<JavaScript>", line 1, in ' \
-        'SyntaxError: missing ) after formal parameters'
 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;")
 def test_invalid_octal(cx):