Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Apr 2021 00:16:43 GMT
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 427cfd0c4c0f - main - lang/mujs: Update 1.0.7 -> 1.1.1
Message-ID:  <202104180016.13I0GhQx051010@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=427cfd0c4c0ff66bc0c48d7e306688126558121e

commit 427cfd0c4c0ff66bc0c48d7e306688126558121e
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2021-04-17 23:07:12 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2021-04-18 00:16:37 +0000

    lang/mujs: Update 1.0.7 -> 1.1.1
---
 lang/mujs/Makefile             | 33 +++++++++++++++++++++++++--------
 lang/mujs/distinfo             |  8 +++-----
 lang/mujs/files/patch-Makefile | 27 +++++++++++++++++++++------
 3 files changed, 49 insertions(+), 19 deletions(-)

diff --git a/lang/mujs/Makefile b/lang/mujs/Makefile
index 4a2c2b887a0e..cedc3f3797dc 100644
--- a/lang/mujs/Makefile
+++ b/lang/mujs/Makefile
@@ -1,22 +1,23 @@
 PORTNAME=	mujs
-DISTVERSION=	1.0.7
-PORTREVISION=	1
+DISTVERSION=	1.1.1
 CATEGORIES=	lang devel
 
-PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${PORTNAME}/commit/
-PATCHFILES=	d9a1f4c57f976eeb67d877101fcdca89ecc047ed.patch:-p1 # Enable readline on FreeBSD
-
 MAINTAINER=	yuri@FreeBSD.org
 COMMENT=	Embeddable Javascript interpreter in C
 
 LICENSE=	ISCL
 LICENSE_FILE=	${WRKSRC}/COPYING
 
+TEST_DEPENDS=	git:devel/git
+
 USES=		compiler:c11 gmake readline # c11 is induced by the FreeBSD headers via isnan(3), etc, otherwise the project is all c99 code
+USE_LDCONFIG=	yes
+
 USE_GITHUB=	yes
 GH_ACCOUNT=	ccxvii
-USE_LDCONFIG=	yes
+
 ALL_TARGET=	shared static
+
 INSTALL_TARGET=	install-shared install-static
 
 .if defined(WITH_DEBUG) # this project manages its build options itself
@@ -38,7 +39,23 @@ OPTIONS_DEFAULT=	32BIT
 SANITIZED_DESC=		Sanitized build (only for debugging)
 SANITIZED_MAKE_ARGS=	build=sanitize
 
-post-install: # https://github.com/ccxvii/mujs/issues/99
-	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libmujs.so
+do-test: # Test-262 JavaScript testsuite is downloaded and run.
+	# Something is off with the test harness so too many tests fail: https://github.com/ccxvii/mujs/issues/147
+	${RM} -r ${WRKDIR}/testing && \
+	${MKDIR} -p ${WRKDIR}/testing && \
+	cd ${WRKDIR}/testing && \
+	git clone https://github.com/tc39/test262.git && \
+	fetch https://github.com/ccxvii/mujs/files/2332077/mujs-test262-harness-and-output.zip && \
+	unzip mujs-test262-harness-and-output.zip && \
+	(${TAIL} -3 mujs-harness-out.txt > mujs-harness-out-3.txt) && \
+	cd test262 && \
+	git checkout es5-tests && \
+	${ECHO} "Running MuJS tests ..." && \
+	(${FIND} test/suite -name '*.js' | ${STAGEDIR}${PREFIX}/bin/mujs ../mujs-harness.js > mujs-harness-out-our.txt) && \
+	${ECHO} "MuJS tests finished: " && \
+	(${TAIL} -3 mujs-harness-out-our.txt | tee mujs-harness-out-our-3.txt) && \
+	${ECHO} "" && \
+	${ECHO} "Compare with reference results:" && \
+	${DIFF} ../mujs-harness-out-3.txt mujs-harness-out-our-3.txt
 
 .include <bsd.port.mk>
diff --git a/lang/mujs/distinfo b/lang/mujs/distinfo
index 7588f22e8859..7113a49334bf 100644
--- a/lang/mujs/distinfo
+++ b/lang/mujs/distinfo
@@ -1,5 +1,3 @@
-TIMESTAMP = 1587257472
-SHA256 (ccxvii-mujs-1.0.7_GH0.tar.gz) = 9081244e070381300acaa5bf306a8b8b6f6231932ef4dca122992d3f6d243446
-SIZE (ccxvii-mujs-1.0.7_GH0.tar.gz) = 122041
-SHA256 (d9a1f4c57f976eeb67d877101fcdca89ecc047ed.patch) = de236ceb1d7df002bf0930ff31f07f58260e0faf780edef72f05d478185cb279
-SIZE (d9a1f4c57f976eeb67d877101fcdca89ecc047ed.patch) = 589
+TIMESTAMP = 1618693139
+SHA256 (ccxvii-mujs-1.1.1_GH0.tar.gz) = ade588c10e1cbed1eaca933a89f3199a1e6b826a6a00b48dc29b99630f017764
+SIZE (ccxvii-mujs-1.1.1_GH0.tar.gz) = 123984
diff --git a/lang/mujs/files/patch-Makefile b/lang/mujs/files/patch-Makefile
index 89da50f8a252..d0e471837710 100644
--- a/lang/mujs/files/patch-Makefile
+++ b/lang/mujs/files/patch-Makefile
@@ -1,6 +1,10 @@
---- Makefile.orig	2019-03-15 16:38:36 UTC
+Patch contains 2 changes:
+- enable readline on FreeBSD (upstream never accepted this PR)
+- use -O3 on FreeBSD
+
+--- Makefile.orig	2021-04-13 02:22:04 UTC
 +++ Makefile
-@@ -15,7 +15,8 @@ endif
+@@ -17,7 +17,8 @@ endif
  
  # Compiler flags for various configurations:
  
@@ -10,12 +14,23 @@
  
  ifeq "$(CC)" "clang"
    CFLAGS += -Wunreachable-code
-@@ -31,7 +32,7 @@ else ifeq "$(build)" "sanitize"
+@@ -27,13 +28,18 @@ ifeq "$(shell uname)" "Linux"
+   HAVE_READLINE := yes
+ endif
+ 
++ifeq "$(shell uname)" "FreeBSD"
++  HAVE_READLINE := yes
++  CFLAGS += -I$(prefix)/include
++endif
++
+ ifeq "$(build)" "debug"
+   CFLAGS += -g
+ else ifeq "$(build)" "sanitize"
    CFLAGS += -pipe -g -fsanitize=address -fno-omit-frame-pointer
    LDFLAGS += -fsanitize=address
- else
--  CFLAGS += -Os
-+  CFLAGS += -O3 # use -O3 on FreeBSD instead of -Os because this isn't an embedded platform
+ else ifeq "$(build)" "release"
+-  CFLAGS += -O2
++  CFLAGS += -O3
    LDFLAGS += -Wl,-s
  endif
  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104180016.13I0GhQx051010>