Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Mar 2021 21:14:43 +0000 (UTC)
From:      Juraj Lutter <otis@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r568511 - in head/textproc: . node-re2 node-re2/files
Message-ID:  <202103152114.12FLEhFE075209@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: otis
Date: Mon Mar 15 21:14:43 2021
New Revision: 568511
URL: https://svnweb.freebsd.org/changeset/ports/568511

Log:
  Add port: textproc/node-re2: A Node.js bindings to re2
  
  - Add port
  - Connect to the category
  
  Reviewed by:	osa (mentor)
  Approved by:	osa (mentor)
  Differential Revision:	https://reviews.freebsd.org/D29265

Added:
  head/textproc/node-re2/
  head/textproc/node-re2/Makefile   (contents, props changed)
  head/textproc/node-re2/distinfo   (contents, props changed)
  head/textproc/node-re2/files/
  head/textproc/node-re2/files/patch-binding.gyp   (contents, props changed)
  head/textproc/node-re2/pkg-descr   (contents, props changed)
  head/textproc/node-re2/pkg-plist   (contents, props changed)
Modified:
  head/textproc/Makefile

Modified: head/textproc/Makefile
==============================================================================
--- head/textproc/Makefile	Mon Mar 15 21:06:04 2021	(r568510)
+++ head/textproc/Makefile	Mon Mar 15 21:14:43 2021	(r568511)
@@ -472,6 +472,7 @@
     SUBDIR += nl-hyphen
     SUBDIR += nl-mythes
     SUBDIR += nn-aspell
+    SUBDIR += node-re2
     SUBDIR += nunnimcax
     SUBDIR += nuspell
     SUBDIR += nux

