New port: lang/quickjs: Embeddable Javascript interpreter in C

This commit is contained in:
Yuri Victorovich 2019-09-22 20:58:12 +00:00
parent 81c355a29e
commit fa3bef6253
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=512604
9 changed files with 103 additions and 0 deletions

View file

@ -315,6 +315,7 @@
SUBDIR += qmasm
SUBDIR += qscheme
SUBDIR += quack
SUBDIR += quickjs
SUBDIR += racket
SUBDIR += racket-minimal
SUBDIR += ratfor

16
lang/quickjs/Makefile Normal file
View file

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

3
lang/quickjs/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1569184657
SHA256 (quickjs-2019-09-18.tar.xz) = ae4395d3f45045f920069e6c203ddb3fc3e549ce8fa3c429e696880cff010575
SIZE (quickjs-2019-09-18.tar.xz) = 761448

View file

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

View file

@ -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
};

View file

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

View file

@ -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
};

7
lang/quickjs/pkg-descr Normal file
View file

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

9
lang/quickjs/pkg-plist Normal file
View file

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