aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--textproc/Makefile1
-rw-r--r--textproc/node-re2/Makefile66
-rw-r--r--textproc/node-re2/distinfo3
-rw-r--r--textproc/node-re2/files/patch-binding.gyp61
-rw-r--r--textproc/node-re2/pkg-descr4
-rw-r--r--textproc/node-re2/pkg-plist41
6 files changed, 176 insertions, 0 deletions
diff --git a/textproc/Makefile b/textproc/Makefile
index 0828cb54b97a..ae09011dbfb2 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -472,6 +472,7 @@
SUBDIR += nl-hyphen
SUBDIR += nl-mythes
SUBDIR += nn-aspell
+ SUBDIR += node-re2
SUBDIR += nunnimcax
SUBDIR += nuspell
SUBDIR += nux
diff --git a/textproc/node-re2/Makefile b/textproc/node-re2/Makefile
new file mode 100644
index 000000000000..547e05cd51d5
--- /dev/null
+++ b/textproc/node-re2/Makefile
@@ -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>
diff --git a/textproc/node-re2/distinfo b/textproc/node-re2/distinfo
new file mode 100644
index 000000000000..194d7d923eee
--- /dev/null
+++ b/textproc/node-re2/distinfo
@@ -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
diff --git a/textproc/node-re2/files/patch-binding.gyp b/textproc/node-re2/files/patch-binding.gyp
new file mode 100644
index 000000000000..72daeed3cb43
--- /dev/null
+++ b/textproc/node-re2/files/patch-binding.gyp
@@ -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"
+ ],
diff --git a/textproc/node-re2/pkg-descr b/textproc/node-re2/pkg-descr
new file mode 100644
index 000000000000..4b3d6a50b761
--- /dev/null
+++ b/textproc/node-re2/pkg-descr
@@ -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
diff --git a/textproc/node-re2/pkg-plist b/textproc/node-re2/pkg-plist
new file mode 100644
index 000000000000..68b0f67b2bdf
--- /dev/null
+++ b/textproc/node-re2/pkg-plist
@@ -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