git: 01ede3084b43 - main - www/onlyoffice-documentserver: Update to 7.5.1.23

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Fri, 26 Jan 2024 14:46:06 UTC
The branch main has been updated by mikael:

URL: https://cgit.FreeBSD.org/ports/commit/?id=01ede3084b43f7f4ce2502f2f0438fcbfbf96096

commit 01ede3084b43f7f4ce2502f2f0438fcbfbf96096
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2024-01-26 14:43:27 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2024-01-26 14:45:58 +0000

    www/onlyoffice-documentserver: Update to 7.5.1.23
    
    While here:
     - Update node to v18
     - Improve pkg-message [1]
    
    Submitted by:   Niclas Wagner [1]
---
 www/onlyoffice-documentserver/Makefile             |  25 +-
 www/onlyoffice-documentserver/distinfo             |  56 +-
 ...patch-pkg-fetch_patches_node.v16.13.0.cpp.patch | 205 ------
 ...patch-pkg-fetch_patches_node.v18.18.2.cpp.patch | 189 +++++
 .../files/onlyoffice.newsyslog.sample.in           |   2 +-
 .../files/patch-build__tools_build.pro             |  19 +-
 .../patch-build__tools_scripts_build__server.py    |   2 +-
 ...ild__tools_scripts_core__common_make__common.py |  10 +-
 ...d__tools_scripts_core__common_modules_v8__89.py |  12 +-
 .../files/patch-core_Common_base.pri               |  25 +-
 ...-core_DesktopEditor_AllFontsGen_AllFontsGen.pro |  13 -
 ...ore_DesktopEditor_allthemesgen_allthemesgen.pro |  14 -
 .../patch-core_DesktopEditor_common_Directory.cpp  |  56 +-
 ...Editor_doctrenderer_app__builder_docbuilder.pro |  11 -
 ...e_DesktopEditor_fontengine_ApplicationFonts.cpp |  17 +-
 ...opEditor_raster_Metafile_Common_MetaFileUtils.h |  11 +
 ..._DrawingConverter_ASCOfficeDrawingConverter.cpp |   8 +-
 ...OXML_XlsbFormat_Biff12__records_BeginPCDSCSet.h |  11 +
 .../files/patch-document-server-package_Makefile   |  37 +-
 .../files/patch-increase_max_connections           |   2 +-
 .../files/patch-server_package.json                |  23 +-
 .../files/patch-web-apps_build_package.json        |  11 +-
 www/onlyoffice-documentserver/files/pkg-message.in |   8 +-
 www/onlyoffice-documentserver/pkg-plist            | 802 +++++++++++++++++++--
 24 files changed, 1122 insertions(+), 447 deletions(-)

diff --git a/www/onlyoffice-documentserver/Makefile b/www/onlyoffice-documentserver/Makefile
index a37b31156747..2e9574442e7b 100644
--- a/www/onlyoffice-documentserver/Makefile
+++ b/www/onlyoffice-documentserver/Makefile
@@ -1,7 +1,7 @@
+# hyphen
 PORTNAME=	onlyoffice-documentserver
 DISTVERSIONPREFIX=	v
-DISTVERSION=	7.4.1.36
-PORTREVISION=	1
+DISTVERSION=	7.5.1.23
 CATEGORIES=	www
 MASTER_SITES+=	LOCAL/mikael/v8/:source1 \
 		LOCAL/mikael/onlyoffice/:source2 \
@@ -27,7 +27,7 @@ BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}Jinja2>=0:devel/py-Jinja2@${PY_FLAVOR} \
 		gn:devel/gn \
 		java:java/openjdk11 \
 		ninja:devel/ninja \
-		npm:www/npm-node16 \
+		npm:www/npm-node18 \
 		${LOCALBASE}/lib/libcrypto.a:security/openssl
 LIB_DEPENDS=	libboost_regex.so:devel/boost-libs \
 		libcurl.so:ftp/curl \
@@ -61,7 +61,8 @@ GH_TUPLE=	ONLYOFFICE:core:v${DISTVERSION}:core/core \
 		ONLYOFFICE:onlyoffice.github.io:b26d001664d771df4f663d2d3ba7dd4a188b6cab:sdkjs_plugins_v1/onlyoffice.github.io \
 		ONLYOFFICE:document-server-package:v${DISTVERSION}:dsp/document-server-package \
 		jasenhuang:katana-parser:be6df45:jasenhuang_katana/core/Common/3dParty/html/katana-parser \
-		google:gumbo-parser:aa91b27:google_gumbo/core/Common/3dParty/html/gumbo-parser
+		google:gumbo-parser:aa91b27:google_gumbo/core/Common/3dParty/html/gumbo-parser \
+		hunspell:hyphen:73dd296:hunspell_hyphen/core/Common/3dParty/hyphen/hyphen
 
 OPTIONS_SINGLE=		DB
 OPTIONS_SINGLE_DB=	MYSQL PGSQL
@@ -87,14 +88,17 @@ PLIST_SUB=	DS_GROUPNAME=${DS_GROUPNAME} \
 		DS_USERNAME=${DS_USERNAME}
 SUB_FILES=	pkg-message \
 		onlyoffice.newsyslog.sample
-SUB_LIST=	ETCDIR=${ETCDIR} \
+SUB_LIST=	DS_GROUPNAME=${DS_GROUPNAME} \
+		DS_USERNAME=${DS_USERNAME} \
+		ETCDIR=${ETCDIR} \
 		PREFIX=${PREFIX} \
 		WWWDIR=${WWWDIR}
 
-# node version used with "npm install pkg@5.5.1"
-NODE_VERSION_PKGFETCH=	16.13.0
+# node version used with "npm install @yao-pkg/pkg@5.11.1"
+# keep in sync with patch-build__tools_scripts_build__server.py and patch-document-server-package_Makefile
+NODE_VERSION_PKGFETCH=	18.18.2
 
-MAKE_ENV=	BUILD_NUMBER="8" \
+MAKE_ENV=	BUILD_NUMBER="36" \
 		PKG_CACHE_PATH=${WRKDIR}/.pkg-cache \
 		PRODUCT_VERSION=${DISTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/} \
 		BUILD_NUMBER=${DISTVERSION:C/^[0-9]+\.[0-9]+\.[0-9]+\.([0-9]+)/\1/}
@@ -178,11 +182,11 @@ do-build:
 
 	@cd ${WRKSRC}/server ; ${SETENV} ${MAKE_ENV} npm install grunt-cli
 	@cd ${WRKSRC}/server ; ${SETENV} ${MAKE_ENV} npm install grunt
-	@cd ${WRKSRC}/server ; ${SETENV} ${MAKE_ENV} npm install pkg@5.5.1
+	@cd ${WRKSRC}/server ; ${SETENV} ${MAKE_ENV} npm install @yao-pkg/pkg@5.11.1
 	@cd ${WRKSRC}/sdkjs  ; ${SETENV} ${MAKE_ENV} npm install grunt-cli
 	@cd ${WRKSRC}/sdkjs  ; ${SETENV} ${MAKE_ENV} npm install grunt
 	@cd ${WRKSRC} && ${PATCH} -N -s -i ${FILESDIR}/extra-patch-pkg-fetch_lib-es5_build.js || ${TRUE}
