pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/ossp-js Import of OSSP js-1.6.20070208, a portabl...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/40c697e767f7
branches:  trunk
changeset: 538329:40c697e767f7
user:      bjs <bjs%pkgsrc.org@localhost>
date:      Wed Feb 06 04:22:33 2008 +0000

description:
Import of OSSP js-1.6.20070208, a portable, sanitized version of
Mozilla's SpiderMonkey.  I wish I knew about this sooner!  I've tried
this out with elinks, and the javsascript support seems more reliable.

Thanks, OSSP!  I vote for killing spidermonkey once we verify all packages
using it build with this.

Local modifications:

        --Only build fdlibm into libjs if necessary.  This follows
        in the spirit of lang/spidermonkey, though someone with more
        knowledge of this probably will want to change the list of
        platforms in the Makefile.

        --Following the aforementioned change, link the library against
        -lm (and list -lm in js-config, etc.) only if required.

        --Use pkgsrc-provided installation tools instead of shtool.

        --Apply fix for __VA_COPY_USE_CPP.

Blurb (DESCR):


OSSP js is a stand-alone distribution of the JavaScript (JS)
programming language reference implementation from Mozilla -- aka
"JSRef" or "SpiderMonkey". This distribution provides a smart,
stand-alone and portable distribution of Mozilla JavaScript through a
GNU autotools-based build environment.  Additionally,
the C API in "libjs" contains both the JavaScript engine and the
required Sun math library ("fdlibm") and with all internal symbols
carefully protected under the "js" namespace. Finally, a js-config(1)
utility and a pkg-config(1) specification is provided to allow
applications to easily build with the JavaScript C API.

OSSP js was created because for OSSP and similar pedantic C coding
projects a smart, stand-alone, portable, clean, powerful and
robust scripting language engine is required. JavaScript is a
great programming language and Mozilla JavaScript "SpiderMonkey"
definitely is an acceptable clean, powerful and robust implementation.
Unfortunately there is just a stand-alone distribution released from
time to time by Mozilla and it is far away from really being smart,
stand-alone and portable. OSSP js combines the best from two worlds:
the 1:1 repackaged JavaScript code base from Mozilla with the GNU
autotools-based build environment as always used by OSSP.  Additionally,
this package provides stdio-based file object support and does not depend
upon the Mozilla NSPR library.

diffstat:

 lang/ossp-js/DESCR            |  23 ++++++++++++
 lang/ossp-js/Makefile         |  65 ++++++++++++++++++++++++++++++++++++
 lang/ossp-js/PLIST            |  58 ++++++++++++++++++++++++++++++++
 lang/ossp-js/buildlink3.mk    |  22 ++++++++++++
 lang/ossp-js/distinfo         |  10 +++++
 lang/ossp-js/hacks.mk         |  13 +++++++
 lang/ossp-js/patches/patch-aa |  17 +++++++++
 lang/ossp-js/patches/patch-ab |  77 +++++++++++++++++++++++++++++++++++++++++++
 lang/ossp-js/patches/patch-ac |  19 ++++++++++
 lang/ossp-js/patches/patch-ad |  17 +++++++++
 lang/ossp-js/patches/patch-ae |  45 +++++++++++++++++++++++++
 11 files changed, 366 insertions(+), 0 deletions(-)

diffs (truncated from 410 to 300 lines):

