git: 5b3918e0a88c - main - textproc/kibana8: Update to 8.11.3

From: Juraj Lutter <otis_at_FreeBSD.org>
Date: Mon, 25 Dec 2023 17:09:38 UTC
The branch main has been updated by otis:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5b3918e0a88c47be8f7a13921cefe408836c50c0

commit 5b3918e0a88c47be8f7a13921cefe408836c50c0
Author:     Juraj Lutter <otis@FreeBSD.org>
AuthorDate: 2023-12-25 17:06:49 +0000
Commit:     Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2023-12-25 17:09:23 +0000

    textproc/kibana8: Update to 8.11.3
    
    Release notes:
    https://www.elastic.co/guide/en/kibana/8.11/release-notes-8.11.3.html
---
 textproc/kibana8/Makefile                          |  22 ++--
 textproc/kibana8/distinfo                          |  14 +--
 .../kibana8/files/extra-node-re2-binding-gyp.patch | 118 +++++++++++++++------
 textproc/kibana8/files/kibana.in                   |   8 +-
 textproc/kibana8/files/patch-abseil                |  50 ---------
 textproc/kibana8/files/patch-config_kibana.yml     |  12 ++-
 textproc/kibana8/files/patch-config_node.options   |  14 +++
 7 files changed, 133 insertions(+), 105 deletions(-)

diff --git a/textproc/kibana8/Makefile b/textproc/kibana8/Makefile
index 45493593d840..5efa3b3848ea 100644
--- a/textproc/kibana8/Makefile
+++ b/textproc/kibana8/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=	kibana
-DISTVERSION=	8.8.2
-DISTVERSIONSUFFIX=	-darwin-x86_64
-PORTREVISION=	1
+DISTVERSION=	8.11.3
+DISTVERSIONSUFFIX=	-linux-x86_64
 CATEGORIES=	textproc www
 MASTER_SITES=	https://artifacts.elastic.co/downloads/kibana/ \
 		http://artifacts.elastic.co/downloads/kibana/
@@ -14,15 +13,12 @@ WWW=		https://www.elastic.co/products/kibana
 
 LICENSE=	APACHE20
 
-DEPRECATED=	Depends on EOL NodeJS 16
-EXPIRATION_DATE=	2023-10-30
-
-BUILD_DEPENDS=	npm-node16>=9.7.2:www/npm-node16
+BUILD_DEPENDS=	npm-node18>=9.7.2:www/npm-node18
 LIB_DEPENDS=	libre2.so:devel/re2 \
 		libuv.so:devel/libuv
-RUN_DEPENDS=	${LOCALBASE}/bin/node:www/node16
+RUN_DEPENDS=	${LOCALBASE}/bin/node:www/node18
 
-USES=		compiler:c++17-lang cpe nodejs:16,build,run python:build
+USES=		compiler:c++17-lang cpe nodejs:18,build,run python:build
 CPE_VENDOR=	elastic
 
 USE_GITHUB=	nodefault
@@ -50,9 +46,9 @@ BINS=		kibana-encryption-keys kibana-keystore kibana-plugin \
 
 #######################################################################
 # Set node-nan version here
-_NODE_NAN_VER=	2.17.0
+_NODE_NAN_VER=	2.18.0
 # Set node-re version here
-_NODE_RE2_VER=	1.19.1
+_NODE_RE2_VER=	1.20.0
 #######################################################################
 
 _NODECMD=	${LOCALBASE}/bin/node --version
@@ -70,6 +66,8 @@ post-patch:
 .for _dirdel in ${_DIR2DEL}
 	${FIND} -s ${WRKSRC}/${_dirdel} -type d -empty -delete
 .endfor
