pkgsrc-WIP-changes archive

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

Add quickjs, a Javascript Engine, version 2019-07-09.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Fri Jul 12 13:51:12 2019 +0200
Changeset:	7316032d7bd20107f116da94de57b546449ee9e5

Added Files:
	quickjs/DESCR
	quickjs/Makefile
	quickjs/PLIST
	quickjs/distinfo
	quickjs/patches/patch-Makefile
	quickjs/patches/patch-cutils.h
	quickjs/patches/patch-qjs.c
	quickjs/patches/patch-qjsc.c
	quickjs/patches/patch-quickjs-libc.c
	quickjs/patches/patch-quickjs.c

Log Message:
Add quickjs, a Javascript Engine, version 2019-07-09.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=7316032d7bd20107f116da94de57b546449ee9e5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 quickjs/DESCR                        | 26 ++++++++++++++++
 quickjs/Makefile                     | 23 ++++++++++++++
 quickjs/PLIST                        | 10 ++++++
 quickjs/distinfo                     | 12 ++++++++
 quickjs/patches/patch-Makefile       | 60 ++++++++++++++++++++++++++++++++++++
 quickjs/patches/patch-cutils.h       | 22 +++++++++++++
 quickjs/patches/patch-qjs.c          | 24 +++++++++++++++
 quickjs/patches/patch-qjsc.c         | 16 ++++++++++
 quickjs/patches/patch-quickjs-libc.c | 24 +++++++++++++++
 quickjs/patches/patch-quickjs.c      | 24 +++++++++++++++
 10 files changed, 241 insertions(+)

