From owner-svn-ports-head@freebsd.org  Sun Sep 22 20:58:14 2019
Return-Path: <owner-svn-ports-head@freebsd.org>
Delivered-To: svn-ports-head@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id C245F12BFEB;
 Sun, 22 Sep 2019 20:58:14 +0000 (UTC)
 (envelope-from yuri@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 46c0Cp4jGdz4DSP;
 Sun, 22 Sep 2019 20:58:14 +0000 (UTC)
 (envelope-from yuri@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 852A44579;
 Sun, 22 Sep 2019 20:58:14 +0000 (UTC)
 (envelope-from yuri@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8MKwEir002848;
 Sun, 22 Sep 2019 20:58:14 GMT (envelope-from yuri@FreeBSD.org)
Received: (from yuri@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MKwCpC002840;
 Sun, 22 Sep 2019 20:58:12 GMT (envelope-from yuri@FreeBSD.org)
Message-Id: <201909222058.x8MKwCpC002840@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: yuri set sender to
 yuri@FreeBSD.org using -f
From: Yuri Victorovich <yuri@FreeBSD.org>
Date: Sun, 22 Sep 2019 20:58:12 +0000 (UTC)
To: ports-committers@freebsd.org, svn-ports-all@freebsd.org,
 svn-ports-head@freebsd.org
Subject: svn commit: r512604 - in head/lang: . quickjs quickjs/files
X-SVN-Group: ports-head
X-SVN-Commit-Author: yuri
X-SVN-Commit-Paths: in head/lang: . quickjs quickjs/files
X-SVN-Commit-Revision: 512604
X-SVN-Commit-Repository: ports
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-ports-head@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: SVN commit messages for the ports tree for head
 <svn-ports-head.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-ports-head>, 
 <mailto:svn-ports-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-ports-head/>
List-Post: <mailto:svn-ports-head@freebsd.org>
List-Help: <mailto:svn-ports-head-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-ports-head>,
 <mailto:svn-ports-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 22 Sep 2019 20:58:14 -0000

Author: yuri
Date: Sun Sep 22 20:58:12 2019
New Revision: 512604
URL: https://svnweb.freebsd.org/changeset/ports/512604

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

Added:
  head/lang/quickjs/
  head/lang/quickjs/Makefile   (contents, props changed)
  head/lang/quickjs/distinfo   (contents, props changed)
  head/lang/quickjs/files/
  head/lang/quickjs/files/patch-Makefile   (contents, props changed)
  head/lang/quickjs/files/patch-qjs.c   (contents, props changed)
  head/lang/quickjs/files/patch-quickjs-libc.c   (contents, props changed)
  head/lang/quickjs/files/patch-quickjs.c   (contents, props changed)
  head/lang/quickjs/pkg-descr   (contents, props changed)
  head/lang/quickjs/pkg-plist   (contents, props changed)
Modified:
  head/lang/Makefile

Modified: head/lang/Makefile
==============================================================================
--- head/lang/Makefile	Sun Sep 22 20:58:11 2019	(r512603)
+++ head/lang/Makefile	Sun Sep 22 20:58:12 2019	(r512604)
@@ -315,6 +315,7 @@
     SUBDIR += qmasm
     SUBDIR += qscheme
     SUBDIR += quack
+    SUBDIR += quickjs
     SUBDIR += racket
     SUBDIR += racket-minimal
     SUBDIR += ratfor

Added: head/lang/quickjs/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/quickjs/Makefile	Sun Sep 22 20:58:12 2019	(r512604)
@@ -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>

Added: head/lang/quickjs/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/quickjs/distinfo	Sun Sep 22 20:58:12 2019	(r512604)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1569184657
+SHA256 (quickjs-2019-09-18.tar.xz) = ae4395d3f45045f920069e6c203ddb3fc3e549ce8fa3c429e696880cff010575
+SIZE (quickjs-2019-09-18.tar.xz) = 761448

Added: head/lang/quickjs/files/patch-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/quickjs/files/patch-Makefile	Sun Sep 22 20:58:12 2019	(r512604)
@@ -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

Added: head/lang/quickjs/files/patch-qjs.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/quickjs/files/patch-qjs.c	Sun Sep 22 20:58:12 2019	(r512604)
@@ -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
+ };
+ 

Added: head/lang/quickjs/files/patch-quickjs-libc.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/quickjs/files/patch-quickjs-libc.c	Sun Sep 22 20:58:12 2019	(r512604)
@@ -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

Added: head/lang/quickjs/files/patch-quickjs.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/quickjs/files/patch-quickjs.c	Sun Sep 22 20:58:12 2019	(r512604)
@@ -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
+ };
+ 

Added: head/lang/quickjs/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/quickjs/pkg-descr	Sun Sep 22 20:58:12 2019	(r512604)
@@ -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/

Added: head/lang/quickjs/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/quickjs/pkg-plist	Sun Sep 22 20:58:12 2019	(r512604)
@@ -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