aboutsummaryrefslogtreecommitdiff
path: root/lang/quickjs
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2019-09-22 20:58:12 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2019-09-22 20:58:12 +0000
commitfa3bef62530f70f2f6ee3bbb03ef69274cbe5b07 (patch)
tree7d249fb0e0225bcdcf53c091963d61cd8467a1e0 /lang/quickjs
parent81c355a29e9cf817aa4436a38895911f8938c5f1 (diff)
downloadports-fa3bef62530f70f2f6ee3bbb03ef69274cbe5b07.tar.gz
ports-fa3bef62530f70f2f6ee3bbb03ef69274cbe5b07.zip
New port: lang/quickjs: Embeddable Javascript interpreter in C
Notes
Notes: svn path=/head/; revision=512604
Diffstat (limited to 'lang/quickjs')
-rw-r--r--lang/quickjs/Makefile16
-rw-r--r--lang/quickjs/distinfo3
-rw-r--r--lang/quickjs/files/patch-Makefile25
-rw-r--r--lang/quickjs/files/patch-qjs.c20
-rw-r--r--lang/quickjs/files/patch-quickjs-libc.c11
-rw-r--r--lang/quickjs/files/patch-quickjs.c11
-rw-r--r--lang/quickjs/pkg-descr7
-rw-r--r--lang/quickjs/pkg-plist9
8 files changed, 102 insertions, 0 deletions
diff --git a/lang/quickjs/Makefile b/lang/quickjs/Makefile
new file mode 100644
index 000000000000..67100dd9f465
--- /dev/null
+++ b/lang/quickjs/Makefile
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+PORTNAME= quickjs
+DISTVERSION= 2019.09.18
+CATEGORIES= lang devel
+MASTER_SITES= https://bellard.org/${PORTNAME}/
+DISTNAME= ${PORTNAME}-${DISTVERSION:S/./-/g}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Embeddable Javascript interpreter in C
+
+LICENSE= MIT
+
+USES= gmake tar:xz
+
+.include <bsd.port.mk>
diff --git a/lang/quickjs/distinfo b/lang/quickjs/distinfo
new file mode 100644
index 000000000000..f9ff512c5d9a
--- /dev/null
+++ b/lang/quickjs/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1569184657
+SHA256 (quickjs-2019-09-18.tar.xz) = ae4395d3f45045f920069e6c203ddb3fc3e549ce8fa3c429e696880cff010575
+SIZE (quickjs-2019-09-18.tar.xz) = 761448
diff --git a/lang/quickjs/files/patch-Makefile b/lang/quickjs/files/patch-Makefile
new file mode 100644
index 000000000000..d4014c7285af
--- /dev/null
+++ b/lang/quickjs/files/patch-Makefile
@@ -0,0 +1,25 @@
+--- Makefile.orig 2019-09-18 18:34:20 UTC
++++ Makefile
+@@ -25,6 +25,9 @@
+ ifeq ($(shell uname -s),Darwin)
+ CONFIG_DARWIN=y
+ endif
++ifeq ($(shell uname -s),FreeBSD)
++CONFIG_FREEBSD=y
++endif
+ # Windows cross compilation from Linux
+ #CONFIG_WIN32=y
+ # use link time optimization (smaller and faster executables but slower build)
+@@ -38,6 +41,12 @@ ifdef CONFIG_DARWIN
+ # use clang instead of gcc
+ CONFIG_CLANG=y
+ CONFIG_DEFAULT_AR=y
++endif
++ifdef CONFIG_FREEBSD
++# use clang instead of gcc
++CONFIG_CLANG=y
++CONFIG_DEFAULT_AR=y
++CONFIG_LTO=
+ endif
+
+ # installation directory
diff --git a/lang/quickjs/files/patch-qjs.c b/lang/quickjs/files/patch-qjs.c
new file mode 100644
index 000000000000..cd092b28c605
--- /dev/null
+++ b/lang/quickjs/files/patch-qjs.c
@@ -0,0 +1,20 @@
+--- qjs.c.orig 2019-09-18 18:34:20 UTC
++++ qjs.c
+@@ -130,7 +130,7 @@ static inline size_t js_trace_malloc_usable_size(void
+ return malloc_usable_size(ptr);
+ #else
+ /* change this to `return 0;` if compilation fails */
+- return malloc_usable_size(ptr);
++ return 0; //return malloc_usable_size(ptr);
+ #endif
+ }
+
+@@ -246,7 +246,7 @@ static const JSMallocFunctions trace_mf = {
+ (size_t (*)(const void *))malloc_usable_size,
+ #else
+ /* change this to `NULL,` if compilation fails */
+- malloc_usable_size,
++ NULL, //malloc_usable_size,
+ #endif
+ };
+
diff --git a/lang/quickjs/files/patch-quickjs-libc.c b/lang/quickjs/files/patch-quickjs-libc.c
new file mode 100644
index 000000000000..c37cc7ccb755
--- /dev/null
+++ b/lang/quickjs/files/patch-quickjs-libc.c
@@ -0,0 +1,11 @@
+--- quickjs-libc.c.orig 2019-09-18 18:34:20 UTC
++++ quickjs-libc.c
+@@ -45,7 +45,7 @@
+ #include <termios.h>
+ #include <sys/ioctl.h>
+ #include <sys/wait.h>
+-#if defined(__APPLE__)
++#if defined(__APPLE__) || defined(__FreeBSD__)
+ typedef sig_t sighandler_t;
+ #endif
+ #endif
diff --git a/lang/quickjs/files/patch-quickjs.c b/lang/quickjs/files/patch-quickjs.c
new file mode 100644
index 000000000000..55e159d3bb43
--- /dev/null
+++ b/lang/quickjs/files/patch-quickjs.c
@@ -0,0 +1,11 @@
+--- quickjs.c.orig 2019-09-18 18:34:20 UTC
++++ quickjs.c
+@@ -1423,7 +1423,7 @@ static const JSMallocFunctions def_malloc_funcs = {
+ (size_t (*)(const void *))malloc_usable_size,
+ #else
+ /* change this to `NULL,` if compilation fails */
+- malloc_usable_size,
++ NULL, //malloc_usable_size,
+ #endif
+ };
+
diff --git a/lang/quickjs/pkg-descr b/lang/quickjs/pkg-descr
new file mode 100644
index 000000000000..a4219cefc6d3
--- /dev/null
+++ b/lang/quickjs/pkg-descr
@@ -0,0 +1,7 @@
+QuickJS is a small and embeddable Javascript engine. It supports the ES2020
+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.
+
+WWW: https://bellard.org/quickjs/
diff --git a/lang/quickjs/pkg-plist b/lang/quickjs/pkg-plist
new file mode 100644
index 000000000000..af0548460364
--- /dev/null
+++ b/lang/quickjs/pkg-plist
@@ -0,0 +1,9 @@
+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