diffs:
diff --git a/quickjs/DESCR b/quickjs/DESCR
new file mode 100644
index 0000000000..44d05e7a2c
--- /dev/null
+++ b/quickjs/DESCR
@@ -0,0 +1,26 @@
+QuickJS is a small and embeddable Javascript engine. It supports
+the ES2019 specification including modules, asynchronous generators
+and proxies.
+
+It optionally supports mathematical extensions such as big integers
+(BigInt), big floating point numbers (BigFloat) and operator
+overloading.
+
+Main Features:
+ * Small and easily embeddable: just a few C files, no external
+   dependency, 190 KiB of x86 code for a simple hello world program.
+ * Fast interpreter with very low startup time: runs the 56000
+   tests of the ECMAScript Test Suite in about 100 seconds on a
+   single core of a desktop PC. The complete life cycle of a runtime
+   instance completes in less than 300 microseconds.
+ * Almost complete ES2019 support including modules, asynchronous
+   generators and full Annex B support (legacy web compatibility).
+ * Passes 100% of the ECMAScript Test Suite.
+ * Can compile Javascript sources to executables with no external dependency.
+ * Garbage collection using reference counting (to reduce memory
+   usage and have deterministic behavior) with cycle removal.
+ * Mathematical extensions: BigInt, BigFloat, operator overloading,
+   bigint mode, math mode.
+ * Command line interpreter with contextual colorization implemented
+   in Javascript.
+ * Small built-in standard library with C library wrappers.
diff --git a/quickjs/Makefile b/quickjs/Makefile
new file mode 100644
index 0000000000..05c2e6db1f
--- /dev/null
+++ b/quickjs/Makefile
@@ -0,0 +1,23 @@
+# $NetBSD$
+#
+
+DISTNAME=	quickjs-2019-07-09
+CATEGORIES=	lang
+MASTER_SITES=	https://bellard.org/quickjs/
+EXTRACT_SUFX=	.tar.xz
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://bellard.org/quickjs/
+COMMENT=	Small and embeddable Javascript engine
+
+LICENSE=	mit
+USE_TOOLS=	gmake
+
+INSTALLATION_DIRS+=	bin lib include/quickjs
+
+post-extract:
+	cd ${WRKSRC}; \
+	${SED} -e 's:^prefix=.*:prefix='${PREFIX}':' <Makefile >Makefile.new; \
+	mv Makefile.new Makefile
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/quickjs/PLIST b/quickjs/PLIST
new file mode 100644
index 0000000000..47c14d6961
--- /dev/null
+++ b/quickjs/PLIST
@@ -0,0 +1,10 @@
+@comment $NetBSD$
+bin/qjs
+bin/qjsbn
+bin/qjsbnc
+bin/qjsc
+bin/qjscalc
+include/quickjs/quickjs-libc.h
+include/quickjs/quickjs.h
+lib/quickjs/libquickjs.a
+lib/quickjs/libquickjs.bn.a
diff --git a/quickjs/distinfo b/quickjs/distinfo
new file mode 100644
index 0000000000..c65b100757
--- /dev/null
+++ b/quickjs/distinfo
@@ -0,0 +1,12 @@
+$NetBSD$
+
+SHA1 (quickjs-2019-07-09.tar.xz) = f225a1815a462f2613390d3d98c66575f519d133
+RMD160 (quickjs-2019-07-09.tar.xz) = 63f444e699a25b3d5b7c0870778843cad352cd13
+SHA512 (quickjs-2019-07-09.tar.xz) = db2498659ae1c22e5c0a24e0f2d582db6003e18a182a80f407b1ee8779edddff473572bcfecd1584281c65af8c428b2794d1c7aae90ec87e4338f7bbd9a61b7c
+Size (quickjs-2019-07-09.tar.xz) = 737248 bytes
+SHA1 (patch-Makefile) = 8c85191708cb69dafab41603a5580cdfe8c671e9
+SHA1 (patch-cutils.h) = 12990379aca9ce0e13bca8674324cbbf3cf50376
+SHA1 (patch-qjs.c) = d6d11d6b72d8136030d578e4dd3449f6b65dca12
+SHA1 (patch-qjsc.c) = 836eef33eb510d2259098441992c43e68a5bf2bf
+SHA1 (patch-quickjs-libc.c) = a8158a940f5ad4ca0622c8ce074d0e0277adbf13
+SHA1 (patch-quickjs.c) = ac883115313e7bd6e2391acc304ac3e477012f3f
diff --git a/quickjs/patches/patch-Makefile b/quickjs/patches/patch-Makefile
new file mode 100644
index 0000000000..6181aeda57
--- /dev/null
+++ b/quickjs/patches/patch-Makefile
@@ -0,0 +1,60 @@
+$NetBSD$
+
+Adapt for NetBSD & pkgsrc.
+
+--- Makefile.orig	2019-07-12 10:37:48.098876640 +0000
++++ Makefile
+@@ -25,10 +25,17 @@
+ ifeq ($(shell uname -s),Darwin)
+ CONFIG_DARWIN=y
+ endif
++ifeq ($(shell uname -s),NetBSD)
++CONFIG_NETBSD=y
++endif
+ # Windows cross compilation from Linux
+ #CONFIG_WIN32=y
+ # use link time optimization (smaller and faster executables but slower build)
+ CONFIG_LTO=y
++# Skip this for now, to support gcc5 without gcc-ar
++ifdef CONFIG_NETBSD
++CONFIG_LTO=
++endif
+ # consider warnings as errors (for development)
+ #CONFIG_WERROR=y
+ 
+@@ -150,8 +157,10 @@ QJSBN_OBJS=$(OBJDIR)/qjs.bn.o $(OBJDIR)/
+ 
+ LIBS=-lm
+ ifndef CONFIG_WIN32
++ifndef CONFIG_NETBSD
+ LIBS+=-ldl
+ endif
++endif
+ 
+ $(OBJDIR):
+ 	mkdir -p $(OBJDIR)
+@@ -300,16 +309,16 @@ clean:
+ 	rm -rf run-test262-debug run-test262-32 run-test262-bn32
+ 
+ install: all
+-	mkdir -p "$(prefix)/bin"
+-	install -m755 -s qjs qjsc qjsbn qjsbnc "$(prefix)/bin"
+-	ln -sf qjsbn "$(prefix)/bin/qjscalc"
+-	mkdir -p "$(prefix)/lib/quickjs"
+-	install -m755 libquickjs.a libquickjs.bn.a "$(prefix)/lib/quickjs"
++	mkdir -p "${DESTDIR}$(prefix)/bin"
++	install -m755 -s qjs qjsc qjsbn qjsbnc "${DESTDIR}$(prefix)/bin"
++	ln -sf qjsbn "${DESTDIR}$(prefix)/bin/qjscalc"
++	mkdir -p "${DESTDIR}$(prefix)/lib/quickjs"
++	install -m755 libquickjs.a libquickjs.bn.a "${DESTDIR}$(prefix)/lib/quickjs"
+ ifdef CONFIG_LTO
+-	install -m755 libquickjs.lto.a libquickjs.bn.lto.a "$(prefix)/lib/quickjs"
++	install -m755 libquickjs.lto.a libquickjs.bn.lto.a "${DESTDIR}$(prefix)/lib/quickjs"
+ endif
+-	mkdir -p "$(prefix)/include/quickjs"
+-	install -m755 quickjs.h quickjs-libc.h "$(prefix)/include/quickjs"
++	mkdir -p "${DESTDIR}$(prefix)/include/quickjs"
++	install -m755 quickjs.h quickjs-libc.h "${DESTDIR}$(prefix)/include/quickjs"
+ 
+ 
+ ###############################################################################
diff --git a/quickjs/patches/patch-cutils.h b/quickjs/patches/patch-cutils.h
new file mode 100644
index 0000000000..c64517f4f2
--- /dev/null
+++ b/quickjs/patches/patch-cutils.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+Adapt to NetBSD.
+
+--- cutils.h.orig 2019-07-09 19:49:47.000000000 +0200
++++ cutils.h     2019-07-12 00:50:00.924951444 +0200
+@@ -206,6 +206,7 @@
+     *tab = val;
+ }
+ 
++#ifndef __NetBSD__
+ static inline uint16_t bswap16(uint16_t x)
+ {
+     return (x >> 8) | (x << 8);
+@@ -228,6 +229,7 @@
+         ((v & ((uint64_t)0xff << (1 * 8))) << (5 * 8)) | 
+         ((v & ((uint64_t)0xff << (0 * 8))) << (7 * 8));
+ }
++#endif /* __NetBSD__ */
+ 
+ /* XXX: should take an extra argument to pass slack information to the caller */
+ typedef void *DynBufReallocFunc(void *opaque, void *ptr, size_t size);
diff --git a/quickjs/patches/patch-qjs.c b/quickjs/patches/patch-qjs.c
new file mode 100644
index 0000000000..ba4f6eb547
--- /dev/null
+++ b/quickjs/patches/patch-qjs.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Adapt to NetBSD.
+
+--- qjs.c.orig    2019-07-09 19:49:47.000000000 +0200
++++ qjs.c        2019-07-12 01:26:13.323925295 +0200
+@@ -108,6 +108,8 @@
+     return 0;
+ #elif defined(__linux__)
+     return malloc_usable_size(ptr);
++#elif defined(__NetBSD__)
++    return 0;
+ #else
+     /* change this to `return 0;` if compilation fails */
+     return malloc_usable_size(ptr);
+@@ -224,6 +226,8 @@
+     NULL,
+ #elif defined(__linux__)
+     (size_t (*)(const void *))malloc_usable_size,
++#elif defined(__NetBSD__)
++    NULL,
+ #else
+     /* change this to `NULL,` if compilation fails */
+     malloc_usable_size,
diff --git a/quickjs/patches/patch-qjsc.c b/quickjs/patches/patch-qjsc.c
new file mode 100644
index 0000000000..105808b94b
--- /dev/null
+++ b/quickjs/patches/patch-qjsc.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Adapt to NetBSD.
+
+--- qjsc.c.orig   2019-07-09 19:49:47.000000000 +0200
++++ qjsc.c       2019-07-12 01:58:27.158678240 +0200
+@@ -399,7 +399,9 @@
+              lib_dir, bn_suffix, lto_suffix);
+     *arg++ = libjsname;
+     *arg++ = "-lm";
++#if !defined(__NetBSD__)
+     *arg++ = "-ldl";
++#endif
+     *arg = NULL;
+     
+     if (verbose) {
diff --git a/quickjs/patches/patch-quickjs-libc.c b/quickjs/patches/patch-quickjs-libc.c
new file mode 100644
index 0000000000..f4408f1e8b
--- /dev/null
+++ b/quickjs/patches/patch-quickjs-libc.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Adapt to NetBSD.
+
+--- quickjs-libc.c.orig   2019-07-09 19:49:47.000000000 +0200
++++ quickjs-libc.c       2019-07-12 12:03:42.879108433 +0200
+@@ -1303,7 +1303,7 @@
+     os_pending_signals |= ((uint64_t)1 << sig_num);
+ }
+ 
+-#if defined(_WIN32)
++#if defined(_WIN32) || defined(__NetBSD__)
+ typedef void (*sighandler_t)(int sig_num);
+ #endif
+ 
+@@ -1624,6 +1624,8 @@
+ #define OS_PLATFORM "darwin"
+ #elif defined(EMSCRIPTEN)
+ #define OS_PLATFORM "js"
++#elif defined(__NetBSD__)
++#define OS_PLATFORM "NetBSD"
+ #else
+ #define OS_PLATFORM "linux"
+ #endif
diff --git a/quickjs/patches/patch-quickjs.c b/quickjs/patches/patch-quickjs.c
new file mode 100644
index 0000000000..6803ab0160
--- /dev/null
+++ b/quickjs/patches/patch-quickjs.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Adapt to NetBSD.
+
+--- quickjs.c.orig        2019-07-09 19:49:47.000000000 +0200
++++ quickjs.c    2019-07-12 11:49:56.029913625 +0200
+@@ -1277,6 +1277,8 @@
+     return 0;
+ #elif defined(__linux__)
+     return malloc_usable_size(ptr);
++#elif defined(__NetBSD__)
++    return 0;
+ #else
+     /* change this to `return 0;` if compilation fails */
+     return malloc_usable_size(ptr);
+@@ -1351,6 +1353,8 @@
+     NULL,
+ #elif defined(__linux__)
+     (size_t (*)(const void *))malloc_usable_size,
++#elif defined(__NetBSD__)
++    NULL,
+ #else
+     /* change this to `NULL,` if compilation fails */
+     malloc_usable_size,


Home | Main Index | Thread Index | Old Index