Skip to content

Commit 6e3d647

Browse files
committed
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
1 parent 00df0a8 commit 6e3d647

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

extra/nspr.pc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
prefix=/usr/local/
2+
exec_prefix=${prefix}
3+
libdir=${exec_prefix}/lib
4+
includedir=${prefix}/include
5+
6+
Name: nspr
7+
Description: nspr library
8+
Version: 4.8.6
9+
Requires:
10+
Conflicts:
11+
Libs: -L${libdir} -lplds4 -lplc4 -lnspr4
12+
Cflags: -I${includedir}/nspr

spidermonkey/libjs/jsprf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
*/
5959
#ifdef HAVE_VA_COPY
6060
#define VARARGS_ASSIGN(foo, bar) VA_COPY(foo,bar)
61+
#elif defined(va_copy)
62+
#define VARARGS_ASSIGN(foo, bar) va_copy(foo,bar)
6163
#elif defined(HAVE_VA_LIST_AS_ARRAY)
6264
#define VARARGS_ASSIGN(foo, bar) foo[0] = bar[0]
6365
#else

tests/test-syntax-error.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,9 @@
55
import t
66
import traceback
77

8-
ERROR = 'File "<JavaScript>", line 1, in ' \
9-
'SyntaxError: missing ) after formal parameters'
10-
118
@t.cx()
129
def test_syntax_error(cx):
13-
try:
14-
cx.execute("function(asdf;")
15-
t.eq(1, 0)
16-
except:
17-
line = traceback.format_exc().split("\n")[-3].strip()
18-
t.eq(line, ERROR)
10+
t.raises(t.JSError, cx.execute, "function(asdf;")
1911

2012
@t.cx()
2113
def test_invalid_octal(cx):

0 commit comments

Comments
 (0)