-	@cd ${WRKSRC} && ${PATCH} -N -s -i ${FILESDIR}/extra-patch-pkg-fetch_patches_node.v16.13.0.cpp.patch || ${TRUE}
+	@cd ${WRKSRC} && ${PATCH} -N -s -i ${FILESDIR}/extra-patch-pkg-fetch_patches_node.v${NODE_VERSION_PKGFETCH}.cpp.patch || ${TRUE}
 
 	cd ${WRKSRC}/build_tools/tools/freebsd ; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} automate.py
 	cd ${WRKSRC}/document-server-package ; ${SETENV} ${MAKE_ENV} ${GMAKE} freebsd
@@ -229,6 +233,7 @@ do-install:
 create-caches-tarball:
 	# do some cleanup first
 	${RM} -r  ${WRKDIR}/.npm/_logs ${WRKDIR}/.npm/_update-notifier-last-checked ${WRKDIR}/.cache/yarn/v6/.tmp ${WRKDIR}/.cache/node-gyp
+#	${FIND} ${WRKDIR}/.cache -type f -perm 755 -exec file {} \; | ${EGREP} "ELF|PE32+|Mach-O" | ${AWK} -F ':' '{print $$1}' | ${XARGS} ${RM}
 	${FIND} ${WRKDIR}/.pkg-cache -type f -perm 755 -exec file {} \; | ${EGREP} "ELF|PE32+|Mach-O" | ${AWK} -F ':' '{print $$1}' | ${XARGS} ${RM}
 
 	cd ${WRKDIR} && \
diff --git a/www/onlyoffice-documentserver/distinfo b/www/onlyoffice-documentserver/distinfo
index 921b6b31f460..62b0c99c5744 100644
--- a/www/onlyoffice-documentserver/distinfo
+++ b/www/onlyoffice-documentserver/distinfo
@@ -1,39 +1,41 @@
-TIMESTAMP = 1692624183
+TIMESTAMP = 1706193245
 SHA256 (v8-8.9.255.25_all.tar.gz) = 54853ef93accc063a82a0dc29457b25c9b6d88315431d62e06ab1f84797c5f80
 SIZE (v8-8.9.255.25_all.tar.gz) = 72818814
-SHA256 (node-v16.13.0.tar.gz) = 9c00e5b6024cfcbc9105f9c58cf160762e78659a345d100c5bd80a7fb38c684f
-SIZE (node-v16.13.0.tar.gz) = 63735070
+SHA256 (node-v18.18.2.tar.gz) = 509cd2cfc3a515bf2257ed3886b9fac64aeaac2a70ea59c0a6e02e2dbb722132
+SIZE (node-v18.18.2.tar.gz) = 86108679
 SHA256 (optipng-0.7.7.tar.gz) = 4f32f233cef870b3f95d3ad6428bfe4224ef34908f1b42b0badf858216654452
 SIZE (optipng-0.7.7.tar.gz) = 2329555
-SHA256 (onlyoffice-documentserver-7.4.1.36-npm-cache.tar.gz) = e6dfc40eb2d9d1fb9b851f81ed1d68b542f645f1e85f3f109a925ecd4fed5b10
-SIZE (onlyoffice-documentserver-7.4.1.36-npm-cache.tar.gz) = 174928467
-SHA256 (ONLYOFFICE-DocumentServer-v7.4.1.36-v7.4.1_GH0.tar.gz) = ffa1241fe661c8682c8bc79ebd3dadab5f10d5e79d11fe554086b658614304b9
-SIZE (ONLYOFFICE-DocumentServer-v7.4.1.36-v7.4.1_GH0.tar.gz) = 68488
-SHA256 (ONLYOFFICE-core-v7.4.1.36_GH0.tar.gz) = 6c769b7a3787f447e2dfa941428b9823842218256988e37a33c5c6a7e267f5f4
-SIZE (ONLYOFFICE-core-v7.4.1.36_GH0.tar.gz) = 88375420
-SHA256 (ONLYOFFICE-core-fonts-v7.4.1.36_GH0.tar.gz) = 93cafc38a5e20c4ea131997cff28b89e4e843b42095e08999eea9001e75a8604
-SIZE (ONLYOFFICE-core-fonts-v7.4.1.36_GH0.tar.gz) = 95368679
-SHA256 (ONLYOFFICE-dictionaries-v7.4.1.36_GH0.tar.gz) = f4af1b203a3c0d2572497879b1928700f9d42297891a690e40b7773c172ede8a
-SIZE (ONLYOFFICE-dictionaries-v7.4.1.36_GH0.tar.gz) = 41115629
-SHA256 (ONLYOFFICE-document-server-integration-v7.4.1.36_GH0.tar.gz) = 74562791097e7e469bd1c325e4cf2a507c60ba38d8e676ed343dcec1224f5906
-SIZE (ONLYOFFICE-document-server-integration-v7.4.1.36_GH0.tar.gz) = 5117960
-SHA256 (ONLYOFFICE-document-templates-v7.4.1.36_GH0.tar.gz) = d70fa06194f76a996ce2ec6e63f6d2b035ceff41bd438b5ff48dc1e7aaedc9d4
-SIZE (ONLYOFFICE-document-templates-v7.4.1.36_GH0.tar.gz) = 2538786
-SHA256 (ONLYOFFICE-sdkjs-v7.4.1.36_GH0.tar.gz) = dc8e9c2220a4c0d60fc09203f3715872e42556e405ea8905428f96b0de8a65e1
-SIZE (ONLYOFFICE-sdkjs-v7.4.1.36_GH0.tar.gz) = 26006443
-SHA256 (ONLYOFFICE-server-v7.4.1.36_GH0.tar.gz) = 16863d15477c77016318f6aa4271a5f47e5780f0e243f13b5de9142c0dc65f96
-SIZE (ONLYOFFICE-server-v7.4.1.36_GH0.tar.gz) = 267465
-SHA256 (ONLYOFFICE-web-apps-v7.4.1.36_GH0.tar.gz) = 8a6e490762a4a5900ab5c464591ed25d30028687e46342938b8fce7cb277f3dc
-SIZE (ONLYOFFICE-web-apps-v7.4.1.36_GH0.tar.gz) = 349418434
-SHA256 (ONLYOFFICE-build_tools-v7.4.1.36_GH0.tar.gz) = aa295c893bfee8a6da36da199bf3621276a269bf78c1da558a768fc5a20b43fd
-SIZE (ONLYOFFICE-build_tools-v7.4.1.36_GH0.tar.gz) = 6657130
+SHA256 (onlyoffice-documentserver-7.5.1.23-npm-cache.tar.gz) = 0ea12b05b9603c61b9c99488608d02d95ab61906c36904920c470cb63aef0fd4
+SIZE (onlyoffice-documentserver-7.5.1.23-npm-cache.tar.gz) = 308147597
+SHA256 (ONLYOFFICE-DocumentServer-v7.5.1.23-v7.5.1_GH0.tar.gz) = 933fd8e4283104d5e0706cc9e0220533a9c3f55057e69f77b8092136de27b001
+SIZE (ONLYOFFICE-DocumentServer-v7.5.1.23-v7.5.1_GH0.tar.gz) = 71562
+SHA256 (ONLYOFFICE-core-v7.5.1.23_GH0.tar.gz) = ec5cd966fa43c423d3a8d6c0dbd498620610e0869aba7f8fafb5b41e58e7ac74
+SIZE (ONLYOFFICE-core-v7.5.1.23_GH0.tar.gz) = 206059993
+SHA256 (ONLYOFFICE-core-fonts-v7.5.1.23_GH0.tar.gz) = 8d2517c342a08421aeefbb1c8789f50ccc2b951b24e48b4352d27f6788fee8a8
+SIZE (ONLYOFFICE-core-fonts-v7.5.1.23_GH0.tar.gz) = 95367302
+SHA256 (ONLYOFFICE-dictionaries-v7.5.1.23_GH0.tar.gz) = bdb056e171ccfd8e66561663c6e15180a19b5a4f586da13d96f2b81b17fc51fe
+SIZE (ONLYOFFICE-dictionaries-v7.5.1.23_GH0.tar.gz) = 41937063
+SHA256 (ONLYOFFICE-document-server-integration-v7.5.1.23_GH0.tar.gz) = 27f89ef2648a0f69d700b4f824c62746ca1bc8a7e49e815427366192d31860b0
+SIZE (ONLYOFFICE-document-server-integration-v7.5.1.23_GH0.tar.gz) = 5146130
+SHA256 (ONLYOFFICE-document-templates-v7.5.1.23_GH0.tar.gz) = 6b9242fa82d424bbdac0c26a8a4e8f43df36dc4df3a358bf628049845ccb43b9
+SIZE (ONLYOFFICE-document-templates-v7.5.1.23_GH0.tar.gz) = 2538779
+SHA256 (ONLYOFFICE-sdkjs-v7.5.1.23_GH0.tar.gz) = 0388cd8b584cc352097174770fd590d23c250ebb3e1d3dc49fe8fb0ae17d40c0
+SIZE (ONLYOFFICE-sdkjs-v7.5.1.23_GH0.tar.gz) = 28394630
+SHA256 (ONLYOFFICE-server-v7.5.1.23_GH0.tar.gz) = a8c369aa6a5a60a9e22d0d1d95797ec2d01d7fca6397b02bdc701750b97e6161
+SIZE (ONLYOFFICE-server-v7.5.1.23_GH0.tar.gz) = 325836
+SHA256 (ONLYOFFICE-web-apps-v7.5.1.23_GH0.tar.gz) = 0b81d1a16310342ff3ce0fbdadf1175bc3a37ec07f20a76e0a139fd9cb62ff84
+SIZE (ONLYOFFICE-web-apps-v7.5.1.23_GH0.tar.gz) = 374968895
+SHA256 (ONLYOFFICE-build_tools-v7.5.1.23_GH0.tar.gz) = f663f6899da881cf07a5a9d1ae5ba4073c810b84dfe5901a7711a2796600b42d
+SIZE (ONLYOFFICE-build_tools-v7.5.1.23_GH0.tar.gz) = 6675376
 SHA256 (ONLYOFFICE-DocumentBuilder-626d1e44db3d06ceb8298215a67ef0475912d89a_GH0.tar.gz) = 275c3a8c993528fa56c69aedb11dd74a6fba9c3bd372874004584ae9cbb190b5
 SIZE (ONLYOFFICE-DocumentBuilder-626d1e44db3d06ceb8298215a67ef0475912d89a_GH0.tar.gz) = 31659
 SHA256 (ONLYOFFICE-onlyoffice.github.io-b26d001664d771df4f663d2d3ba7dd4a188b6cab_GH0.tar.gz) = 347b8f1d3c21b1f61a3f1fcae86f402b27ce4f8b826e18158834251046d83cf5
 SIZE (ONLYOFFICE-onlyoffice.github.io-b26d001664d771df4f663d2d3ba7dd4a188b6cab_GH0.tar.gz) = 17009005