diff -r f9606a76bb4b -r 40c697e767f7 lang/ossp-js/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ossp-js/DESCR        Wed Feb 06 04:22:33 2008 +0000
@@ -0,0 +1,23 @@
+OSSP js is a stand-alone distribution of the JavaScript (JS)
+programming language reference implementation from Mozilla -- aka
+"JSRef" or "SpiderMonkey". This distribution provides a smart,
+stand-alone and portable distribution of Mozilla JavaScript through a
+GNU autotools-based build environment.  Additionally,
+the C API in "libjs" contains both the JavaScript engine and the
+required Sun math library ("fdlibm") and with all internal symbols
+carefully protected under the "js" namespace. Finally, a js-config(1)
+utility and a pkg-config(1) specification is provided to allow
+applications to easily build with the JavaScript C API.
+
+OSSP js was created because for OSSP and similar pedantic C coding
+projects a smart, stand-alone, portable, clean, powerful and
+robust scripting language engine is required. JavaScript is a
+great programming language and Mozilla JavaScript "SpiderMonkey"
+definitely is an acceptable clean, powerful and robust implementation.
+Unfortunately there is just a stand-alone distribution released from
+time to time by Mozilla and it is far away from really being smart,
+stand-alone and portable. OSSP js combines the best from two worlds:
+the 1:1 repackaged JavaScript code base from Mozilla with the GNU
+autotools-based build environment as always used by OSSP.  Additionally,
+this package provides stdio-based file object support and does not depend
+upon the Mozilla NSPR library.
diff -r f9606a76bb4b -r 40c697e767f7 lang/ossp-js/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ossp-js/Makefile     Wed Feb 06 04:22:33 2008 +0000
@@ -0,0 +1,65 @@
+# $NetBSD: Makefile,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+#
+
+DISTNAME=      js-1.6.20070208
+PKGNAME=       ossp-${DISTNAME}
+CATEGORIES=    lang
+MASTER_SITES=  ftp://ftp.ossp.org/pkg/lib/js/
+
+MAINTAINER=    bjs%NetBSD.org@localhost
+HOMEPAGE=      ftp://ftp.ossp.org/pkg/lib/js/
+COMMENT=       Sanitized distribution of Mozilla's JavaScript implementation
+
+PKG_DESTDIR_SUPPORT=   user-destdir
+
+###
+### XXX This could be eliminated with buildlinkery, but I do not have time
+###    right now.  You'll probably want to use this package in lieu of
+###    spidermonkey anyway.
+###
+CONFLICTS+=            spidermonkey-[0-9]*
+
+GNU_CONFIGURE=         yes
+USE_LIBTOOL=           yes
+USE_TOOLS+=            pkg-config
+
+PKGCONFIG_OVERRIDE+=   js.pc.in
+
+CONFIGURE_ARGS+=       --with-dso
+CONFIGURE_ARGS+=       --with-editline
+CONFIGURE_ARGS+=       --with-file
+CONFIGURE_ARGS+=       --without-perl
+
+REPLACE_SH=            js-config.sh.in
+
+REPLACE_INTERPRETER+=  js
+REPLACE.js.old=        ./js
+REPLACE.js.new=        ${PREFIX}/bin/js
+REPLACE_FILES.js=      jslint.js jspack.js
+
+.include "../../mk/bsd.prefs.mk"
+
+.if defined(PKG_DEVELOPER)
+CPPFLAGS+=     -Wall
+.endif
+
+###
+### XXX I took this from jslibmath.h.  If this is not correct, please feel
+###    free to change it.  Our lang/spidermonkey package never uses
+###    the Sun math library, and I'm not sure if this is correct.
+###
+JS_FDLIBM_PLATFORMS=   Linux-*-* IRIX-*-* SunOS-*-* \
+                       Solaris-*-* AIX-*-* HPUX-*-*
+
+.if !empty(JS_FDLIBM_PLATFORMS:M${MACHINE_PLATFORM})
+CPPFLAGS+=             -DPKG_FDLIBM_MATH_REQUESTED=1
+MAKE_ENV+=             -DPKG_FDLIBM_MATH_REQUESTED=1
+CONFIGURE_ENV+=                LIBM=""
+.else
+CPPFLAGS+=             -DPKG_FDLIBM_MATH_REQUESTED=0
+CONFIGURE_ENV+=                LIBM="-lm"
+.endif
+
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../devel/readline/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r f9606a76bb4b -r 40c697e767f7 lang/ossp-js/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ossp-js/PLIST        Wed Feb 06 04:22:33 2008 +0000
@@ -0,0 +1,58 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+bin/js
+bin/js-config
+bin/jslint
+bin/jspack
+include/js/jsapi.h
+include/js/jsarena.h
+include/js/jsarray.h
+include/js/jsatom.h
+include/js/jsautocfg.h
+include/js/jsbit.h
+include/js/jsbool.h
+include/js/jsclist.h
+include/js/jscntxt.h
+include/js/jscompat.h
+include/js/jsconfig.h
+include/js/jscpucfg.h
+include/js/jsdate.h
+include/js/jsdbgapi.h
+include/js/jsdhash.h
+include/js/jsdso.h
+include/js/jsdtoa.h
+include/js/jsemit.h
+include/js/jsexn.h
+include/js/jsfile.h
+include/js/jsfun.h
+include/js/jsgc.h
+include/js/jshash.h
+include/js/jsinterp.h
+include/js/jslibmath.h
+include/js/jslock.h
+include/js/jslong.h
+include/js/jsmath.h
+include/js/jsnum.h
+include/js/jsobj.h
+include/js/jsopcode.h
+include/js/jsosdep.h
+include/js/jsotypes.h
+include/js/jsparse.h
+include/js/jsprf.h
+include/js/jsprvtd.h
+include/js/jspubtd.h
+include/js/jsregexp.h
+include/js/jsscan.h
+include/js/jsscope.h
+include/js/jsscript.h
+include/js/jsstddef.h
+include/js/jsstr.h
+include/js/jstypes.h
+include/js/jsutil.h
+include/js/jsxdrapi.h
+include/js/jsxml.h
+lib/libjs.la
+lib/pkgconfig/js.pc
+man/man1/js-config.1
+man/man1/js.1
+man/man3/js.3
+@dirrm include/js
diff -r f9606a76bb4b -r 40c697e767f7 lang/ossp-js/buildlink3.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ossp-js/buildlink3.mk        Wed Feb 06 04:22:33 2008 +0000
@@ -0,0 +1,22 @@
+# $NetBSD: buildlink3.mk,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+BUILDLINK_DEPTH:=      ${BUILDLINK_DEPTH}+
+OSSP_JS_BUILDLINK3_MK:=        ${OSSP_JS_BUILDLINK3_MK}+
+
+.if ${BUILDLINK_DEPTH} == "+"
+BUILDLINK_DEPENDS+=    ossp-js
+.endif
+
+BUILDLINK_PACKAGES:=   ${BUILDLINK_PACKAGES:Nossp-js}
+BUILDLINK_PACKAGES+=   ossp-js
+BUILDLINK_ORDER:=      ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}ossp-js
+
+.if ${OSSP_JS_BUILDLINK3_MK} == "+"
+BUILDLINK_API_DEPENDS.ossp-js+=        ossp-js>=1.6.20070208
+BUILDLINK_PKGSRCDIR.ossp-js?=  ../../lang/ossp-js
+.endif # OSSP_JS_BUILDLINK3_MK
+
+.include "../../devel/readline/buildlink3.mk"
+.include "../../mk/dlopen.buildlink3.mk"
+
+BUILDLINK_DEPTH:=      ${BUILDLINK_DEPTH:S/+$//}
diff -r f9606a76bb4b -r 40c697e767f7 lang/ossp-js/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ossp-js/distinfo     Wed Feb 06 04:22:33 2008 +0000
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+SHA1 (js-1.6.20070208.tar.gz) = 3c8c4b81637b84fa344334a2c0bb093244620d9e
+RMD160 (js-1.6.20070208.tar.gz) = e2e5a1f50026d50caae672bf1122f728991ca377
+Size (js-1.6.20070208.tar.gz) = 1109930 bytes
+SHA1 (patch-aa) = 850e025755cd2f5099a0779b54d9ba1d76fb938b
+SHA1 (patch-ab) = f7e8d00401df8c7f86f2b3c2c342d3869562fe4a
+SHA1 (patch-ac) = cfb32539e82762755090c90fd22978d541edb1d7
+SHA1 (patch-ad) = 9cee1435756bd1d6dec029d81444ec45418a4b18
+SHA1 (patch-ae) = 0a031230be8fc001e510a26d296b5bfdc2a7e1d7
diff -r f9606a76bb4b -r 40c697e767f7 lang/ossp-js/hacks.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ossp-js/hacks.mk     Wed Feb 06 04:22:33 2008 +0000
@@ -0,0 +1,13 @@
+# $NetBSD: hacks.mk,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+.if !defined(OSSP_JS_HACKS_MK)
+OSSP_JS_HACKS_MK=      # defined
+
+.include "../../mk/compiler.mk"
+
+.if !empty(CC_VERSION:Mgcc-[34]*)
+CFLAGS+=       -fno-strict-aliasing
+PKG_HACKS+=    no-strict-aliasing
+.endif
+
+.endif
diff -r f9606a76bb4b -r 40c697e767f7 lang/ossp-js/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ossp-js/patches/patch-aa     Wed Feb 06 04:22:33 2008 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-aa,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+--- src/jslibmath.h.orig       2006-07-23 08:22:18.000000000 -0400
++++ src/jslibmath.h
+@@ -85,11 +85,7 @@
+ 
+ #ifdef OSSP
+ #undef JS_USE_FDLIBM_MATH
+-#if defined(__FreeBSD__)
+-#define JS_USE_FDLIBM_MATH 0
+-#else
+-#define JS_USE_FDLIBM_MATH 1
+-#endif
++#define JS_USE_FDLIBM_MATH PKG_JS_FDLIBM_REQUESTED
+ #endif
+ 
+ #if !JS_USE_FDLIBM_MATH
diff -r f9606a76bb4b -r 40c697e767f7 lang/ossp-js/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ossp-js/patches/patch-ab     Wed Feb 06 04:22:33 2008 +0000
@@ -0,0 +1,77 @@
+$NetBSD: patch-ab,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+--- Makefile.in.orig   2007-02-08 04:25:33.000000000 -0500
++++ Makefile.in
+@@ -95,8 +95,9 @@ LIB_OBJS     = src/jsapi.lo             
+                src/jsxdrapi.lo             \
+                src/jsxml.lo                \
+                src/prmjtime.lo             \
+-               src/jsdso.lo                \
+-               src/fdlibm/e_acos.lo        \
++               src/jsdso.lo                
++.if defined(PKG_FDLIBM_MATH_REQUESTED)
++LIB_OBJS+=     src/fdlibm/e_acos.lo        \
+                src/fdlibm/e_asin.lo        \
+                src/fdlibm/e_atan2.lo       \
+                src/fdlibm/e_exp.lo         \
+@@ -129,6 +130,7 @@ LIB_OBJS     = src/jsapi.lo             
+                src/fdlibm/w_log.lo         \
+                src/fdlibm/w_pow.lo         \
+                src/fdlibm/w_sqrt.lo
++.endif
+ LIB_NAME     = libjs.la
+ 
+ CLI_OBJS     = src/js.o @CLI_OBJS@
+@@ -155,7 +157,7 @@ subdirs:
+       @$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
+ 
+ $(LIB_NAME): $(LIB_OBJS)
+-      @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) -version-info 1:6
++      @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) $(LIBS) -rpath $(libdir) -version-info 1:6
+ 
+ $(CLI_NAME): $(CLI_OBJS) $(LIB_NAME)
+       @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(CLI_LDFLAGS) -o $(CLI_NAME) $(CLI_OBJS) $(LIB_NAME) $(LIBS) $(CLI_LIBS)
+@@ -176,22 +178,27 @@ src/jsopcode.h src/jsopcode.c: src/jsopc
+ 
+ .PHONY: install
+ install: all
+-      $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(prefix)
+-      $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir)
+-      $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1
+-      $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man3
+-      $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(includedir)/js
+-      $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(libdir)/pkgconfig
+-      $(SHTOOL) install -c -m 644 js.1 $(DESTDIR)$(mandir)/man1/
+-      $(SHTOOL) install -c -m 644 js-config.1 $(DESTDIR)$(mandir)/man1/
+-      $(SHTOOL) install -c -m 644 js.3 $(DESTDIR)$(mandir)/man3/
+-      $(SHTOOL) install -c -m 644 src/js*.h $(DESTDIR)$(includedir)/js/
+-      @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(LIB_NAME) $(DESTDIR)$(libdir)/
+-      $(SHTOOL) install -c -m 644 js.pc $(DESTDIR)$(libdir)/pkgconfig/
+-      $(SHTOOL) install -c -m 755 js-config.sh $(DESTDIR)$(bindir)/js-config
+-      @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 755 js $(DESTDIR)$(bindir)/
+-      $(SHTOOL) install -e 's;#!\./js;#!$(bindir)/js;' -c -m 755 jslint.js $(DESTDIR)$(bindir)/jslint
+-      $(SHTOOL) install -e 's;#!\./js;#!$(bindir)/js;' -c -m 755 jspack.js $(DESTDIR)$(bindir)/jspack
++      $(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(prefix)
++      $(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(bindir)
++      $(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(mandir)/man1
++      $(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(mandir)/man3
++      $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(includedir)/js
++      $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(libdir)/pkgconfig
++      $(BSD_INSTALL_MAN) js.1 $(DESTDIR)$(mandir)/man1/



Home | Main Index | Thread Index | Old Index