git: 1457ecce2ae6 - main - textproc/kibana7: Update to 7.13.2
Juraj Lutter
otis at FreeBSD.org
Tue Jul 6 20:45:35 UTC 2021
The branch main has been updated by otis:
URL: https://cgit.FreeBSD.org/ports/commit/?id=1457ecce2ae6702e6600617902b3b3a8698c416e
commit 1457ecce2ae6702e6600617902b3b3a8698c416e
Author: Juraj Lutter <otis at FreeBSD.org>
AuthorDate: 2021-07-05 09:09:43 +0000
Commit: Juraj Lutter <otis at FreeBSD.org>
CommitDate: 2021-07-06 20:44:38 +0000
textproc/kibana7: Update to 7.13.2
- Update to 7.13.2
- kibana since 7.13.0 ships with re2.node shared library
built for Linux, Windows or Darwin. Build a native one
for FreeBSD as a part of the port build. This involves:
- Build node-nan
- Build node-re2
- Fix memleak [1]
PR: 253314 [1]
---
textproc/kibana7/Makefile | 71 +++++++++++++++++++---
textproc/kibana7/distinfo | 10 ++-
.../kibana7/files/extra-node-re2-binding-gyp.patch | 51 ++++++++++++++++
textproc/kibana7/files/kibana.in | 56 ++++++++++++-----
4 files changed, 163 insertions(+), 25 deletions(-)
diff --git a/textproc/kibana7/Makefile b/textproc/kibana7/Makefile
index 438118630dc6..653ca01ce47e 100644
--- a/textproc/kibana7/Makefile
+++ b/textproc/kibana7/Makefile
@@ -1,34 +1,86 @@
# Created by: Tom Judge <tj at FreeBSD.org>
PORTNAME= kibana
-PORTVERSION= 7.10.1
+PORTVERSION= 7.13.2
DISTVERSIONSUFFIX= -darwin-x86_64
CATEGORIES= textproc www
MASTER_SITES= https://artifacts.elastic.co/downloads/kibana/ \
http://artifacts.elastic.co/downloads/kibana/
PKGNAMESUFFIX?= 7
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= elastic at FreeBSD.org
COMMENT= Browser based analytics and search interface to ElasticSearch
LICENSE= APACHE20
-DEPRECATED= Uses EOL Python 2.7 via www/node10
-EXPIRATION_DATE=2021-06-23
+BUILD_DEPENDS= node14>=14.17.0:www/node14 \
+ npm-node14>0:www/npm-node14
+LIB_DEPENDS= libre2.so:devel/re2 \
+ libuv.so:devel/libuv
+RUN_DEPENDS= node14>=14.17.0:www/node14
-RUN_DEPENDS= node10>=10.22.1:www/node10
+USES= compiler:c++14-lang python:build
-CONFLICTS= kibana[6]*
+USE_GITHUB= nodefault
+GH_TUPLE= nodejs:nan:v${_NODE_NAN_VER}:node_nan \
+ uhop:node-re2:${_NODE_RE2_VER}:node_re2
-NO_BUILD= yes
-WWWDIR= ${PREFIX}/www/${PORTNAME}${PKGNAMESUFFIX}
USE_RC_SUBR= ${PORTNAME}
+CONFLICTS= kibana6
+
+WWWDIR= ${PREFIX}/www/${PORTNAME}${PKGNAMESUFFIX}
+
SUB_FILES= pkg-deinstall
-SUB_LIST+= PORTNAME=${PORTNAME} PKGNAMESUFFIX=${PKGNAMESUFFIX}
+SUB_LIST+= PKGNAMESUFFIX=${PKGNAMESUFFIX} \
+ PORTNAME=${PORTNAME}
+
+#######################################################################
+# Set node-nan version here
+_NODE_NAN_VER= 2.14.2
+# Set node-re version here
+_NODE_RE2_VER= 1.16.0
+#######################################################################
+
+_NODECMD= ${LOCALBASE}/bin/node --version
+_DEVDIR:= ${WRKDIR}/.devdir
+
+_RE2DIR= ${WRKDIR}/node-re2-${_NODE_RE2_VER}
+
+# Extra patch files must be updated whenever node-re2 changes
+_RE2PATCHES= ${PATCHDIR}/extra-node-re2-binding-gyp.patch
post-patch:
${FIND} -s ${WRKSRC}/node_modules -type d -empty -delete
+ cd ${_RE2DIR} && ${PATCH} -p0 < ${_RE2PATCHES}
+ ${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
+ -e "s|%%DEVDIR%%|${_DEVDIR}|g" ${_RE2DIR}/binding.gyp \
+
+pre-configure:
+ ( \
+ _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:
+ ${MKDIR} ${_DEVDIR}/nan
+ (cd ${WRKDIR}/nan-${_NODE_NAN_VER} && ${COPYTREE_SHARE} . \
+ ${_DEVDIR}/nan \
+ "! ( -name \.* -or -path *\/test\/* -or -name test )")
+ (cd ${_RE2DIR} && \
+ ${SETENV} HOME=${WRKDIR} \
+ ${LOCALBASE}/lib/node_modules/npm/bin/node-gyp-bin/node-gyp configure \
+ --python=${PYTHON_CMD} \
+ --devdir=${_DEVDIR})
+
+do-build:
+ (cd ${_RE2DIR} && \
+ ${SETENV} HOME=${WRKDIR} \
+ ${LOCALBASE}/lib/node_modules/npm/bin/node-gyp-bin/node-gyp build \
+ --devdir=${_DEVDIR})
do-install:
${MKDIR} ${STAGEDIR}${WWWDIR} ${STAGEDIR}${ETCDIR}
@@ -38,6 +90,9 @@ do-install:
${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR} && \
${COPYTREE_BIN} bin ${STAGEDIR}${WWWDIR})
${INSTALL} -lrs ${STAGEDIR}${ETCDIR} ${STAGEDIR}${WWWDIR}/config
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/re2/build/Release/re2.node
+ ${INSTALL_LIB} ${_RE2DIR}/build/Release/re2.node \
+ ${STAGEDIR}${WWWDIR}/node_modules/re2/build/Release/re2.node
post-install:
${ECHO} "@sample ${ETCDIR}/kibana.yml.sample" >> ${TMPPLIST}
diff --git a/textproc/kibana7/distinfo b/textproc/kibana7/distinfo
index f99132e0709b..956e3e1fefdc 100644
--- a/textproc/kibana7/distinfo
+++ b/textproc/kibana7/distinfo
@@ -1,3 +1,7 @@
-TIMESTAMP = 1609276223
-SHA256 (kibana-7.10.1-darwin-x86_64.tar.gz) = 325e8bc4f6c88be485f1c7b9f9029646cfa5123411c9ca3be5530a8c171edd76
-SIZE (kibana-7.10.1-darwin-x86_64.tar.gz) = 254099681
+TIMESTAMP = 1625487084
+SHA256 (kibana-7.13.2-darwin-x86_64.tar.gz) = 38964e6f785e500b78a8569b2cc7aa1f0169e73986546b80f36b408af127dd3e
+SIZE (kibana-7.13.2-darwin-x86_64.tar.gz) = 304694256
+SHA256 (nodejs-nan-v2.14.2_GH0.tar.gz) = 26dce4db0194c4a7b51b33d0324f3cf36eb67be49dc43a043e0a2dffc9dcdd6d
+SIZE (nodejs-nan-v2.14.2_GH0.tar.gz) = 178650
+SHA256 (uhop-node-re2-1.16.0_GH0.tar.gz) = 1f59293128e527942e3b5a372bcbf1f73abb3eb767b8a3958718bb67daa8e16b
+SIZE (uhop-node-re2-1.16.0_GH0.tar.gz) = 38904
diff --git a/textproc/kibana7/files/extra-node-re2-binding-gyp.patch b/textproc/kibana7/files/extra-node-re2-binding-gyp.patch
new file mode 100644
index 000000000000..ebab5accfed0
--- /dev/null
+++ b/textproc/kibana7/files/extra-node-re2-binding-gyp.patch
@@ -0,0 +1,51 @@
+--- binding.gyp.orig 2021-05-10 04:34:55.000000000 +0200
++++ binding.gyp 2021-07-05 19:22:23.670716000 +0200
+@@ -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++14",
+@@ -45,7 +22,7 @@
+ "-Wno-sign-compare",
+ "-Wno-unused-parameter",
+ "-Wno-missing-field-initializers",
+- "-Wno-cast-function-type",
++ "-Wno-bad-function-cast",
+ "-O3",
+ "-g"
+ ],
+@@ -54,7 +31,8 @@
+ "NOMINMAX"
+ ],
+ "include_dirs": [
+- "<!(node -e \"require('nan')\")",
++ "%%PREFIX%%/include",
++ "%%DEVDIR%%/nan",
+ "vendor"
+ ],
+ "xcode_settings": {
diff --git a/textproc/kibana7/files/kibana.in b/textproc/kibana7/files/kibana.in
index 4d7514248376..b61f10699d53 100644
--- a/textproc/kibana7/files/kibana.in
+++ b/textproc/kibana7/files/kibana.in
@@ -2,6 +2,7 @@
# PROVIDE: kibana
# REQUIRE: DAEMON
+# BEFORE: LOGIN
# KEYWORD: shutdown
. /etc/rc.subr
@@ -16,30 +17,47 @@ load_rc_config $name
: ${kibana_user:="www"}
: ${kibana_group:="www"}
: ${kibana_log:="/var/log/kibana.log"}
+: ${kibana_syslog_output_enable:="NO"}
-export BABEL_DISABLE_CACHE=1
-export NODE_ENV=production
-# ml and reporting modules not supported on FreeBSD
-export XPACK_ML_ENABLED=false
-export XPACK_REPORTING_ENABLED=false
+start_precmd="kibana_start_precmd"
+reload_cmd="kibana_reload_cmd"
+extra_commands="reload"
+
+if checkyesno kibana_syslog_output_enable; then
+ if [ -n "${kibana_syslog_output_tag}" ]; then
+ kibana_syslog_output_flags="-T ${kibana_syslog_output_tag}"
+ else
+ kibana_syslog_output_flags="-T ${name}"
+ fi
+ if [ -n "${kibana_syslog_output_priority}" ]; then
+ kibana_syslog_output_flags="${kibana_syslog_output_flags} -s ${kibana_syslog_output_priority}"
+ fi
+ if [ -n "${kibana_syslog_output_facility}" ]; then
+ kibana_syslog_output_flags="${kibana_syslog_output_flags} -l ${kibana_syslog_output_facility}"
+ fi
+fi
+
+NODE="%%LOCALBASE%%/bin/node"
required_files="${kibana_config}"
-pidfile="/var/run/${name}/${name}.pid"
-start_precmd="kibana_precmd"
-procname="%%LOCALBASE%%/bin/node"
+pidfile="/var/run/${name}.pid"
+
command="/usr/sbin/daemon"
-command_args="-f -p ${pidfile} ${procname} --no-warnings %%WWWDIR%%/src/cli/dist serve --config ${kibana_config} --log-file ${kibana_log}"
+command_args="-f ${kibana_syslog_output_flags} -P ${pidfile} -t ${name} \
+ /usr/bin/env BABEL_DISABLE_CACHE=1 NODE_ENV=production ${kibana_env} \
+ ${NODE} --no-warnings --max-http-header-size=65536 \
+ %%WWWDIR%%/src/cli/dist serve \
+ --config ${kibana_config} --log-file ${kibana_log} \
+ --xpack.reporting.enabled=false ${kibana_args}"
-kibana_precmd()
+kibana_start_precmd()
{
- if [ ! -d $(dirname ${pidfile}) ]; then
- install -d -o ${kibana_user} -g ${kibana_group} $(dirname ${pidfile})
+ if [ ! -e "${pidfile}" ]; then
+ install -m 0600 -o ${kibana_user} -g ${kibana_group} /dev/null ${pidfile}
fi
-
if [ ! -f ${kibana_log} ]; then
install -o ${kibana_user} -g ${kibana_group} -m 640 /dev/null ${kibana_log}
fi
-
if [ ! -d %%WWWDIR%%/optimize ]; then
install -d -o ${kibana_user} -g ${kibana_group} %%WWWDIR%%/optimize
else
@@ -49,4 +67,14 @@ kibana_precmd()
fi
}
+kibana_reload_cmd()
+{
+ if [ -z "$rc_pid" ]; then
+ _run_rc_notrunning
+ return 1
+ else
+ pkill -HUP -P ${rc_pid}
+ fi
+}
+
run_rc_command "$1"
More information about the dev-commits-ports-all
mailing list