-SHA256 (ONLYOFFICE-document-server-package-v7.4.1.36_GH0.tar.gz) = f8d4a6296aa5a86159a020b79f6064cd720c1ce6c39ce4118aa3405e96652452
-SIZE (ONLYOFFICE-document-server-package-v7.4.1.36_GH0.tar.gz) = 155635
+SHA256 (ONLYOFFICE-document-server-package-v7.5.1.23_GH0.tar.gz) = 062626a760476a3c785e229c89a0d1a696cfe0ada6caae6a175366fb12990b1b
+SIZE (ONLYOFFICE-document-server-package-v7.5.1.23_GH0.tar.gz) = 163520
 SHA256 (jasenhuang-katana-parser-be6df45_GH0.tar.gz) = 363ede45ba6d125fdb7323c43d34acd3d0ae9028ac18aec632eb6a623160f09a
 SIZE (jasenhuang-katana-parser-be6df45_GH0.tar.gz) = 97712
 SHA256 (google-gumbo-parser-aa91b27_GH0.tar.gz) = 1360f85c02fb2573a10f00abcddebc8f1ff277a16f66553439193af93afae335
 SIZE (google-gumbo-parser-aa91b27_GH0.tar.gz) = 2119417
+SHA256 (hunspell-hyphen-73dd296_GH0.tar.gz) = 93e80ad69ee7afd507b12f0b58ca34a6a78347dcbb5fe5d9b6f0e19b02397ef7
+SIZE (hunspell-hyphen-73dd296_GH0.tar.gz) = 292528
diff --git a/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_patches_node.v16.13.0.cpp.patch b/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_patches_node.v16.13.0.cpp.patch
deleted file mode 100644
index c380dd286e54..000000000000
--- a/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_patches_node.v16.13.0.cpp.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-https://github.com/vercel/pkg-fetch/blob/main/patches/node.v16.14.2.cpp.patch
-+ local FreeBSD patches
-
-
---- server/node_modules/pkg-fetch/patches/node.v16.13.0.cpp.patch.orig	2021-12-30 20:04:18.203959000 +0100
-+++ server/node_modules/pkg-fetch/patches/node.v16.13.0.cpp.patch	2021-12-30 20:09:53.210319000 +0100
-@@ -1,5 +1,5 @@
----- node/common.gypi
--+++ node/common.gypi
-+--- common.gypi.orig	2021-10-26 14:00:54.000000000 +0200
-++++ common.gypi	2023-07-18 12:52:05.744323000 +0200
- @@ -171,7 +171,7 @@
-                'MSVC_runtimeType': 2   # MultiThreadedDLL (/MD)
-              }],
-@@ -9,6 +9,15 @@ +              'lto': ' -flto=4 -ffat-lto-objects ', #
-              }, {
-                'lto': ' -flto ', # Clang
-              }],
-+@@ -386,7 +386,7 @@
-+       }],
-+       [ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', {
-+         'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
-+-        'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++14' ],
-++        'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++14', '-Wno-error=enum-constexpr-conversion' ],
-+         'defines': [ '__STDC_FORMAT_MACROS' ],
-+         'ldflags': [ '-rdynamic' ],
-+         'target_conditions': [
- --- node/deps/v8/include/v8.h
- +++ node/deps/v8/include/v8.h
- @@ -10092,6 +10092,10 @@ class V8_EXPORT V8 {
-@@ -521,6 +530,174 @@ +            'cflags_cc': [ '-frtti', '-fno-lto' ],
-              'cflags_cc!': [ '-fno-rtti' ],
-            }],
-            [ 'OS == "mac" or OS == "ios"', {
-+--- node/deps/openssl/config/archs/linux-elf/no-asm/openssl-cl.gypi.orig	2019-08-06 20:46:23 UTC
-++++ node/deps/openssl/config/archs/linux-elf/no-asm/openssl-cl.gypi
-+@@ -12,7 +12,7 @@
-+       '-Wall -O3 -fomit-frame-pointer',
-+     ],
-+     'openssl_ex_libs_linux-elf': [
-+-      '-ldl -pthread',
-++      '-pthread',
-+     ],
-+     'openssl_cli_srcs_linux-elf': [
-+       'openssl/apps/asn1pars.c',
-+--- node/deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi.orig	2021-03-17 20:16:25 UTC
-++++ node/deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi
-+@@ -698,7 +698,7 @@
-+       '-Wall -O3 -fomit-frame-pointer',
-+     ],
-+     'openssl_ex_libs_linux-elf': [
-+-      '-ldl -pthread',
-++      '-pthread',
-+     ],
-+   },
-+   'include_dirs': [
-+--- node/deps/openssl/openssl_no_asm.gypi.orig	2020-09-08 12:17:11 UTC
-++++ node/deps/openssl/openssl_no_asm.gypi
-+@@ -48,7 +48,7 @@
-+       'includes': ['config/archs/linux64-mips64/no-asm/openssl.gypi'],
-+     }, {
-+       # Other architectures don't use assembly
-+-      'includes': ['config/archs/linux-x86_64/no-asm/openssl.gypi'],
-++      'includes': ['config/archs/linux-elf/no-asm/openssl.gypi'],
-+     }],
-+   ],
-+ }
-+--- node/deps/openssl/openssl-cl_no_asm.gypi.orig	2020-09-08 12:17:10 UTC
-++++ node/deps/openssl/openssl-cl_no_asm.gypi
-+@@ -1,4 +1,5 @@
-+ {
-++  'defines': ['OPENSSL_NO_ASM'],
-+   'conditions': [
-+     ['target_arch=="ppc" and OS=="aix"', {
-+       'includes': ['config/archs/aix-gcc/no-asm/openssl-cl.gypi'],
-+@@ -47,7 +48,7 @@
-+       'includes': ['config/archs/linux64-mips64/no-asm/openssl-cl.gypi'],
-+     }, {
-+       # Other architectures don't use assembly
-+-      'includes': ['config/archs/linux-x86_64/no-asm/openssl-cl.gypi'],
-++      'includes': ['config/archs/linux-elf/no-asm/openssl-cl.gypi'],
-+     }],
-+   ],
-+ }
-+--- node/deps/v8/src/base/platform/platform-freebsd.cc.orig	2020-06-30 17:49:16 UTC
-++++ node/deps/v8/src/base/platform/platform-freebsd.cc
-+@@ -82,8 +82,8 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLib
-+             lib_name = std::string(path);
-+           }
-+           result.push_back(SharedLibraryAddress(
-+-              lib_name, reinterpret_cast<uintptr_t>(map->kve_start),
-+-              reinterpret_cast<uintptr_t>(map->kve_end)));
-++              lib_name, static_cast<uintptr_t>(map->kve_start),
-++              static_cast<uintptr_t>(map->kve_end)));
-+         }
-+ 
-+         start += ssize;
-+@@ -94,6 +94,48 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLib
-+ }
-+ 
-+ void OS::SignalCodeMovingGC() {}
-++
-++#ifdef __arm__
-++
-++bool OS::ArmUsingHardFloat() {
-++// GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify
-++// the Floating Point ABI used (PCS stands for Procedure Call Standard).
-++// We use these as well as a couple of other defines to statically determine
-++// what FP ABI used.
-++// GCC versions 4.4 and below don't support hard-fp.
-++// GCC versions 4.5 may support hard-fp without defining __ARM_PCS or
-++// __ARM_PCS_VFP.
-++
-++#define GCC_VERSION \
-++  (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
-++#if GCC_VERSION >= 40600 && !defined(__clang__)
-++#if defined(__ARM_PCS_VFP)
-++  return true;
-++#else
-++  return false;
-++#endif
-++
-++#elif GCC_VERSION < 40500 && !defined(__clang__)
-++  return false;
-++
-++#else
-++#if defined(__ARM_PCS_VFP)
-++  return true;
-++#elif defined(__ARM_PCS) || defined(__SOFTFP__) || defined(__SOFTFP) || \
-++    !defined(__VFP_FP__)
-++  return false;
-++#else
-++#error \
-++    "Your version of compiler does not report the FP ABI compiled for."     \
-++       "Please report it on this issue"                                        \
-++       "http://code.google.com/p/v8/issues/detail?id=2140"
-++
-++#endif
-++#endif
-++#undef GCC_VERSION
-++}
-++
-++#endif // def __arm__
-+ 
-+ void OS::AdjustSchedulingParams() {}
-+ 
-+--- node/deps/v8/src/codegen/ppc/constants-ppc.h.orig	2020-06-30 17:49:17 UTC
-++++ node/deps/v8/src/codegen/ppc/constants-ppc.h
-+@@ -36,7 +36,7 @@
-+ #endif
-+ 
-+ #if !(V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) || !V8_TARGET_ARCH_PPC64 || \
-+-    V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)
-++    (defined(_CALL_ELF) && _CALL_ELF == 2)
-+ #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
-+ #else
-+ #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
-+@@ -44,7 +44,7 @@
-+ 
-+ #if !(V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) || \
-+     (V8_TARGET_ARCH_PPC64 &&                     \
-+-     (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
-++     (defined(_CALL_ELF) && _CALL_ELF == 2))
-+ #define ABI_CALL_VIA_IP 1
-+ #else
-+ #define ABI_CALL_VIA_IP 0
-+--- node/deps/v8/src/libsampler/sampler.cc.orig	2021-10-08 13:38:46 UTC
-++++ node/deps/v8/src/libsampler/sampler.cc
-+@@ -490,6 +490,10 @@ void SignalHandler::FillRegisterState(void* context, R
-+   state->pc = reinterpret_cast<void*>(mcontext.__gregs[_REG_PC]);
-+   state->sp = reinterpret_cast<void*>(mcontext.__gregs[_REG_SP]);
-+   state->fp = reinterpret_cast<void*>(mcontext.__gregs[_REG_FP]);
-++#elif V8_TARGET_ARCH_PPC64
-++  state->pc = reinterpret_cast<void*>(mcontext.mc_srr0);
-++  state->sp = reinterpret_cast<void*>(mcontext.mc_frame[1]);
-++  state->fp = reinterpret_cast<void*>(mcontext.mc_frame[31]);
-+ #endif  // V8_HOST_ARCH_*
-+ #elif V8_OS_NETBSD
-+ #if V8_HOST_ARCH_IA32
-+--- node/node.gypi.orig	2021-03-03 05:40:19 UTC
-++++ node/node.gypi
-+@@ -319,6 +319,9 @@
-+     [ 'node_use_openssl=="true"', {
-+       'defines': [ 'HAVE_OPENSSL=1' ],
-+       'conditions': [
-++        ['openssl_no_asm==1', {
-++          'defines': [ 'OPENSSL_NO_ASM' ],
-++        }],
-+         [ 'node_shared_openssl=="false"', {
-+           'dependencies': [
-+             './deps/openssl/openssl.gyp:openssl',
-+--- node/src/cares_wrap.h.orig	2021-08-18 22:13:12 UTC
-++++ node/src/cares_wrap.h
-+@@ -22,7 +22,7 @@
-+ # include <netdb.h>
-+ #endif  // __POSIX__
-+ 
-+-# include <ares_nameser.h>
-++# include <arpa/nameser.h>
-+ 
-+ namespace node {
-+ namespace cares_wrap {
- --- node/deps/openssl/config/archs/linux-elf/no-asm/openssl-cl.gypi.orig	2019-08-06 20:46:23 UTC
- +++ node/deps/openssl/config/archs/linux-elf/no-asm/openssl-cl.gypi
- @@ -12,7 +12,7 @@
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
new file mode 100644
index 000000000000..bb6f26770a3b
--- /dev/null
+++ b/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_patches_node.v18.18.2.cpp.patch
@@ -0,0 +1,189 @@
+https://github.com/vercel/pkg-fetch/blob/main/patches/node.v18.5.0.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
+@@ -11,6 +11,15 @@ +              'lto': ' -flto=4 -ffat-lto-objects ', #
+              }, {
+                'lto': ' -flto ', # Clang
+              }],
++@@ -399,7 +399,7 @@
++       }],
++       [ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', {
++         'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
++-        'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ],
+++        'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17', '-Wno-error=enum-constexpr-conversion' ],
++         'defines': [ '__STDC_FORMAT_MACROS' ],
++         'ldflags': [ '-rdynamic' ],
++         'target_conditions': [
+ diff --git node/configure.py node/configure.py
+ index 62c01aaf6a..2913940692 100755
+ --- node/configure.py
+@@ -579,3 +588,166 @@ +            'cflags_cc': [ '-frtti', '-fno-lto' ],
+              'cflags_cc!': [ '-fno-rtti' ],
+            }],
+            [ 'OS == "mac" or OS == "ios"', {
++--- nodes/deps/openssl/config/archs/linux-elf/no-asm/openssl-cl.gypi.orig	2023-04-12 04:09:13 UTC
+++++ nodes/deps/openssl/config/archs/linux-elf/no-asm/openssl-cl.gypi
++@@ -13,7 +13,7 @@
++       '-Wall -O3 -fomit-frame-pointer',
++     ],
++     'openssl_ex_libs_linux-elf': [
++-      '-ldl -pthread',
+++      '-pthread',
++     ],
++     'openssl_cli_srcs_linux-elf': [
++       'openssl/apps/lib/cmp_mock_srv.c',
++--- nodes/deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi.orig	2023-04-12 04:09:13 UTC
+++++ nodes/deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi
++@@ -977,7 +977,7 @@
++       '-Wall -O3 -fomit-frame-pointer',
++     ],
++     'openssl_ex_libs_linux-elf': [
++-      '-ldl -pthread',
+++      '-pthread',
++     ],
++   },
++   'include_dirs': [
++--- nodes/deps/openssl/openssl_no_asm.gypi.orig	2023-04-12 04:09:14 UTC
+++++ nodes/deps/openssl/openssl_no_asm.gypi
++@@ -44,7 +44,7 @@
++       'includes': ['config/archs/linux64-riscv64/no-asm/openssl.gypi'],
++     }, {
++       # Other architectures don't use assembly
++-      'includes': ['config/archs/linux-x86_64/no-asm/openssl.gypi'],
+++      'includes': ['config/archs/linux-elf/no-asm/openssl.gypi'],
++     }],
++   ],
++ }
++--- nodes/deps/openssl/openssl-cl_no_asm.gypi.orig	2023-04-12 04:09:13 UTC
+++++ nodes/deps/openssl/openssl-cl_no_asm.gypi
++@@ -1,4 +1,5 @@
++ {
+++  'defines': ['OPENSSL_NO_ASM'],
++   'conditions': [
++     ['target_arch=="ppc64" and OS=="aix"', {
++       'includes': ['config/archs/aix64-gcc-as/no-asm/openssl-cl.gypi'],
++@@ -43,7 +44,7 @@
++       'includes': ['config/archs/linux64-riscv64/no-asm/openssl-cl.gypi'],
++     }, {
++       # Other architectures don't use assembly
++-      'includes': ['config/archs/linux-x86_64/no-asm/openssl-cl.gypi'],
+++      'includes': ['config/archs/linux-elf/no-asm/openssl-cl.gypi'],
++     }],
++   ],
++ }
++--- nodes/deps/v8/src/base/platform/platform-freebsd.cc.orig	2023-04-12 04:09:14 UTC
+++++ nodes/deps/v8/src/base/platform/platform-freebsd.cc
++@@ -82,8 +82,8 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLib
++             lib_name = std::string(path);
++           }
++           result.push_back(SharedLibraryAddress(
++-              lib_name, reinterpret_cast<uintptr_t>(map->kve_start),
++-              reinterpret_cast<uintptr_t>(map->kve_end)));
+++              lib_name, static_cast<uintptr_t>(map->kve_start),
+++              static_cast<uintptr_t>(map->kve_end)));
++         }
++ 
++         start += ssize;
++--- nodes/deps/v8/src/codegen/arm/cpu-arm.cc.orig	2023-04-12 04:09:15 UTC
+++++ nodes/deps/v8/src/codegen/arm/cpu-arm.cc
++@@ -2,12 +2,15 @@
++ // Use of this source code is governed by a BSD-style license that can be
++ // found in the LICENSE file.
++ 
+++#include "include/v8config.h"
+++
++ // CPU specific code for arm independent of OS goes here.
++ #ifdef __arm__
++ #ifdef __QNXNTO__
++ #include <sys/mman.h>  // for cache flushing.
++ #undef MAP_TYPE
++ #elif V8_OS_FREEBSD
+++#include <sys/cdefs.h>
++ #include <machine/sysarch.h>  // for cache flushing
++ #include <sys/types.h>
++ #elif V8_OS_STARBOARD
++--- nodes/deps/v8/src/codegen/ppc/constants-ppc.h.orig	2023-04-12 04:09:15 UTC
+++++ nodes/deps/v8/src/codegen/ppc/constants-ppc.h
++@@ -36,7 +36,7 @@
++ #endif
++ 
++ #if !(V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) || !V8_TARGET_ARCH_PPC64 || \
++-    V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)
+++    (defined(_CALL_ELF) && _CALL_ELF == 2)
++ #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
++ #else
++ #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
++@@ -44,7 +44,7 @@
++ 
++ #if !(V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) || \
++     (V8_TARGET_ARCH_PPC64 &&                     \
++-     (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
+++     (defined(_CALL_ELF) && _CALL_ELF == 2))
++ #define ABI_CALL_VIA_IP 1
++ #else
++ #define ABI_CALL_VIA_IP 0
++--- nodes/deps/v8/src/libsampler/sampler.cc.orig	2023-04-12 04:09:15 UTC
+++++ nodes/deps/v8/src/libsampler/sampler.cc
++@@ -497,6 +497,10 @@ void SignalHandler::FillRegisterState(void* context, R
++   state->pc = reinterpret_cast<void*>(mcontext.__gregs[_REG_PC]);
++   state->sp = reinterpret_cast<void*>(mcontext.__gregs[_REG_SP]);
++   state->fp = reinterpret_cast<void*>(mcontext.__gregs[_REG_FP]);
+++#elif V8_TARGET_ARCH_PPC64
+++  state->pc = reinterpret_cast<void*>(mcontext.mc_srr0);
+++  state->sp = reinterpret_cast<void*>(mcontext.mc_frame[1]);
+++  state->fp = reinterpret_cast<void*>(mcontext.mc_frame[31]);
++ #endif  // V8_HOST_ARCH_*
++ #elif V8_OS_NETBSD
++ #if V8_HOST_ARCH_IA32
++--- nodes/node.gypi.orig	2023-04-12 04:09:19 UTC
+++++ nodes/node.gypi
++@@ -349,6 +349,9 @@
++     [ 'node_use_openssl=="true"', {
++       'defines': [ 'HAVE_OPENSSL=1' ],
++       'conditions': [
+++        ['openssl_no_asm==1', {
+++          'defines': [ 'OPENSSL_NO_ASM' ],
+++        }],
++         [ 'node_shared_openssl=="false"', {
++           'defines': [ 'OPENSSL_API_COMPAT=0x10100000L', ],
++           'dependencies': [
++--- nodes/src/crypto/crypto_util.cc.orig	2023-04-12 04:09:19 UTC
+++++ nodes/src/crypto/crypto_util.cc
++@@ -195,10 +195,12 @@ void InitCryptoOnce() {
++   // No-op with OPENSSL_NO_COMP builds of OpenSSL.
++   sk_SSL_COMP_zero(SSL_COMP_get_compression_methods());
++ 
+++#if OPENSSL_VERSION_MAJOR < 3
++ #ifndef OPENSSL_NO_ENGINE
++   ERR_load_ENGINE_strings();
++   ENGINE_load_builtin_engines();
++ #endif  // !OPENSSL_NO_ENGINE
+++#endif
++ }
++ 
++ void GetFipsCrypto(const FunctionCallbackInfo<Value>& args) {
++--- nodes/src/cares_wrap.h.orig	2023-04-12 04:09:19 UTC
+++++ nodes/src/cares_wrap.h
++@@ -23,7 +23,7 @@
++ # include <netdb.h>
++ #endif  // __POSIX__
++ 
++-# include <ares_nameser.h>
+++# include <arpa/nameser.h>
++ 
++ namespace node {
++ namespace cares_wrap {
++--- nodes/tools/v8_gypfiles/v8.gyp.orig	2023-04-12 04:09:21 UTC
+++++ nodes/tools/v8_gypfiles/v8.gyp
++@@ -977,7 +977,7 @@
++         }],
++         # Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library
++         # to implement atomic memory access
++-        ['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "arm", "riscv64", "loong64"]', {
+++        ['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "riscv64", "loong64"]', {
++           'link_settings': {
++             'libraries': ['-latomic', ],
++           },
diff --git a/www/onlyoffice-documentserver/files/onlyoffice.newsyslog.sample.in b/www/onlyoffice-documentserver/files/onlyoffice.newsyslog.sample.in
index f532e5cec13b..26a8c5f63201 100644
--- a/www/onlyoffice-documentserver/files/onlyoffice.newsyslog.sample.in
+++ b/www/onlyoffice-documentserver/files/onlyoffice.newsyslog.sample.in
@@ -1,3 +1,3 @@
 # logfilename								[owner:group] 		mode	count	size	when	flags	[/pid_file]	[sig_num]
-/var/log/onlyoffice/documentserver/{converter,docservice,metrics}/*.log	%%DS_USERNAME%%:%%DS_GROUPNAME%%	644	7	*	@T00	BGJ	/var/run/supervisor/supervisord.pid
+/var/log/onlyoffice/documentserver/*/*.log	%%DS_USERNAME%%:%%DS_GROUPNAME%%	644	7	*	@T00	BGJ	/var/run/supervisor/supervisord.pid
 /var/log/onlyoffice/documentserver/nginx.error.log			root:wheel		644	7	*	@T00	BGJ	/var/run/nginx.pid
diff --git a/www/onlyoffice-documentserver/files/patch-build__tools_build.pro b/www/onlyoffice-documentserver/files/patch-build__tools_build.pro
index 5e79e0a52e1a..76d36288cb48 100644
--- a/www/onlyoffice-documentserver/files/patch-build__tools_build.pro
+++ b/www/onlyoffice-documentserver/files/patch-build__tools_build.pro
@@ -1,14 +1,21 @@
 --- build_tools/build.pro.orig	2021-12-12 19:27:25 UTC
 +++ build_tools/build.pro
---- build_tools/build.pro.orig	2022-02-28 14:20:10.000000000 +0100
-+++ build_tools/build.pro	2022-03-03 10:11:49.033261000 +0100
-@@ -8,6 +8,9 @@ include($$PWD/common.pri)
- 
- CONFIG += ordered
+@@ -18,6 +18,9 @@ mobile:CONFIG += core_libraries
+ !core_libraries:CONFIG += no_use_common_binary
+ !core_libraries:CONFIG += no_tests
  
 +core_freebsd {
 +       CONFIG += no_desktop_apps
 +}
  core_windows {
- 	desktop:CONFIG += core_and_multimedia
+     desktop:CONFIG += core_and_multimedia
+ }
+@@ -96,8 +99,6 @@ core_libraries {
+     addSubProject(docbuilder,     $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/docbuilder.pro,\
+                                       kernel unicodeconverter graphics doctrenderer)
+     addSubProject(pluginsmanager, $$CORE_ROOT_DIR/DesktopEditor/pluginsmanager/pluginsmanager.pro,\
+-                                      kernel)
+-    addSubProject(vboxtester,     $$CORE_ROOT_DIR/DesktopEditor/vboxtester/vboxtester.pro,\
+                                       kernel)
  }
+ 
diff --git a/www/onlyoffice-documentserver/files/patch-build__tools_scripts_build__server.py b/www/onlyoffice-documentserver/files/patch-build__tools_scripts_build__server.py
index bd76061eef57..b34c4116b61c 100644
--- a/www/onlyoffice-documentserver/files/patch-build__tools_scripts_build__server.py
+++ b/www/onlyoffice-documentserver/files/patch-build__tools_scripts_build__server.py
@@ -14,7 +14,7 @@
        base.copy_file(custom_public_key, server_build_dir + '/Common/sources')
  
 -  pkg_target = "node14"
-+  pkg_target = "node16"
++  pkg_target = "node18"
  
 +  if ("freebsd" == base.host_platform()):
 +    pkg_target += "-freebsd"
diff --git a/www/onlyoffice-documentserver/files/patch-build__tools_scripts_core__common_make__common.py b/www/onlyoffice-documentserver/files/patch-build__tools_scripts_core__common_make__common.py
index af97b8b3caf8..3e01bb6553c1 100644
--- a/www/onlyoffice-documentserver/files/patch-build__tools_scripts_core__common_make__common.py
+++ b/www/onlyoffice-documentserver/files/patch-build__tools_scripts_core__common_make__common.py
@@ -24,10 +24,10 @@
 -import googletest
 +#import hyphen
 +#import googletest
+ import libvlc
  
  def check_android_ndk_macos_arm(dir):
-   if base.is_dir(dir + "/darwin-x86_64") and not base.is_dir(dir + "/darwin-arm64"):
-@@ -35,17 +35,17 @@ def make():
+@@ -36,17 +36,17 @@ def make():
        if base.is_dir(toolchain):
          check_android_ndk_macos_arm(toolchain + "/prebuilt")
  
@@ -50,6 +50,6 @@
 -  googletest.make()
 +#  hyphen.make()
 +#  googletest.make()
-   
-   if config.check_option("module", "mobile"):
-     if (config.check_option("platform", "android")):
+ 
+   if config.check_option("build-libvlc", "1"):
+     libvlc.make()
diff --git a/www/onlyoffice-documentserver/files/patch-build__tools_scripts_core__common_modules_v8__89.py b/www/onlyoffice-documentserver/files/patch-build__tools_scripts_core__common_modules_v8__89.py
index a81cf69c3fdd..40fda1a05917 100644
--- a/www/onlyoffice-documentserver/files/patch-build__tools_scripts_core__common_modules_v8__89.py
+++ b/www/onlyoffice-documentserver/files/patch-build__tools_scripts_core__common_modules_v8__89.py
@@ -1,6 +1,6 @@
 --- build_tools/scripts/core_common/modules/v8_89.py.orig	2023-06-14 09:52:10.504034000 +0200
 +++ build_tools/scripts/core_common/modules/v8_89.py	2023-06-14 11:18:31.776490000 +0200
-@@ -83,39 +83,41 @@ def make():
+@@ -83,40 +83,40 @@ def make():
      base.create_dir(base_dir)
  
    os.chdir(base_dir)
@@ -31,9 +31,10 @@
 +#
 +#  if ("windows" == base.host_platform()):
 +#    base.replaceInFile("v8/build/config/win/BUILD.gn", ":static_crt", ":dynamic_crt")
-+#
 +#    if not base.is_file("v8/src/base/platform/wrappers.cc"):
 +#      base.writeFile("v8/src/base/platform/wrappers.cc", "#include \"src/base/platform/wrappers.h\"\n")
++#  else:
++#    base.replaceInFile("depot_tools/gclient_paths.py", "@functools.lru_cache", "")
 +#
 +#  if not base.is_file("v8/third_party/jinja2/tests.py.bak"):
 +#    base.copy_file("v8/third_party/jinja2/tests.py", "v8/third_party/jinja2/tests.py.bak")
@@ -61,20 +62,19 @@
 -
 -  if ("windows" == base.host_platform()):
 -    base.replaceInFile("v8/build/config/win/BUILD.gn", ":static_crt", ":dynamic_crt")
--
 -    if not base.is_file("v8/src/base/platform/wrappers.cc"):
 -      base.writeFile("v8/src/base/platform/wrappers.cc", "#include \"src/base/platform/wrappers.h\"\n")
+-  else:
+-    base.replaceInFile("depot_tools/gclient_paths.py", "@functools.lru_cache", "")
 -
 -  if not base.is_file("v8/third_party/jinja2/tests.py.bak"):
 -    base.copy_file("v8/third_party/jinja2/tests.py", "v8/third_party/jinja2/tests.py.bak")
 -    base.replaceInFile("v8/third_party/jinja2/tests.py", "from collections import Mapping", "try:\n    from collections.abc import Mapping\nexcept ImportError:\n    from collections import Mapping")
 -
-+# ~/onlyoffice-documentserver-ports/work/DocumentServer-7.4.0/core/Common/3dParty/v8_89_89
-+  print(base_dir)
    os.chdir("v8")
    
    gn_args = ["v8_static_library=true",
-@@ -124,6 +126,10 @@ def make():
+@@ -125,6 +125,10 @@ def make():
               "v8_use_external_startup_data=false",
               "use_custom_libcxx=false",
               "treat_warnings_as_errors=false"]
diff --git a/www/onlyoffice-documentserver/files/patch-core_Common_base.pri b/www/onlyoffice-documentserver/files/patch-core_Common_base.pri
index 5039f27ce84f..dae39d81cc72 100644
--- a/www/onlyoffice-documentserver/files/patch-core_Common_base.pri
+++ b/www/onlyoffice-documentserver/files/patch-core_Common_base.pri
@@ -1,7 +1,7 @@
 --- core/Common/base.pri.orig	2021-09-30 12:13:32 UTC
 +++ core/Common/base.pri
-@@ -79,6 +79,14 @@ android {
-     DEFINES += __ANDROID__ LINUX _LINUX _ARM_ALIGN_
+@@ -97,6 +97,14 @@ android {
+ 	DEFINES += __ANDROID__ LINUX _LINUX _ARM_ALIGN_
  }
  
 +freebsd-clang {
@@ -13,10 +13,10 @@
 +}
 +
  win32:contains(QMAKE_TARGET.arch, x86_64): {
-     CONFIG += core_win_64
+ 	CONFIG += core_win_64
  }
-@@ -165,6 +173,14 @@ core_windows {
-     }
+@@ -167,6 +175,14 @@ core_win_64 {
+ 	DEFINES += WIN64 _WIN64
  }
  
 +core_freebsd {
@@ -28,15 +28,16 @@
 +}
 +
  core_linux {
-     equals(TEMPLATE, app) {
-         QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
-@@ -178,6 +194,9 @@ core_win_32 {
+ 	DEFINES += LINUX _LINUX
  }
- core_win_64 {
-     CORE_BUILDS_PLATFORM_PREFIX = win_64
+@@ -219,6 +235,10 @@ core_windows {
+ 			core_win_32:QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
+ 		}
+ 	}
 +}
++
 +core_freebsd_64 {
 +    CORE_BUILDS_PLATFORM_PREFIX = freebsd_64
  }
- core_linux_32 {
-     CORE_BUILDS_PLATFORM_PREFIX = linux_32
+ 
+ core_linux {
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_AllFontsGen_AllFontsGen.pro b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_AllFontsGen_AllFontsGen.pro
deleted file mode 100644
index c61d42ef881c..000000000000
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_AllFontsGen_AllFontsGen.pro
+++ /dev/null
@@ -1,13 +0,0 @@
---- core/DesktopEditor/AllFontsGen/AllFontsGen.pro.orig	2021-09-30 12:13:32 UTC
-+++ core/DesktopEditor/AllFontsGen/AllFontsGen.pro
-@@ -39,4 +39,10 @@ core_linux {
-     QMAKE_LFLAGS += -Wl,--rpath=./
- }
- 
-+core_freebsd {
-+    LIBS += -lz -pthread -liconv -lharfbuzz
-+
-+    QMAKE_LFLAGS += -Wl,--rpath=./
-+}
-+
- SOURCES += main.cpp
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_allthemesgen_allthemesgen.pro b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_allthemesgen_allthemesgen.pro
deleted file mode 100644
index a8842e4b6f5a..000000000000
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_allthemesgen_allthemesgen.pro
+++ /dev/null
@@ -1,14 +0,0 @@
---- core/DesktopEditor/allthemesgen/allthemesgen.pro.orig	2021-09-30 12:13:32 UTC
-+++ core/DesktopEditor/allthemesgen/allthemesgen.pro
-@@ -33,4 +33,11 @@ core_linux {
-     QMAKE_LFLAGS += -Wl,--rpath=./
- }
- 
-+core_freebsd {
-+    LIBS += -lz -pthread -liconv
-+
-+    QMAKE_LFLAGS += -Wl,--rpath=./
-+}
-+
-+
- SOURCES += main.cpp
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_common_Directory.cpp b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_common_Directory.cpp
index 6b5968db40e1..8677840d1541 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_common_Directory.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_common_Directory.cpp
@@ -1,51 +1,51 @@
 --- core/DesktopEditor/common/Directory.cpp.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/common/Directory.cpp
 @@ -35,7 +35,7 @@
-     #include "windef.h"
-     #include <shlobj.h>
-     #include <Rpc.h>
+ #include "windef.h"
+ #include <shlobj.h>
+ #include <Rpc.h>
 -#elif __linux__
 +#elif defined(__linux__) || defined(__FreeBSD__)
-     #include <sys/types.h>
-     #include <sys/stat.h>
-     #include <unistd.h>
-@@ -121,7 +121,7 @@ namespace NSDirectory
-         FindClose( hRes );
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+@@ -120,7 +120,7 @@ namespace NSDirectory
+ 		FindClose( hRes );
  #endif
  
 -#ifdef __linux__
 +#if defined(__linux__) || defined(__FreeBSD__)
-         BYTE* pUtf8 = NULL;
-         LONG lLen = 0;
-         NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strDirectory.c_str(), strDirectory.length(), pUtf8, lLen, false);
-@@ -236,7 +236,7 @@ namespace NSDirectory
+ 		BYTE* pUtf8 = NULL;
+ 		LONG lLen = 0;
+ 		NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strDirectory.c_str(), strDirectory.length(), pUtf8, lLen, false);
+@@ -235,7 +235,7 @@ namespace NSDirectory
  			}
- 		} while( FindNextFileW( hRes, &oFD ) );		
+ 		} while( FindNextFileW( hRes, &oFD ) );
  		FindClose( hRes );
 -#elif __linux__
 +#elif defined(__linux__) || defined(__FreeBSD__)
  		BYTE* pUtf8 = NULL;
  		LONG lLen = 0;
-         NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strDirectory.c_str(), strDirectory.length(), pUtf8, lLen, false);
-@@ -300,7 +300,7 @@ namespace NSDirectory
+ 		NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strDirectory.c_str(), strDirectory.length(), pUtf8, lLen, false);
+@@ -299,7 +299,7 @@ namespace NSDirectory
  #if defined(_WIN32) || defined (_WIN64)
  		DWORD dwAttrib = ::GetFileAttributesW(strDirectory.c_str());
  		return (dwAttrib != INVALID_FILE_ATTRIBUTES && 0 != (dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
 -#elif __linux__
 +#elif defined(__linux__) || defined(__FreeBSD__)
-         BYTE* pUtf8 = NULL;
-         LONG lLen = 0;
-         NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strDirectory.c_str(), strDirectory.length(), pUtf8, lLen, false);
-@@ -399,7 +399,7 @@ namespace NSDirectory
-         return true;
+ 		BYTE* pUtf8 = NULL;
+ 		LONG lLen = 0;
+ 		NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strDirectory.c_str(), strDirectory.length(), pUtf8, lLen, false);
+@@ -398,7 +398,7 @@ namespace NSDirectory
+ 		return true;
  #endif
  
 -#ifdef __linux__
 +#if defined(__linux__) || defined(__FreeBSD__)
-         BYTE* pUtf8 = NULL;
-         LONG lLen = 0;
-         NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strSrc.c_str(), strSrc.length(), pUtf8, lLen, false);
-@@ -496,14 +496,14 @@ namespace NSDirectory
+ 		BYTE* pUtf8 = NULL;
+ 		LONG lLen = 0;
+ 		NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strSrc.c_str(), strSrc.length(), pUtf8, lLen, false);
+@@ -495,14 +495,14 @@ namespace NSDirectory
  		}
  #if defined(_WIN32) || defined (_WIN64)
  		if (deleteRoot) RemoveDirectoryW(strDirectory.c_str());
@@ -53,12 +53,12 @@
 +#elif defined(__linux__) || defined(__FreeBSD__)
  		BYTE* pUtf8 = NULL;
  		LONG lLen = 0;
-         NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strDirectory.c_str(), strDirectory.length(), pUtf8, lLen, false);
+ 		NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strDirectory.c_str(), strDirectory.length(), pUtf8, lLen, false);
  		rmdir((char*)pUtf8);
  		delete [] pUtf8;
  
 -		if (deleteRoot = false)CreateDirectory(strDirectory);
-+		if (deleteRoot == false) CreateDirectory(strDirectory);
++		if (deleteRoot == false)CreateDirectory(strDirectory);
  #elif MAC
-         BYTE* pUtf8 = NULL;
-         LONG lLen = 0;
+ 		BYTE* pUtf8 = NULL;
+ 		LONG lLen = 0;
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_app__builder_docbuilder.pro b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_app__builder_docbuilder.pro
deleted file mode 100644
index 8208e11fc259..000000000000
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_app__builder_docbuilder.pro
+++ /dev/null
@@ -1,11 +0,0 @@
---- core/DesktopEditor/doctrenderer/app_builder/docbuilder.pro.orig	2021-09-30 12:13:32 UTC
-+++ core/DesktopEditor/doctrenderer/app_builder/docbuilder.pro
-@@ -44,5 +44,8 @@ ADD_DEPENDENCY(graphics, kernel, UnicodeConverter, doc
- core_linux {
-     LIBS += -ldl
- }
-+core_freebsd {
-+    LIBS += -liconv
-+}
- 
- SOURCES += main.cpp
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_fontengine_ApplicationFonts.cpp b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_fontengine_ApplicationFonts.cpp
index be2025080e2d..1b45b66d07a5 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_fontengine_ApplicationFonts.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_fontengine_ApplicationFonts.cpp
@@ -1,22 +1,21 @@
 --- core/DesktopEditor/fontengine/ApplicationFonts.cpp.orig	2022-05-11 19:33:56 UTC
 +++ core/DesktopEditor/fontengine/ApplicationFonts.cpp
-@@ -1595,6 +1595,8 @@ void CApplicationFonts::Initialize(bool bIsCheckSelect
+@@ -1616,6 +1616,8 @@ void CApplicationFonts::Initialize(bool bIsCheckSelect
  
  #if defined(_LINUX) && !defined(_MAC) && !defined(__ANDROID__)
-     m_oList.LoadFromFolder(L"/usr/share/fonts");
+ 	m_oList.LoadFromFolder(L"/usr/share/fonts");
 +#elif defined(__FreeBSD__)
 +    m_oList.LoadFromFolder(L"%%LOCALBASE%%/share/fonts");
  #endif
  
  #if defined(_MAC) && !defined(_IOS)
-@@ -1782,6 +1784,10 @@ std::vector<std::wstring> CApplicationFonts::GetSetupF
-      std::wstring custom_fonts_path = NSSystemUtils::GetEnvVariable(L"CUSTOM_FONTS_PATH");
-      if (!custom_fonts_path.empty())
-         NSDirectory::GetFiles2(custom_fonts_path, _array, true);
-+
+@@ -1802,6 +1804,9 @@ std::vector<std::wstring> CApplicationFonts::GetSetupF
+ 	NSDirectory::GetFiles2(L"/usr/X11R6/lib/X11/fonts", _array, true);
+ 	NSDirectory::GetFiles2(L"/usr/local/share/fonts", _array, true);
+ 	NSDirectory::GetFiles2(L"/run/host/fonts", _array, true);
 +#elif defined(__FreeBSD__)
 +     std::vector<std::wstring> _array = NSDirectory::GetFiles(L"/usr/share/fonts", true);
 +     NSDirectory::GetFiles2(L"%%LOCALBASE%%/share/fonts", _array, true);
- #endif
  
-      return _array;
+ #ifndef BUILDING_WASM_MODULE
+ 	std::wstring custom_fonts_path = NSSystemUtils::GetEnvVariable(L"CUSTOM_FONTS_PATH");
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_raster_Metafile_Common_MetaFileUtils.h b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_raster_Metafile_Common_MetaFileUtils.h
new file mode 100644
index 000000000000..8e0546ee394d
--- /dev/null
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_raster_Metafile_Common_MetaFileUtils.h
@@ -0,0 +1,11 @@
+--- ./core/DesktopEditor/raster/Metafile/Common/MetaFileUtils.h.orig	2023-10-30 16:47:10.672867000 +0100
++++ ./core/DesktopEditor/raster/Metafile/Common/MetaFileUtils.h	2023-10-30 16:47:42.379902000 +0100
+@@ -953,7 +953,7 @@ namespace MetaFile
+ 			}
+ 			else
+ 			{
+-				pRegion->shScanCount = NULL;
++				pRegion->shScanCount = 0;
+ 			}
+ 
+ 
*** 2069 LINES SKIPPED ***