Added: head/textproc/node-re2/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/textproc/node-re2/Makefile	Mon Mar 15 21:14:43 2021	(r568511)
@@ -0,0 +1,66 @@
+# $FreeBSD$
+
+PORTNAME=	re2
+DISTVERSION=	1.15.9
+CATEGORIES=	textproc
+PKGNAMEPREFIX=	node-
+
+MAINTAINER=	otis@FreeBSD.org
+COMMENT=	Node.js bindings for devel/re2
+
+LICENSE=	BSD3CLAUSE
+
+BUILD_DEPENDS=	${LOCALBASE}/bin/node-gyp:devel/node-gyp \
+		${LOCALBASE}/bin/npm:www/npm \
+		${LOCALBASE}/lib/node_modules/nan:devel/node-nan
+LIB_DEPENDS=	libre2.so:devel/re2 \
+		libuv.so:devel/libuv
+RUN_DEPENDS=	${LOCALBASE}/bin/npm:www/npm
+
+USES=		gmake python
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	uhop
+GH_PROJECT=	node-re2
+
+.include <bsd.port.pre.mk>
+
+_NODECMD=	${LOCALBASE}/bin/node --version
+_NPMCMD=	${LOCALBASE}/bin/npm
+_RE2DIR=	${STAGEDIR}${PREFIX}/lib/node_modules/re2
+_DEVDIR:=	${WRKDIR}/.devdir
+
+pre-configure:
+	${RM} ${WRKSRC}/package-lock.json
+	(_NPMGROOT=$$(${_NPMCMD} root -g) && \
+	${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
+	-e "s|%%NODEPATH%%|$${_NPMGROOT}|g" ${WRKSRC}/binding.gyp)
+# Determine node's version. Particular node version is
+# pulled in via www/npm dependency
+	(_NODEVER=$$(${_NODECMD} | ${SED} -n 's|^v\(.*\)|\1|p') && \
+	${MKDIR} ${_DEVDIR}/$${_NODEVER}/include && \
+	${RLN} ${LOCALBASE}/include/node ${_DEVDIR}/$${_NODEVER}/include/node && \
+	${ECHO} "9" > ${_DEVDIR}/$${_NODEVER}/installVersion \
+	)
+
+do-configure:
+	(cd ${WRKSRC} && \
+		${SETENV} HOME=${WRKDIR} NODE_PATH=${LOCALBASE}/lib/node_modules/npm/node_modules \
+		${LOCALBASE}/bin/node-gyp configure --python=${PYTHON_CMD} \
+		--devdir=${_DEVDIR})
+
+do-build:
+	(cd ${WRKSRC} && \
+		${SETENV} HOME=${WRKDIR} NODE_PATH=${LOCALBASE}/lib/node_modules/npm/node_modules \
+		${LOCALBASE}/bin/node-gyp build \
+		--devdir=${_DEVDIR})
+
+do-install:
+	${MKDIR} ${_RE2DIR}
+	${RM} -r ${WRKSRC}/build/Release/obj.target
+	${STRIP_CMD} ${WRKSRC}/build/Release/re2.node
+	cd ${WRKSRC} && ${COPYTREE_SHARE} . ${_RE2DIR} \
+		"! ( -name \.* -or -name binding\.gyp\.* \
+		-or -path */\.* -or -name vendor )"
+
+.include <bsd.port.post.mk>

Added: head/textproc/node-re2/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/textproc/node-re2/distinfo	Mon Mar 15 21:14:43 2021	(r568511)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1615584704
+SHA256 (uhop-node-re2-1.15.9_GH0.tar.gz) = b52f8a3ae6cd8fe0ba25a30c6a140a6ca60659d396cd3134962766c7b35b7c87
+SIZE (uhop-node-re2-1.15.9_GH0.tar.gz) = 38969

Added: head/textproc/node-re2/files/patch-binding.gyp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/textproc/node-re2/files/patch-binding.gyp	Mon Mar 15 21:14:43 2021	(r568511)
@@ -0,0 +1,61 @@
+--- binding.gyp.orig	2020-11-13 05:47:17 UTC
++++ binding.gyp
+@@ -14,29 +14,6 @@
+         "lib/to_string.cc",
+         "lib/accessors.cc",
+         "lib/util.cc",
+-        "vendor/re2/bitstate.cc",
+-        "vendor/re2/compile.cc",
+-        "vendor/re2/dfa.cc",
+-        "vendor/re2/filtered_re2.cc",
+-        "vendor/re2/mimics_pcre.cc",
+-        "vendor/re2/nfa.cc",
+-        "vendor/re2/onepass.cc",
+-        "vendor/re2/parse.cc",
+-        "vendor/re2/perl_groups.cc",
+-        "vendor/re2/prefilter.cc",
+-        "vendor/re2/prefilter_tree.cc",
+-        "vendor/re2/prog.cc",
+-        "vendor/re2/re2.cc",
+-        "vendor/re2/regexp.cc",
+-        "vendor/re2/set.cc",
+-        "vendor/re2/simplify.cc",
+-        "vendor/re2/stringpiece.cc",
+-        "vendor/re2/tostring.cc",
+-        "vendor/re2/unicode_casefold.cc",
+-        "vendor/re2/unicode_groups.cc",
+-        "vendor/util/pcre.cc",
+-        "vendor/util/rune.cc",
+-        "vendor/util/strutil.cc"
+       ],
+       "cflags": [
+         "-std=c++11",
+@@ -45,8 +22,7 @@
+         "-Wno-sign-compare",
+         "-Wno-unused-parameter",
+         "-Wno-missing-field-initializers",
+-        "-Wno-cast-function-type",
+-        "-O3",
++        "-Wno-bad-function-cast",
+         "-g"
+       ],
+       "defines": [
+@@ -54,7 +30,8 @@
+         "NOMINMAX"
+       ],
+       "include_dirs": [
+-        "<!(node -e \"require('nan')\")",
++        "%%PREFIX%%/include",
++        "%%NODEPATH%%/nan",
+         "vendor"
+       ],
+       "xcode_settings": {
+@@ -73,7 +50,7 @@
+         ]
+       },
+       "conditions": [
+-        ["OS==\"linux\"", {
++        ["OS==\"freebsd\"", {
+           "cflags": [
+             "-pthread"
+           ],

Added: head/textproc/node-re2/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/textproc/node-re2/pkg-descr	Mon Mar 15 21:14:43 2021	(r568511)
@@ -0,0 +1,4 @@
+This project provides bindings for RE2: fast, safe alternative to
+backtracking regular expression engines.
+
+WWW: https://github.com/uhop/node-re2

Added: head/textproc/node-re2/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/textproc/node-re2/pkg-plist	Mon Mar 15 21:14:43 2021	(r568511)
@@ -0,0 +1,41 @@
+lib/node_modules/re2/LICENSE
+lib/node_modules/re2/README.md
+lib/node_modules/re2/binding.gyp
+lib/node_modules/re2/build/Makefile
+lib/node_modules/re2/build/Release/re2.node
+lib/node_modules/re2/build/binding.Makefile
+lib/node_modules/re2/build/config.gypi
+lib/node_modules/re2/build/re2.target.mk
+lib/node_modules/re2/lib/accessors.cc
+lib/node_modules/re2/lib/addon.cc
+lib/node_modules/re2/lib/exec.cc
+lib/node_modules/re2/lib/match.cc
+lib/node_modules/re2/lib/new.cc
+lib/node_modules/re2/lib/replace.cc
+lib/node_modules/re2/lib/search.cc
+lib/node_modules/re2/lib/split.cc
+lib/node_modules/re2/lib/test.cc
+lib/node_modules/re2/lib/to_string.cc
+lib/node_modules/re2/lib/util.cc
+lib/node_modules/re2/lib/util.h
+lib/node_modules/re2/lib/wrapped_re2.h
+lib/node_modules/re2/package.json
+lib/node_modules/re2/re2.d.ts
+lib/node_modules/re2/re2.js
+lib/node_modules/re2/scripts/verify-build.js
+lib/node_modules/re2/tests/test_exec.js
+lib/node_modules/re2/tests/test_general.js
+lib/node_modules/re2/tests/test_groups.js
+lib/node_modules/re2/tests/test_invalid.js
+lib/node_modules/re2/tests/test_match.js
+lib/node_modules/re2/tests/test_new.js
+lib/node_modules/re2/tests/test_prototype.js
+lib/node_modules/re2/tests/test_replace.js
+lib/node_modules/re2/tests/test_search.js
+lib/node_modules/re2/tests/test_source.js
+lib/node_modules/re2/tests/test_split.js
+lib/node_modules/re2/tests/test_symbols.js
+lib/node_modules/re2/tests/test_test.js
+lib/node_modules/re2/tests/test_toString.js
+lib/node_modules/re2/tests/tests.js
+lib/node_modules/re2/tests/worker.js



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