git: 81ddc72fda1f - main - www/onlyoffice-documentserver: Fix build

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Fri, 02 Feb 2024 14:03:35 UTC
The branch main has been updated by mikael:

URL: https://cgit.FreeBSD.org/ports/commit/?id=81ddc72fda1f56d86dd0f4166edeb1ac8e331a6e

commit 81ddc72fda1f56d86dd0f4166edeb1ac8e331a6e
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2024-02-02 14:02:12 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2024-02-02 14:03:31 +0000

    www/onlyoffice-documentserver: Fix build
    
    Fix nodejs version in USES and regen yao-pkg patch
---
 www/onlyoffice-documentserver/Makefile                |  3 +--
 .../files/extra-patch-pkg-fetch_lib-es5_build.js      | 19 ++++++++++++++-----
 ...ra-patch-pkg-fetch_patches_node.v18.18.2.cpp.patch |  6 +++---
 3 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/www/onlyoffice-documentserver/Makefile b/www/onlyoffice-documentserver/Makefile
index 2e9574442e7b..9a7379657084 100644
--- a/www/onlyoffice-documentserver/Makefile
+++ b/www/onlyoffice-documentserver/Makefile
@@ -1,4 +1,3 @@
-# hyphen
 PORTNAME=	onlyoffice-documentserver
 DISTVERSIONPREFIX=	v
 DISTVERSION=	7.5.1.23
@@ -41,7 +40,7 @@ RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}supervisor>0:sysutils/py-supervisor@${PY_FLA
 		rabbitmq>0:net/rabbitmq \
 		webfonts>=0:x11-fonts/webfonts
 
-USES=		autoreconf:build dos2unix fakeroot gmake gnome iconv localbase nodejs:16,build pkgconfig \
+USES=		autoreconf:build dos2unix fakeroot gmake gnome iconv localbase nodejs:18,build pkgconfig \
 		python:3.9+,build qt:5 trigger
 USE_QT=		qmake:build
 USE_GITHUB=	yes
diff --git a/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_lib-es5_build.js b/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_lib-es5_build.js
index aa81e8db03d8..b45253b02607 100644
--- a/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_lib-es5_build.js
+++ b/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_lib-es5_build.js
@@ -1,6 +1,6 @@
---- server/node_modules/pkg-fetch/lib-es5/build.js.orig	2021-12-31 17:50:57.174508000 +0100
-+++ server/node_modules/pkg-fetch/lib-es5/build.js	2021-12-31 17:50:42.893063000 +0100
-@@ -98,18 +98,14 @@ function getConfigureArgs(major, targetPlatform) {
+--- server/node_modules/@yao-pkg/pkg-fetch/lib-es5/build.js.orig	2024-01-25 21:40:25.773587000 +0100
++++ server/node_modules/@yao-pkg/pkg-fetch/lib-es5/build.js	2024-01-25 21:41:12.907517000 +0100
+@@ -99,12 +99,6 @@ function getConfigureArgs(major, targetPlatform) {
      if (targetPlatform === 'linuxstatic') {
          args.push('--fully-static');
      }
@@ -10,8 +10,10 @@
 -            args.push('--enable-lto');
 -        }
 -    }
-     // DTrace
-     args.push('--without-dtrace');
+     // production binaries do NOT take NODE_OPTIONS from end-users
+     args.push('--without-node-options');
+     // The dtrace and etw support was removed in https://github.com/nodejs/node/commit/aa3a572e6bee116cde69508dc29478b40f40551a
+@@ -115,7 +109,9 @@ function getConfigureArgs(major, targetPlatform) {
      // bundled npm package manager
      args.push('--without-npm');
      // Small ICU
@@ -22,3 +24,10 @@
      // Workaround for nodejs/node#39313
      // All supported macOS versions have zlib as a system library
      if (targetPlatform === 'macos') {
+@@ -433,4 +429,4 @@ exports.default = build;
+     });
+ }
+ exports.default = build;
+-//# sourceMappingURL=build.js.map
+\ No newline at end of file
++//# sourceMappingURL=build.js.map
diff --git a/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_patches_node.v18.18.2.cpp.patch b/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_patches_node.v18.18.2.cpp.patch
index bb6f26770a3b..3bce0f0eb59d 100644
--- a/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_patches_node.v18.18.2.cpp.patch
+++ b/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_patches_node.v18.18.2.cpp.patch
@@ -1,9 +1,9 @@
-https://github.com/vercel/pkg-fetch/blob/main/patches/node.v18.5.0.cpp.patch
+https://github.com/yao-pkg/pkg-fetch/blob/main/patches/node.v18.18.2.cpp.patch
 + local FreeBSD patches
 
 
---- server/node_modules/pkg-fetch/patches/node.v18.5.0.cpp.patch.orig   2021-12-30 20:04:18.203959000 +0100
-+++ server/node_modules/pkg-fetch/patches/node.v18.5.0.cpp.patch        2021-12-30 20:09:53.210319000 +0100
+--- server/node_modules/@yao-pkg/pkg-fetch/patches/node.v18.18.2.cpp.patch   2021-12-30 20:04:18.203959000 +0100
++++ server/node_modules/@yao-pkg/pkg-fetch/patches/node.v18.18.2.cpp.patch
 @@ -11,6 +11,15 @@ +              'lto': ' -flto=4 -ffat-lto-objects ', #
               }, {
                 'lto': ' -flto ', # Clang