+	${REINPLACE_CMD} -e "s|%%WWWDIR%%|${WWWDIR}|g" \
+	${WRKSRC}/config/kibana.yml
 	cd ${_RE2DIR} && ${PATCH} -p0 < ${_RE2PATCHES}
 	${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
 	-e "s|%%DEVDIR%%|${_DEVDIR}|g" ${_RE2DIR}/binding.gyp
@@ -103,6 +101,7 @@ do-build:
 do-install:
 	${MKDIR} ${STAGEDIR}${WWWDIR} ${STAGEDIR}${ETCDIR}
 	${INSTALL_DATA} ${WRKSRC}/config/kibana.yml ${STAGEDIR}${ETCDIR}/kibana.yml.sample
+	${INSTALL_DATA} ${WRKSRC}/config/node.options ${STAGEDIR}${ETCDIR}/node.options.sample
 	(cd ${WRKSRC} && \
 		${RM} -r config node optimize && \
 		${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR} && \
@@ -120,6 +119,7 @@ do-install:
 
 post-install:
 	${ECHO} "@sample ${ETCDIR}/kibana.yml.sample" >> ${TMPPLIST}
+	${ECHO} "@sample ${ETCDIR}/node.options.sample" >> ${TMPPLIST}
 	${FIND} -s ${STAGEDIR}${WWWDIR} -not -type d | ${SORT} | \
 		${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
 	${ECHO} "@dir(www,www) ${WWWDIR}/data" >> ${TMPPLIST}
diff --git a/textproc/kibana8/distinfo b/textproc/kibana8/distinfo
index 7f05be1a15cb..81311f89a29d 100644
--- a/textproc/kibana8/distinfo
+++ b/textproc/kibana8/distinfo
@@ -1,7 +1,7 @@
-TIMESTAMP = 1688336020
-SHA256 (kibana-8.8.2-darwin-x86_64.tar.gz) = 97ba437a828b9a8e427efd4c28c86d06e1dbcdd33fabf609c316eb279a205033
-SIZE (kibana-8.8.2-darwin-x86_64.tar.gz) = 191503680
-SHA256 (nodejs-nan-v2.17.0_GH0.tar.gz) = bcf5dfe59c26377b2096d903ecf6c2dbdae92528b1373a0565c40fe07537610d
-SIZE (nodejs-nan-v2.17.0_GH0.tar.gz) = 179443
-SHA256 (uhop-node-re2-1.19.1_GH0.tar.gz) = 414a77a9690b074f88803b8d680684895ce470957b2b0af2008199df20c4a244
-SIZE (uhop-node-re2-1.19.1_GH0.tar.gz) = 47211
+TIMESTAMP = 1703504995
+SHA256 (kibana-8.11.3-linux-x86_64.tar.gz) = 4848297835d7f72881f617fc0adcfa299693038c51fbae70065057702b46e245
+SIZE (kibana-8.11.3-linux-x86_64.tar.gz) = 308895953
+SHA256 (nodejs-nan-v2.18.0_GH0.tar.gz) = 376361b98b931840804f8a145b28fa32c8da2634a3f93c2cbc7fdb14c6274b71
+SIZE (nodejs-nan-v2.18.0_GH0.tar.gz) = 180599
+SHA256 (uhop-node-re2-1.20.0_GH0.tar.gz) = 4bd036e3810b6a3a2d87fceb008e528482761349618dd9bd45e96fe304ab69c3
+SIZE (uhop-node-re2-1.20.0_GH0.tar.gz) = 48072
diff --git a/textproc/kibana8/files/extra-node-re2-binding-gyp.patch b/textproc/kibana8/files/extra-node-re2-binding-gyp.patch
index b4dd40eea2b2..8633323f5292 100644
--- a/textproc/kibana8/files/extra-node-re2-binding-gyp.patch
+++ b/textproc/kibana8/files/extra-node-re2-binding-gyp.patch
@@ -1,37 +1,93 @@
---- binding.gyp.orig	2023-06-15 22:48:53.000000000 +0200
-+++ binding.gyp	2023-07-03 08:23:44.841710000 +0200
-@@ -14,30 +14,6 @@
+--- binding.gyp.orig	2023-07-28 19:43:03.000000000 +0200
++++ binding.gyp	2023-12-24 18:44:16.120540000 +0100
+@@ -14,86 +14,6 @@
          "lib/to_string.cc",
          "lib/accessors.cc",
          "lib/util.cc",
--        "vendor/re2/bitmap256.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"
+-        "vendor/re2/re2/bitmap256.cc",
+-        "vendor/re2/re2/bitstate.cc",
+-        "vendor/re2/re2/compile.cc",
+-        "vendor/re2/re2/dfa.cc",
+-        "vendor/re2/re2/filtered_re2.cc",
+-        "vendor/re2/re2/mimics_pcre.cc",
+-        "vendor/re2/re2/nfa.cc",
+-        "vendor/re2/re2/onepass.cc",
+-        "vendor/re2/re2/parse.cc",
+-        "vendor/re2/re2/perl_groups.cc",
+-        "vendor/re2/re2/prefilter.cc",
+-        "vendor/re2/re2/prefilter_tree.cc",
+-        "vendor/re2/re2/prog.cc",
+-        "vendor/re2/re2/re2.cc",
+-        "vendor/re2/re2/regexp.cc",
+-        "vendor/re2/re2/set.cc",
+-        "vendor/re2/re2/simplify.cc",
+-        "vendor/re2/re2/tostring.cc",
+-        "vendor/re2/re2/unicode_casefold.cc",
+-        "vendor/re2/re2/unicode_groups.cc",
+-        "vendor/re2/util/pcre.cc",
+-        "vendor/re2/util/rune.cc",
+-        "vendor/re2/util/strutil.cc",
+-        "vendor/abseil-cpp/absl/base/internal/cycleclock.cc",
+-        "vendor/abseil-cpp/absl/base/internal/low_level_alloc.cc",
+-        "vendor/abseil-cpp/absl/base/internal/raw_logging.cc",
+-        "vendor/abseil-cpp/absl/base/internal/spinlock.cc",
+-        "vendor/abseil-cpp/absl/base/internal/spinlock_wait.cc",
+-        "vendor/abseil-cpp/absl/base/internal/sysinfo.cc",
+-        "vendor/abseil-cpp/absl/base/internal/thread_identity.cc",
+-        "vendor/abseil-cpp/absl/base/internal/throw_delegate.cc",
+-        "vendor/abseil-cpp/absl/base/internal/unscaledcycleclock.cc",
+-        "vendor/abseil-cpp/absl/container/internal/raw_hash_set.cc",
+-        "vendor/abseil-cpp/absl/debugging/stacktrace.cc",
+-        "vendor/abseil-cpp/absl/debugging/symbolize.cc",
+-        "vendor/abseil-cpp/absl/flags/commandlineflag.cc",
+-        "vendor/abseil-cpp/absl/flags/flag.cc",
+-        "vendor/abseil-cpp/absl/flags/internal/commandlineflag.cc",
+-        "vendor/abseil-cpp/absl/flags/internal/flag.cc",
+-        "vendor/abseil-cpp/absl/flags/internal/private_handle_accessor.cc",
+-        "vendor/abseil-cpp/absl/flags/internal/program_name.cc",
+-        "vendor/abseil-cpp/absl/flags/marshalling.cc",
+-        "vendor/abseil-cpp/absl/flags/reflection.cc",
+-        "vendor/abseil-cpp/absl/flags/usage_config.cc",
+-        "vendor/abseil-cpp/absl/hash/internal/city.cc",
+-        "vendor/abseil-cpp/absl/hash/internal/hash.cc",
+-        "vendor/abseil-cpp/absl/hash/internal/low_level_hash.cc",
+-        "vendor/abseil-cpp/absl/numeric/int128.cc",
+-        "vendor/abseil-cpp/absl/strings/ascii.cc",
+-        "vendor/abseil-cpp/absl/strings/charconv.cc",
+-        "vendor/abseil-cpp/absl/strings/internal/charconv_bigint.cc",
+-        "vendor/abseil-cpp/absl/strings/internal/charconv_parse.cc",
+-        "vendor/abseil-cpp/absl/strings/internal/memutil.cc",
+-        "vendor/abseil-cpp/absl/strings/internal/str_format/arg.cc",
+-        "vendor/abseil-cpp/absl/strings/internal/str_format/bind.cc",
+-        "vendor/abseil-cpp/absl/strings/internal/str_format/extension.cc",
+-        "vendor/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc",
+-        "vendor/abseil-cpp/absl/strings/internal/str_format/output.cc",
+-        "vendor/abseil-cpp/absl/strings/internal/str_format/parser.cc",
+-        "vendor/abseil-cpp/absl/strings/match.cc",
+-        "vendor/abseil-cpp/absl/strings/numbers.cc",
+-        "vendor/abseil-cpp/absl/strings/str_cat.cc",
+-        "vendor/abseil-cpp/absl/strings/str_split.cc",
+-        "vendor/abseil-cpp/absl/strings/string_view.cc",
+-        "vendor/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc",
+-        "vendor/abseil-cpp/absl/synchronization/internal/graphcycles.cc",
+-        "vendor/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc",
+-        "vendor/abseil-cpp/absl/synchronization/internal/waiter.cc",
+-        "vendor/abseil-cpp/absl/synchronization/mutex.cc",
+-        "vendor/abseil-cpp/absl/time/clock.cc",
+-        "vendor/abseil-cpp/absl/time/duration.cc",
+-        "vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc",
+-        "vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc",
+-        "vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc",
+-        "vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc",
+-        "vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc",
+-        "vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc",
+-        "vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.cc",
+-        "vendor/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc",
+-        "vendor/abseil-cpp/absl/time/time.cc",
        ],
        "cflags": [
          "-std=c++2a",
-@@ -46,7 +22,7 @@
+@@ -102,7 +22,7 @@
          "-Wno-sign-compare",
          "-Wno-unused-parameter",
          "-Wno-missing-field-initializers",
@@ -40,13 +96,15 @@
          "-O3",
          "-g"
        ],
-@@ -55,7 +31,8 @@
+@@ -111,9 +31,8 @@
          "NOMINMAX"
        ],
        "include_dirs": [
 -        "<!(node -e \"require('nan')\")",
+-        "vendor/re2",
+-        "vendor/abseil-cpp",
 +	"%%PREFIX%%/include",
 +	"%%DEVDIR%%/nan",
-         "vendor"
        ],
        "xcode_settings": {
+         "MACOSX_DEPLOYMENT_TARGET": "10.7",
diff --git a/textproc/kibana8/files/kibana.in b/textproc/kibana8/files/kibana.in
index 101be36fbb34..6525b0a78341 100644
--- a/textproc/kibana8/files/kibana.in
+++ b/textproc/kibana8/files/kibana.in
@@ -18,6 +18,7 @@ load_rc_config $name
 : ${kibana_group:="www"}
 : ${kibana_log:="/var/log/kibana.log"}
 : ${kibana_syslog_output_enable:="NO"}
+: ${kibana_chdir:="%%WWWDIR%%/data"}
 
 start_precmd="kibana_start_precmd"
 reload_cmd="kibana_reload_cmd"
@@ -40,7 +41,8 @@ fi
 NODE="%%LOCALBASE%%/bin/node"
 
 required_files="${kibana_config}"
-pidfile="/var/run/${name}.pid"
+_piddir="/var/run/${name}"
+pidfile="${_piddir}/${name}.pid"
 procname="${NODE}"
 
 command="/usr/sbin/daemon"
@@ -53,8 +55,8 @@ command_args="-f ${kibana_syslog_output_flags} -p ${pidfile} -t ${name} \
 
 kibana_start_precmd()
 {
-	if [ ! -e "${pidfile}" ]; then
-		install -m 0600 -o ${kibana_user} -g ${kibana_group} /dev/null ${pidfile}
+	if [ ! -e "${_piddir}" ]; then
+		install -d -m 0750 -o ${kibana_user} -g ${kibana_group} ${_piddir}
 	fi
 	if [ ! -f ${kibana_log} ]; then
 		install -o ${kibana_user} -g ${kibana_group} -m 640 /dev/null ${kibana_log}
diff --git a/textproc/kibana8/files/patch-abseil b/textproc/kibana8/files/patch-abseil
deleted file mode 100644
index 535d37e23b0c..000000000000
--- a/textproc/kibana8/files/patch-abseil
+++ /dev/null
@@ -1,50 +0,0 @@
---- ../node-re2-1.19.1/binding.gyp.orig	2023-06-16 04:48:53.000000000 +0800
-+++ ../node-re2-1.19.1/binding.gyp	2023-09-10 23:30:27.001674000 +0800
-@@ -50,6 +50,9 @@
-         "-O3",
-         "-g"
-       ],
-+      "cflags_cc": [
-+        "-std=c++17",
-+      ],
-       "defines": [
-         "NDEBUG",
-         "NOMINMAX"
---- ../node-re2-1.19.1/lib/replace.cc.orig	2023-06-16 04:48:53.000000000 +0800
-+++ ../node-re2-1.19.1/lib/replace.cc	2023-09-10 21:25:51.818852000 +0800
-@@ -107,7 +107,7 @@
- 					i += 2;
- 					continue;
- 				case '&':
--					result += groups[0].as_string();
-+					result += std::string(groups[0]);
- 					i += 2;
- 					continue;
- 				case '`':
-@@ -139,7 +139,7 @@
- 							index2 = index * 10 + (ch - '0');
- 							if (index2 && index2 < groups.size())
- 							{
--								result += groups[index2].as_string();
-+								result += std::string(groups[index2]);
- 								continue;
- 							}
- 							result += '$';
-@@ -152,7 +152,7 @@
- 					i += 2;
- 					if (index && index < groups.size())
- 					{
--						result += groups[index].as_string();
-+						result += std::string(groups[index]);
- 						continue;
- 					}
- 					result += '$';
-@@ -170,7 +170,7 @@
- 							if (group != namedGroups.end())
- 							{
- 								index = group->second;
--								result += groups[index].as_string();
-+								result += std::string(groups[index]);
- 							}
- 							i = nameEnd + 1 - data;
- 						}
diff --git a/textproc/kibana8/files/patch-config_kibana.yml b/textproc/kibana8/files/patch-config_kibana.yml
index c5420a65b3ad..4fd4d0a02634 100644
--- a/textproc/kibana8/files/patch-config_kibana.yml
+++ b/textproc/kibana8/files/patch-config_kibana.yml
@@ -1,11 +1,15 @@
---- config/kibana.yml.orig	2023-01-04 12:19:12 UTC
+--- config/kibana.yml.orig	2023-12-25 14:26:21 UTC
 +++ config/kibana.yml
-@@ -125,7 +125,7 @@
- #path.data: data
+@@ -122,10 +122,10 @@
+ 
+ # =================== System: Other ===================
+ # The path where Kibana stores persistent data not saved in Elasticsearch. Defaults to data
+-#path.data: data
++path.data: %%WWWDIR%%/data
  
  # Specifies the path where Kibana creates the process ID file.
 -#pid.file: /run/kibana/kibana.pid
-+pid.file: /var/run/kibana.pid
++pid.file: /var/run/kibana/kibana.pid
  
  # Set the interval in milliseconds to sample system and process performance
  # metrics. Minimum is 100ms. Defaults to 5000ms.
diff --git a/textproc/kibana8/files/patch-config_node.options b/textproc/kibana8/files/patch-config_node.options
new file mode 100644
index 000000000000..051087956ccb
--- /dev/null
+++ b/textproc/kibana8/files/patch-config_node.options
@@ -0,0 +1,14 @@
+--- config/node.options.orig	2023-12-25 14:25:19 UTC
++++ config/node.options
+@@ -6,10 +6,7 @@
+ #--max-old-space-size=4096
+ 
+ ## do not terminate process on unhandled promise rejection
+- --unhandled-rejections=warn
++--unhandled-rejections=warn
+ 
+ ## restore < Node 16 default DNS lookup behavior
+ --dns-result-order=ipv4first
+-
+-## enable OpenSSL 3 legacy provider
+---openssl-legacy-provider