git: db1eae825836 - main - www/onlyoffice-documentserver: fix patches

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Wed, 19 Jan 2022 07:51:31 UTC
The branch main has been updated by mikael:

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

commit db1eae82583624c9f17229e2e057c708cafb10ef
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2022-01-19 07:48:51 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2022-01-19 07:48:51 +0000

    www/onlyoffice-documentserver: fix patches
    
    These patches contains DOS EOL, for whatever reasons git has removed them and put
    Unix EOL instead.
    Restore the DOS EOL.
---
 ...lsFile2_source_XlsFormat_Auxiliary_HelpFunc.cpp |  16 +-
 ...ormat_Logic_Biff__structures_BitMarkedStructs.h |  16 +-
 ...-core_Common_DocxFormat_Source_Base_Types__32.h |  16 +-
 ..._Common_DocxFormat_Source_XlsxFormat_Common.cpp |  24 +-
 ...-core_DesktopEditor_AllFontsGen_AllFontsGen.pro |  22 +-
 ...pEditor_Qt__build_graphics_project_graphics.pri |  26 +-
 ...-core_DesktopEditor_agg-2.4_include_agg__math.h |  18 +-
 ...topEditor_agg-2.4_include_agg__span__gradient.h |  16 +-
 .../files/patch-core_DesktopEditor_common_Types.h  |  18 +-
 ...tch-core_DesktopEditor_cximage_CxImage_ximage.h |  16 +-
 ...-core_DesktopEditor_cximage_CxImage_ximagif.cpp |  18 +-
 ...core_DesktopEditor_cximage_CxImage_ximainfo.cpp |  16 +-
 ...ch-core_DesktopEditor_cximage_CxImage_ximajas.h |  16 +-
 ...-core_DesktopEditor_cximage_CxImage_ximajpg.cpp |  16 +-
 ...ch-core_DesktopEditor_cximage_CxImage_ximajpg.h |  16 +-
 ...-core_DesktopEditor_cximage_CxImage_ximaraw.cpp |  18 +-
 .../patch-core_DesktopEditor_cximage_raw_libdcr.h  |  16 +-
 ...ore_DesktopEditor_doctrenderer_doctrenderer.pro |  22 +-
 ...core_DesktopEditor_doctrenderer_nativecontrol.h |  16 +-
 .../patch-core_DesktopEditor_graphics_Graphics.cpp |  54 +--
 ..._DesktopEditor_raster_Metafile_Wmf_WmfObjects.h |  16 +-
 .../patch-core_DesktopEditor_xml_libxml2_trionan.c |  50 +--
 .../patch-core_DesktopEditor_xml_libxml2_xmlIO.c   |  16 +-
 .../patch-core_DjVuFile_libdjvu_DjVuDocument.cpp   |  16 +-
 .../files/patch-core_HtmlFile_HtmlFile.cpp         |  32 +-
 .../files/patch-core_HtmlFile_HtmlFile.pro         |  22 +-
 .../files/patch-core_PdfWriter_PdfWriter.pro       |  22 +-
 .../files/patch-core_PdfWriter_Src_Types.h         |  16 +-
 ...atch-core_UnicodeConverter_UnicodeConverter.pro |  24 +-
 .../files/patch-document-server-package_Makefile   | 390 ++++++++++-----------
 30 files changed, 500 insertions(+), 500 deletions(-)

diff --git a/www/onlyoffice-documentserver/files/patch-core_ASCOfficeXlsFile2_source_XlsFormat_Auxiliary_HelpFunc.cpp b/www/onlyoffice-documentserver/files/patch-core_ASCOfficeXlsFile2_source_XlsFormat_Auxiliary_HelpFunc.cpp
index cef740914952..d3cd41476819 100644
--- a/www/onlyoffice-documentserver/files/patch-core_ASCOfficeXlsFile2_source_XlsFormat_Auxiliary_HelpFunc.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_ASCOfficeXlsFile2_source_XlsFormat_Auxiliary_HelpFunc.cpp
@@ -1,11 +1,11 @@
 --- core/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp.orig	2021-09-30 12:13:32 UTC
 +++ core/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp
 @@ -359,7 +359,7 @@ const std::wstring unescape_ST_Xstring(const std::wstr
-     while(true)
- 	{
-         
--#if defined(__linux__) || defined(_MAC) || defined(_IOS)
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(_MAC) || defined(_IOS)
- 		const auto it_range = boost::make_iterator_range(x_pos_noncopied, wstr_end);
-         x_pos_next = boost::algorithm::find_first(it_range, L"_x").begin();
- #else
+     while(true)
+ 	{
+         
+-#if defined(__linux__) || defined(_MAC) || defined(_IOS)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(_MAC) || defined(_IOS)
+ 		const auto it_range = boost::make_iterator_range(x_pos_noncopied, wstr_end);
+         x_pos_next = boost::algorithm::find_first(it_range, L"_x").begin();
+ #else
diff --git a/www/onlyoffice-documentserver/files/patch-core_ASCOfficeXlsFile2_source_XlsFormat_Logic_Biff__structures_BitMarkedStructs.h b/www/onlyoffice-documentserver/files/patch-core_ASCOfficeXlsFile2_source_XlsFormat_Logic_Biff__structures_BitMarkedStructs.h
index 9d340b44a9c4..60cd6208ee21 100644
--- a/www/onlyoffice-documentserver/files/patch-core_ASCOfficeXlsFile2_source_XlsFormat_Logic_Biff__structures_BitMarkedStructs.h
+++ b/www/onlyoffice-documentserver/files/patch-core_ASCOfficeXlsFile2_source_XlsFormat_Logic_Biff__structures_BitMarkedStructs.h
@@ -1,11 +1,11 @@
 --- core/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BitMarkedStructs.h.orig	2021-09-30 12:13:32 UTC
 +++ core/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BitMarkedStructs.h
 @@ -31,7 +31,7 @@
-  */
- #pragma once
- 
--#ifdef __linux__
-+#if defined(__linux__) || defined(__FreeBSD__)
-     #include <inttypes.h>
- #endif
- 
+  */
+ #pragma once
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD__)
+     #include <inttypes.h>
+ #endif
+ 
diff --git a/www/onlyoffice-documentserver/files/patch-core_Common_DocxFormat_Source_Base_Types__32.h b/www/onlyoffice-documentserver/files/patch-core_Common_DocxFormat_Source_Base_Types__32.h
index 72f91a5f6717..5735334fe746 100644
--- a/www/onlyoffice-documentserver/files/patch-core_Common_DocxFormat_Source_Base_Types__32.h
+++ b/www/onlyoffice-documentserver/files/patch-core_Common_DocxFormat_Source_Base_Types__32.h
@@ -1,11 +1,11 @@
 --- core/Common/DocxFormat/Source/Base/Types_32.h.orig	2021-09-30 12:13:32 UTC
 +++ core/Common/DocxFormat/Source/Base/Types_32.h
 @@ -38,7 +38,7 @@
- 	typedef unsigned __int16	_UINT16;
- 	typedef unsigned __int32	_UINT32;
- 	typedef unsigned __int64	_UINT64;
--#elif __linux__
-+#elif defined(__linux__) || defined(__FreeBSD__)
-         typedef int16_t             _INT16;
-         typedef int32_t             _INT32;
-         typedef int64_t             _INT64;
+ 	typedef unsigned __int16	_UINT16;
+ 	typedef unsigned __int32	_UINT32;
+ 	typedef unsigned __int64	_UINT64;
+-#elif __linux__
++#elif defined(__linux__) || defined(__FreeBSD__)
+         typedef int16_t             _INT16;
+         typedef int32_t             _INT32;
+         typedef int64_t             _INT64;
diff --git a/www/onlyoffice-documentserver/files/patch-core_Common_DocxFormat_Source_XlsxFormat_Common.cpp b/www/onlyoffice-documentserver/files/patch-core_Common_DocxFormat_Source_XlsxFormat_Common.cpp
index 1664a82534cc..cace7f660efc 100644
--- a/www/onlyoffice-documentserver/files/patch-core_Common_DocxFormat_Source_XlsxFormat_Common.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_Common_DocxFormat_Source_XlsxFormat_Common.cpp
@@ -1,14 +1,14 @@
 --- core/Common/DocxFormat/Source/XlsxFormat/Common.cpp.orig	2021-09-30 12:13:32 UTC
 +++ core/Common/DocxFormat/Source/XlsxFormat/Common.cpp
-@@ -48,6 +48,11 @@ char* gcvt(double x, int n, char* b)
- #define _gcvt gcvt
- #endif
- 
-+#ifdef __FreeBSD__
-+#define _gcvt(x,n,b) sprintf(b, "%.17g", x)
-+#endif
-+
-+
- #define DBL_MAX 15
- #define DBL_MAXDIG10 17
- 
+@@ -48,6 +48,11 @@ char* gcvt(double x, int n, char* b)
+ #define _gcvt gcvt
+ #endif
+ 
++#ifdef __FreeBSD__
++#define _gcvt(x,n,b) sprintf(b, "%.17g", x)
++#endif
++
++
+ #define DBL_MAX 15
+ #define DBL_MAXDIG10 17
+ 
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_AllFontsGen_AllFontsGen.pro b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_AllFontsGen_AllFontsGen.pro
index f9ce4e00a40d..ee78ce131650 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_AllFontsGen_AllFontsGen.pro
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_AllFontsGen_AllFontsGen.pro
@@ -1,13 +1,13 @@
 --- 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
-+
-+    QMAKE_LFLAGS += -Wl,--rpath=./
-+}
-+
- SOURCES += main.cpp
+@@ -39,4 +39,10 @@ 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_Qt__build_graphics_project_graphics.pri b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_Qt__build_graphics_project_graphics.pri
index eba647e3a9a5..5d8637009884 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_Qt__build_graphics_project_graphics.pri
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_Qt__build_graphics_project_graphics.pri
@@ -1,15 +1,15 @@
 --- core/DesktopEditor/Qt_build/graphics/project/graphics.pri.orig	2021-12-18 10:21:34 UTC
 +++ core/DesktopEditor/Qt_build/graphics/project/graphics.pri
-@@ -9,6 +9,12 @@ DEFINES += \
-     MNG_STORE_CHUNKS\
-     MNG_ERROR_TELLTALE
- 
-+core_freebsd {
-+    DEFINES += \
-+    HAVE_UNISTD_H
-+    QMAKE_CXXFLAGS += -Wno-narrowing
-+}
-+
- core_linux {
-     DEFINES += \
-     HAVE_UNISTD_H
+@@ -9,6 +9,12 @@ DEFINES += \
+     MNG_STORE_CHUNKS\
+     MNG_ERROR_TELLTALE
+ 
++core_freebsd {
++    DEFINES += \
++    HAVE_UNISTD_H
++    QMAKE_CXXFLAGS += -Wno-narrowing
++}
++
+ core_linux {
+     DEFINES += \
+     HAVE_UNISTD_H
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_agg-2.4_include_agg__math.h b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_agg-2.4_include_agg__math.h
index 684d5f4128ba..1a918610ec3c 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_agg-2.4_include_agg__math.h
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_agg-2.4_include_agg__math.h
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/agg-2.4/include/agg_math.h.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/agg-2.4/include/agg_math.h
-@@ -431,7 +431,7 @@ namespace agg
-         }
-     }
- 
--#if defined(_LINUX) || defined(__APPLE__)
-+#if defined(_LINUX) || defined(__APPLE__) || defined(__FreeBSD__)
-     inline double _hypot(const double& x, const double& y)
-     {
-         return sqrt(x * x + y * y);
+@@ -431,7 +431,7 @@ namespace agg
+         }
+     }
+ 
+-#if defined(_LINUX) || defined(__APPLE__)
++#if defined(_LINUX) || defined(__APPLE__) || defined(__FreeBSD__)
+     inline double _hypot(const double& x, const double& y)
+     {
+         return sqrt(x * x + y * y);
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_agg-2.4_include_agg__span__gradient.h b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_agg-2.4_include_agg__span__gradient.h
index f553a4b47e22..9de020f3981f 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_agg-2.4_include_agg__span__gradient.h
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_agg-2.4_include_agg__span__gradient.h
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/agg-2.4/include/agg_span_gradient.h.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/agg-2.4/include/agg_span_gradient.h
 @@ -24,7 +24,7 @@
- 
- namespace agg
- {
--#if !defined(_LINUX) && !(defined(_WIN32) || defined (_WIN64)) && !defined(__APPLE__)
-+#if !defined(_LINUX) && !defined(__FreeBSD__) && !(defined(_WIN32) || defined (_WIN64)) && !defined(__APPLE__)
-     double _hypot(double x, double y)
-     {
-         return sqrt(x*x + y*y);
+ 
+ namespace agg
+ {
+-#if !defined(_LINUX) && !(defined(_WIN32) || defined (_WIN64)) && !defined(__APPLE__)
++#if !defined(_LINUX) && !defined(__FreeBSD__) && !(defined(_WIN32) || defined (_WIN64)) && !defined(__APPLE__)
+     double _hypot(double x, double y)
+     {
+         return sqrt(x*x + y*y);
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_common_Types.h b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_common_Types.h
index 64628b8b347e..d66f9352be6a 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_common_Types.h
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_common_Types.h
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/common/Types.h.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/common/Types.h
-@@ -78,7 +78,7 @@ typedef int				INT;
- typedef unsigned int	UINT, *PUINT;
- typedef wchar_t			WCHAR;
- 
--#ifdef __linux__
-+#if defined(__linux__) || defined(__FreeBSD__)
- #include <inttypes.h>
- typedef int64_t     T_LONG64;
- typedef uint64_t    T_ULONG64;
+@@ -78,7 +78,7 @@ typedef int				INT;
+ typedef unsigned int	UINT, *PUINT;
+ typedef wchar_t			WCHAR;
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD__)
+ #include <inttypes.h>
+ typedef int64_t     T_LONG64;
+ typedef uint64_t    T_ULONG64;
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximage.h b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximage.h
index 9524e192a3a6..9c456ba6439e 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximage.h
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximage.h
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/cximage/CxImage/ximage.h.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/cximage/CxImage/ximage.h
 @@ -52,7 +52,7 @@
- #pragma once
- #endif 
- 
--#ifdef _LINUX
-+#if defined(_LINUX) || defined(__FreeBSD__)
-   #define _XOPEN_SOURCE
-   #include <unistd.h>
-   #include <arpa/inet.h>
+ #pragma once
+ #endif 
+ 
+-#ifdef _LINUX
++#if defined(_LINUX) || defined(__FreeBSD__)
+   #define _XOPEN_SOURCE
+   #include <unistd.h>
+   #include <arpa/inet.h>
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximagif.cpp b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximagif.cpp
index 66fe0dc726a2..03c6b8f87ee6 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximagif.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximagif.cpp
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/cximage/CxImage/ximagif.cpp.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/cximage/CxImage/ximagif.cpp
-@@ -86,7 +86,7 @@ namespace NSGeneratePalette
- 
-                 if ( ( X + Width ) > SrcWidth || ( Y + Height ) > SrcHeigth || NULL == pSrc )
-                 {
--                    return NULL;
-+                    return false;
-                 }
- 
-                 (*pImage)	=	new CImage8bit ();
+@@ -86,7 +86,7 @@ namespace NSGeneratePalette
+ 
+                 if ( ( X + Width ) > SrcWidth || ( Y + Height ) > SrcHeigth || NULL == pSrc )
+                 {
+-                    return NULL;
++                    return false;
+                 }
+ 
+                 (*pImage)	=	new CImage8bit ();
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximainfo.cpp b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximainfo.cpp
index e43e4a709e59..22bba16a7d0d 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximainfo.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximainfo.cpp
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/cximage/CxImage/ximainfo.cpp.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/cximage/CxImage/ximainfo.cpp
 @@ -5,7 +5,7 @@
- 
- #include "ximage.h"
- 
--#if defined(_LINUX) || defined(__APPLE__)
-+#if defined(_LINUX) || defined(__APPLE__) || defined(__FreeBSD__)
-     #ifdef UNICODE
-         #define _tcsnicmp(a,b,c) wcscasecmp(a,b)
-     #else
+ 
+ #include "ximage.h"
+ 
+-#if defined(_LINUX) || defined(__APPLE__)
++#if defined(_LINUX) || defined(__APPLE__) || defined(__FreeBSD__)
+     #ifdef UNICODE
+         #define _tcsnicmp(a,b,c) wcscasecmp(a,b)
+     #else
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajas.h b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajas.h
index 19abc5808fe9..326417be59d2 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajas.h
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajas.h
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/cximage/CxImage/ximajas.h.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/cximage/CxImage/ximajas.h
 @@ -16,7 +16,7 @@
- 
- #if CXIMAGE_SUPPORT_JASPER
- 
--#ifdef _LINUX
-+#if defined(_LINUX) || defined(__FreeBSD__)
-  #include <jasper/jasper.h>
- #else
-  #include "../jasper/include/jasper/jasper.h"
+ 
+ #if CXIMAGE_SUPPORT_JASPER
+ 
+-#ifdef _LINUX
++#if defined(_LINUX) || defined(__FreeBSD__)
+  #include <jasper/jasper.h>
+ #else
+  #include "../jasper/include/jasper/jasper.h"
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajpg.cpp b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajpg.cpp
index d0db2f2dc2aa..a42fe97596e4 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajpg.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajpg.cpp
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/cximage/CxImage/ximajpg.cpp.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/cximage/CxImage/ximajpg.cpp
 @@ -9,7 +9,7 @@
- 
- #if CXIMAGE_SUPPORT_JPG
- 
--#ifdef _LINUX
-+#if defined(_LINUX) || defined(__FreeBSD__)
-  #include <jmorecfg.h>
- #else
-  #include "../jpeg/jmorecfg.h"
+ 
+ #if CXIMAGE_SUPPORT_JPG
+ 
+-#ifdef _LINUX
++#if defined(_LINUX) || defined(__FreeBSD__)
+  #include <jmorecfg.h>
+ #else
+  #include "../jpeg/jmorecfg.h"
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajpg.h b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajpg.h
index 00ebc02759f2..ce9bbf9133a0 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajpg.h
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximajpg.h
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/cximage/CxImage/ximajpg.h.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/cximage/CxImage/ximajpg.h
 @@ -29,7 +29,7 @@
- #define CXIMAGEJPG_SUPPORT_EXIF CXIMAGE_SUPPORT_EXIF
- 
- extern "C" {
--#ifdef _LINUX
-+#if defined(_LINUX) || defined(__FreeBSD__)
-  #include <jpeglib.h>
-  #include <jerror.h>
- #else
+ #define CXIMAGEJPG_SUPPORT_EXIF CXIMAGE_SUPPORT_EXIF
+ 
+ extern "C" {
+-#ifdef _LINUX
++#if defined(_LINUX) || defined(__FreeBSD__)
+  #include <jpeglib.h>
+  #include <jerror.h>
+ #else
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximaraw.cpp b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximaraw.cpp
index 7031bf6c1c90..69a06c648c92 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximaraw.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_CxImage_ximaraw.cpp
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/cximage/CxImage/ximaraw.cpp.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/cximage/CxImage/ximaraw.cpp
-@@ -200,7 +200,7 @@ bool CxImageRAW::Decode(CxFile *hFile)
- 				for (c=0; c < dcr.colors; c++) ppm2[col*dcr.colors+c] = dcr.image[soff][c];
- 		}
- 		if (dcr.opt.output_bps == 16 && !dcr.opt.output_tiff && htons(0x55aa) != 0x55aa)
--#if defined(_LINUX) || defined(__APPLE__)
-+#if defined(_LINUX) || defined(__APPLE__) || defined(__FreeBSD__)
- 			swab ((char*)ppm2, (char*)ppm2, dcr.width*dcr.colors*2);
- #else
- 			_swab ((char*)ppm2, (char*)ppm2, dcr.width*dcr.colors*2);
+@@ -200,7 +200,7 @@ bool CxImageRAW::Decode(CxFile *hFile)
+ 				for (c=0; c < dcr.colors; c++) ppm2[col*dcr.colors+c] = dcr.image[soff][c];
+ 		}
+ 		if (dcr.opt.output_bps == 16 && !dcr.opt.output_tiff && htons(0x55aa) != 0x55aa)
+-#if defined(_LINUX) || defined(__APPLE__)
++#if defined(_LINUX) || defined(__APPLE__) || defined(__FreeBSD__)
+ 			swab ((char*)ppm2, (char*)ppm2, dcr.width*dcr.colors*2);
+ #else
+ 			_swab ((char*)ppm2, (char*)ppm2, dcr.width*dcr.colors*2);
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_raw_libdcr.h b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_raw_libdcr.h
index ca503ff79dff..f1a48f2877b7 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_raw_libdcr.h
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_cximage_raw_libdcr.h
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/cximage/raw/libdcr.h.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/cximage/raw/libdcr.h
 @@ -50,7 +50,7 @@
-  #include <sys/types.h>
- #endif
- 
--#if defined(_LINUX) || defined(__APPLE__)
-+#if defined(_LINUX) || defined(__APPLE__) || defined(__FreeBSD__)
-  #include <setjmp.h>
-  #include <sys/types.h>
-  #define _getcwd getcwd
+  #include <sys/types.h>
+ #endif
+ 
+-#if defined(_LINUX) || defined(__APPLE__)
++#if defined(_LINUX) || defined(__APPLE__) || defined(__FreeBSD__)
+  #include <setjmp.h>
+  #include <sys/types.h>
+  #define _getcwd getcwd
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_doctrenderer.pro b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_doctrenderer.pro
index 4bfecfbe14e1..65b767b6f979 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_doctrenderer.pro
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_doctrenderer.pro
@@ -1,13 +1,13 @@
 --- core/DesktopEditor/doctrenderer/doctrenderer.pro.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/doctrenderer/doctrenderer.pro
-@@ -65,6 +65,10 @@ SOURCES += \
-     embed/NativeControlEmbed.cpp \
-     embed/NativeBuilderEmbed.cpp
- 
-+core_freebsd {
-+    LIBS += -lexecinfo
-+}
-+
- core_mac {
-     !use_v8:CONFIG += use_javascript_core
- }
+@@ -65,6 +65,10 @@ SOURCES += \
+     embed/NativeControlEmbed.cpp \
+     embed/NativeBuilderEmbed.cpp
+ 
++core_freebsd {
++    LIBS += -lexecinfo
++}
++
+ core_mac {
+     !use_v8:CONFIG += use_javascript_core
+ }
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_nativecontrol.h b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_nativecontrol.h
index 90958a75b7e6..7d97c0c4ebcd 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_nativecontrol.h
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_doctrenderer_nativecontrol.h
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/doctrenderer/nativecontrol.h.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/doctrenderer/nativecontrol.h
 @@ -327,7 +327,7 @@ class CNativeControl (public)
- 
-             if (m_map_access_directories.end() == m_map_access_directories.find(NSFile::GetDirectoryName(strFile)))
-             {
--                *pData = NULL;
-+                pData = NULL;
-                 dwLen = 0;
-                 return;
-             }
+ 
+             if (m_map_access_directories.end() == m_map_access_directories.find(NSFile::GetDirectoryName(strFile)))
+             {
+-                *pData = NULL;
++                pData = NULL;
+                 dwLen = 0;
+                 return;
+             }
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_graphics_Graphics.cpp b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_graphics_Graphics.cpp
index e5cebc0af7f7..02dfd9b4d41c 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_graphics_Graphics.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_graphics_Graphics.cpp
@@ -1,29 +1,29 @@
 --- core/DesktopEditor/graphics/Graphics.cpp.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/graphics/Graphics.cpp
-@@ -60,7 +60,7 @@ namespace Aggplus
- 		m_dGlobalAlpha		= 1.0;
-         m_bSwapRGB = false;
- 
--#if defined (_LINUX) || defined (_QT)
-+#if defined (_LINUX) || defined (_QT) || defined(__FreeBSD__)
-         m_bSwapRGB = true;
- #endif
- 
-@@ -93,7 +93,7 @@ namespace Aggplus
- 
-         m_bSwapRGB = false;
- 
--#if defined (_LINUX) || defined (_QT)
-+#if defined (_LINUX) || defined (_QT) || defined(__FreeBSD__)
-         m_bSwapRGB = true;
- #endif
- 
-@@ -131,7 +131,7 @@ namespace Aggplus
- 
-         m_bSwapRGB = false;
- 
--#if defined (_LINUX) || defined (_QT)
-+#if defined (_LINUX) || defined (_QT) || defined(_FreeBSD__)
-         m_bSwapRGB = true;
- #endif
- 
+@@ -60,7 +60,7 @@ namespace Aggplus
+ 		m_dGlobalAlpha		= 1.0;
+         m_bSwapRGB = false;
+ 
+-#if defined (_LINUX) || defined (_QT)
++#if defined (_LINUX) || defined (_QT) || defined(__FreeBSD__)
+         m_bSwapRGB = true;
+ #endif
+ 
+@@ -93,7 +93,7 @@ namespace Aggplus
+ 
+         m_bSwapRGB = false;
+ 
+-#if defined (_LINUX) || defined (_QT)
++#if defined (_LINUX) || defined (_QT) || defined(__FreeBSD__)
+         m_bSwapRGB = true;
+ #endif
+ 
+@@ -131,7 +131,7 @@ namespace Aggplus
+ 
+         m_bSwapRGB = false;
+ 
+-#if defined (_LINUX) || defined (_QT)
++#if defined (_LINUX) || defined (_QT) || defined(_FreeBSD__)
+         m_bSwapRGB = true;
+ #endif
+ 
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_raster_Metafile_Wmf_WmfObjects.h b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_raster_Metafile_Wmf_WmfObjects.h
index 7f27cd6ed557..65f026033d2e 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_raster_Metafile_Wmf_WmfObjects.h
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_raster_Metafile_Wmf_WmfObjects.h
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/raster/Metafile/Wmf/WmfObjects.h.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/raster/Metafile/Wmf/WmfObjects.h
 @@ -37,7 +37,7 @@
- 
- #include "WmfTypes.h"
- 
--#ifdef __linux__
-+#ifdef __linux__ || __FreeBSD__
-     #include <string.h> //memset oO
- #endif
- namespace MetaFile
+ 
+ #include "WmfTypes.h"
+ 
+-#ifdef __linux__
++#ifdef __linux__ || __FreeBSD__
+     #include <string.h> //memset oO
+ #endif
+ namespace MetaFile
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_xml_libxml2_trionan.c b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_xml_libxml2_trionan.c
index 284767c9b463..ae0d8e3e4fc8 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_xml_libxml2_trionan.c
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_xml_libxml2_trionan.c
@@ -1,29 +1,29 @@
 --- core/DesktopEditor/xml/libxml2/trionan.c.orig	2021-09-30 12:13:32 UTC
 +++ core/DesktopEditor/xml/libxml2/trionan.c
 @@ -51,7 +51,7 @@
- # include <signal.h>
- #endif
- #if defined(TRIO_COMPILER_DECC)
--#  if defined(__linux__)
-+#  if defined(__linux__) || defined(__FreeBSD__)
- #   include <cpml.h>
- #  else
- #   include <fp_class.h>
+ # include <signal.h>
+ #endif
+ #if defined(TRIO_COMPILER_DECC)
+-#  if defined(__linux__)
++#  if defined(__linux__) || defined(__FreeBSD__)
+ #   include <cpml.h>
+ #  else
+ #   include <fp_class.h>
 @@ -85,7 +85,7 @@
- #    error "Must be compiled with option -ieee"
- #   endif
- #  endif
--# elif defined(TRIO_COMPILER_GCC) && (defined(__osf__) || defined(__linux__))
-+# elif defined(TRIO_COMPILER_GCC) && (defined(__osf__) || defined(__linux__)) || defined(__FreeBSD__)
- #  error "Must be compiled with option -mieee"
- # endif
- #endif /* __alpha && ! _IEEE_FP */
-@@ -443,7 +443,7 @@ trio_isinf
- TRIO_ARGS1((number),
- 	   double number)
- {
--#if defined(TRIO_COMPILER_DECC) && !defined(__linux__)
-+#if defined(TRIO_COMPILER_DECC) && !defined(__linux__) && !defined(__FreeBSD__)
-   /*
-    * DECC has an isinf() macro, but it works differently than that
-    * of C99, so we use the fp_class() function instead.
+ #    error "Must be compiled with option -ieee"
+ #   endif
+ #  endif
+-# elif defined(TRIO_COMPILER_GCC) && (defined(__osf__) || defined(__linux__))
++# elif defined(TRIO_COMPILER_GCC) && (defined(__osf__) || defined(__linux__)) || defined(__FreeBSD__)
+ #  error "Must be compiled with option -mieee"
+ # endif
+ #endif /* __alpha && ! _IEEE_FP */
+@@ -443,7 +443,7 @@ trio_isinf
+ TRIO_ARGS1((number),
+ 	   double number)
+ {
+-#if defined(TRIO_COMPILER_DECC) && !defined(__linux__)
++#if defined(TRIO_COMPILER_DECC) && !defined(__linux__) && !defined(__FreeBSD__)
+   /*
+    * DECC has an isinf() macro, but it works differently than that
+    * of C99, so we use the fp_class() function instead.
diff --git a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_xml_libxml2_xmlIO.c b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_xml_libxml2_xmlIO.c
index 59eca688cbb7..879460131dd6 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_xml_libxml2_xmlIO.c
+++ b/www/onlyoffice-documentserver/files/patch-core_DesktopEditor_xml_libxml2_xmlIO.c
@@ -1,11 +1,11 @@
 --- core/DesktopEditor/xml/libxml2/xmlIO.c.orig	2021-12-24 14:29:10 UTC
 +++ core/DesktopEditor/xml/libxml2/xmlIO.c
 @@ -43,7 +43,7 @@
- #include <windows.h>
- #include "io.h"
- #endif
--#if defined(__linux__)
-+#if defined(__linux__) || defined(__FreeBSD__)
- #include "unistd.h"
- #endif
- 
+ #include <windows.h>
+ #include "io.h"
+ #endif
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__FreeBSD__)
+ #include "unistd.h"
+ #endif
+ 
diff --git a/www/onlyoffice-documentserver/files/patch-core_DjVuFile_libdjvu_DjVuDocument.cpp b/www/onlyoffice-documentserver/files/patch-core_DjVuFile_libdjvu_DjVuDocument.cpp
index 54666478e8a1..f013fbc3d42d 100644
--- a/www/onlyoffice-documentserver/files/patch-core_DjVuFile_libdjvu_DjVuDocument.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_DjVuFile_libdjvu_DjVuDocument.cpp
@@ -1,11 +1,11 @@
 --- core/DjVuFile/libdjvu/DjVuDocument.cpp.orig	2021-09-30 12:13:32 UTC
 +++ core/DjVuFile/libdjvu/DjVuDocument.cpp
 @@ -78,7 +78,7 @@
- 
- #include "debug.h"
- 
--#if defined(__linux__) || defined(LINUX)
-+#if defined(__linux__) || defined(LINUX) || defined(__FreeBSD__)
- typedef unsigned int	UINT;
- #endif
- 
+ 
+ #include "debug.h"
+ 
+-#if defined(__linux__) || defined(LINUX)
++#if defined(__linux__) || defined(LINUX) || defined(__FreeBSD__)
+ typedef unsigned int	UINT;
+ #endif
+ 
diff --git a/www/onlyoffice-documentserver/files/patch-core_HtmlFile_HtmlFile.cpp b/www/onlyoffice-documentserver/files/patch-core_HtmlFile_HtmlFile.cpp
index 92564f172b48..8fd12f4ba23c 100644
--- a/www/onlyoffice-documentserver/files/patch-core_HtmlFile_HtmlFile.cpp
+++ b/www/onlyoffice-documentserver/files/patch-core_HtmlFile_HtmlFile.cpp
@@ -1,20 +1,20 @@
 --- core/HtmlFile/HtmlFile.cpp.orig	2021-09-30 12:13:32 UTC
 +++ core/HtmlFile/HtmlFile.cpp
 @@ -45,7 +45,7 @@
- #include <vector>
- #include <map>
- 
--#ifdef LINUX
-+#if defined(LINUX) || defined(__FreeBSD__)
- #include <unistd.h>
- #include <sys/wait.h>
- #include <stdio.h>
+ #include <vector>
+ #include <map>
+ 
+-#ifdef LINUX
++#if defined(LINUX) || defined(__FreeBSD__)
+ #include <unistd.h>
+ #include <sys/wait.h>
+ #include <stdio.h>
 @@ -475,7 +475,7 @@ int CHtmlFile::Convert(const std::vector<std::wstring>
-     NSFile::CFileBinary::Remove(sTempFileForParams);
- #endif
- 
--#ifdef LINUX
-+#if defined(LINUX) || defined(__FreeBSD__)
-     std::wstring sTempFileForParams = NSFile::CFileBinary::CreateTempFileWithUniqueName(NSFile::CFileBinary::GetTempPath(), L"XML");
-     NSFile::CFileBinary oFile;
-     oFile.CreateFileW(sTempFileForParams);
+     NSFile::CFileBinary::Remove(sTempFileForParams);
+ #endif
+ 
+-#ifdef LINUX
++#if defined(LINUX) || defined(__FreeBSD__)
+     std::wstring sTempFileForParams = NSFile::CFileBinary::CreateTempFileWithUniqueName(NSFile::CFileBinary::GetTempPath(), L"XML");
+     NSFile::CFileBinary oFile;
+     oFile.CreateFileW(sTempFileForParams);
diff --git a/www/onlyoffice-documentserver/files/patch-core_HtmlFile_HtmlFile.pro b/www/onlyoffice-documentserver/files/patch-core_HtmlFile_HtmlFile.pro
index ed15e47677cf..47ea99170330 100644
--- a/www/onlyoffice-documentserver/files/patch-core_HtmlFile_HtmlFile.pro
+++ b/www/onlyoffice-documentserver/files/patch-core_HtmlFile_HtmlFile.pro
@@ -1,13 +1,13 @@
 --- core/HtmlFile/HtmlFile.pro.orig	2021-09-30 12:13:32 UTC
 +++ core/HtmlFile/HtmlFile.pro
-@@ -18,6 +18,10 @@ include(../Common/base.pri)
- 
- ADD_DEPENDENCY(kernel, UnicodeConverter)
- 
-+core_freebsd {
-+    DEFINES += asc_static_link_libstd
-+}
-+
- core_linux {
-     DEFINES += asc_static_link_libstd
- }
+@@ -18,6 +18,10 @@ include(../Common/base.pri)
+ 
+ ADD_DEPENDENCY(kernel, UnicodeConverter)
+ 
++core_freebsd {
++    DEFINES += asc_static_link_libstd
++}
++
+ core_linux {
+     DEFINES += asc_static_link_libstd
+ }
diff --git a/www/onlyoffice-documentserver/files/patch-core_PdfWriter_PdfWriter.pro b/www/onlyoffice-documentserver/files/patch-core_PdfWriter_PdfWriter.pro
index 1c222da9b63f..efdd428f2f43 100644
--- a/www/onlyoffice-documentserver/files/patch-core_PdfWriter_PdfWriter.pro
+++ b/www/onlyoffice-documentserver/files/patch-core_PdfWriter_PdfWriter.pro
@@ -1,13 +1,13 @@
 --- core/PdfWriter/PdfWriter.pro.orig	2021-12-18 11:22:47 UTC
 +++ core/PdfWriter/PdfWriter.pro
-@@ -22,6 +22,10 @@ LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCryptoPPLib
- 
- DEFINES += NOMINMAX
- 
-+core_freebsd{
-+    DEFINES += HAVE_UNISTD_H HAVE_FCNTL_H
-+    QMAKE_CXXFLAGS += -Wno-narrowing
-+}
- core_linux {
-     DEFINES += HAVE_UNISTD_H HAVE_FCNTL_H
-     QMAKE_CXXFLAGS += -Wno-narrowing
+@@ -22,6 +22,10 @@ LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCryptoPPLib
+ 
+ DEFINES += NOMINMAX
+ 
++core_freebsd{
++    DEFINES += HAVE_UNISTD_H HAVE_FCNTL_H
++    QMAKE_CXXFLAGS += -Wno-narrowing
++}
+ core_linux {
+     DEFINES += HAVE_UNISTD_H HAVE_FCNTL_H
+     QMAKE_CXXFLAGS += -Wno-narrowing
diff --git a/www/onlyoffice-documentserver/files/patch-core_PdfWriter_Src_Types.h b/www/onlyoffice-documentserver/files/patch-core_PdfWriter_Src_Types.h
index c5b7896ece93..9c36ae592384 100644
--- a/www/onlyoffice-documentserver/files/patch-core_PdfWriter_Src_Types.h
+++ b/www/onlyoffice-documentserver/files/patch-core_PdfWriter_Src_Types.h
@@ -1,11 +1,11 @@
 --- core/PdfWriter/Src/Types.h.orig	2021-09-30 12:13:32 UTC
 +++ core/PdfWriter/Src/Types.h
 @@ -46,7 +46,7 @@
- #include <algorithm>
- #include <math.h>
- 
--#ifdef __linux__
-+#if defined(__linux__) || defined(__FreeBSD__)
- #include <string.h>
- #endif
- 
+ #include <algorithm>
+ #include <math.h>
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD__)
+ #include <string.h>
+ #endif
+ 
diff --git a/www/onlyoffice-documentserver/files/patch-core_UnicodeConverter_UnicodeConverter.pro b/www/onlyoffice-documentserver/files/patch-core_UnicodeConverter_UnicodeConverter.pro
index a81ffd2115af..0c5e2c1fa9ab 100644
--- a/www/onlyoffice-documentserver/files/patch-core_UnicodeConverter_UnicodeConverter.pro
+++ b/www/onlyoffice-documentserver/files/patch-core_UnicodeConverter_UnicodeConverter.pro
@@ -1,14 +1,14 @@
 --- core/UnicodeConverter/UnicodeConverter.pro.orig	2021-09-30 12:13:32 UTC
 +++ core/UnicodeConverter/UnicodeConverter.pro
-@@ -15,6 +15,11 @@ include(../Common/base.pri)
- DEFINES += UNICODECONVERTER_USE_DYNAMIC_LIBRARY
- ADD_DEPENDENCY(kernel)
- 
-+core_freebsd {    
-+    QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
-+    QMAKE_LFLAGS += -Wl,--disable-new-dtags
-+}
-+
- core_linux {    
-     QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
-     QMAKE_LFLAGS += -Wl,--disable-new-dtags
+@@ -15,6 +15,11 @@ include(../Common/base.pri)
+ DEFINES += UNICODECONVERTER_USE_DYNAMIC_LIBRARY
+ ADD_DEPENDENCY(kernel)
+ 
++core_freebsd {    
++    QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
++    QMAKE_LFLAGS += -Wl,--disable-new-dtags
++}
++
+ core_linux {    
+     QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
+     QMAKE_LFLAGS += -Wl,--disable-new-dtags
diff --git a/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile b/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile
index b10c92599df0..ce2721b5599d 100644
--- a/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile
+++ b/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile
@@ -1,197 +1,197 @@
 --- document-server-package/Makefile.orig	2021-09-28 10:03:34 UTC
 +++ document-server-package/Makefile
-@@ -134,6 +134,21 @@ else
- 		DS_EXAMLE := /var/www/$(DS_PREFIX)-example
- 		DEV_NULL := /dev/null
- 	endif
-+	ifeq ($(UNAME_S),FreeBSD)
-+		PLATFORM := freebsd
-+		SHARED_EXT := .so*
-+		SHELL_EXT := .sh
-+		ARCH_EXT := .zip
-+		AR := 7z a -y
-+		PACKAGES = tar
-+		DS_PREFIX := $(COMPANY_NAME_LOW)/$(PRODUCT_SHORT_NAME_LOW)
-+		NGINX_CONF := /usr/local/etc/nginx/includes
-+		NGINX_LOG := /var/log/$(DS_PREFIX)
-+		DS_ROOT := /usr/local/www/$(DS_PREFIX)
-+		DS_FILES := /var/db/$(DS_PREFIX)
-+		DS_EXAMLE := /usr/local/www/$(DS_PREFIX)-example
-+		DEV_NULL := /dev/null
-+	endif
- 	ifeq ($(UNAME_S),Darwin)
- 		PLATFORM := mac
- 		SHARED_EXT := .dylib
-@@ -152,6 +167,12 @@ else
- 	ifeq ($(UNAME_P),x86_64)
- 		ARCHITECTURE := 64
- 	endif
-+	ifeq ($(UNAME_P),amd64)
-+		ARCHITECTURE := 64
-+	endif
-+	ifeq ($(UNAME_P),aarch64)
-+		ARCHITECTURE := 64
-+	endif
- 	ifneq ($(filter %86,$(UNAME_P)),)
- 		ARCHITECTURE := 32
- 	endif
-@@ -293,7 +314,7 @@ clean:
- 		
- documentserver:
- 	mkdir -p $(DOCUMENTSERVER_FILES)
--	cp -rf -t $(DOCUMENTSERVER) ../build_tools/out/$(TARGET)/$(COMPANY_NAME_LOW)/$(PRODUCT_SHORT_NAME_LOW)/*
-+	cp -rf ../build_tools/out/$(TARGET)/$(COMPANY_NAME_LOW)/$(PRODUCT_SHORT_NAME_LOW)/* $(DOCUMENTSERVER)
- 
- 	mkdir -p $(DOCUMENTSERVER_CONFIG)
- 	mkdir -p $(DOCUMENTSERVER_CONFIG)/log4js
-@@ -302,25 +323,25 @@ documentserver:
- 	mv -f $(DOCUMENTSERVER)/server/Common/config/log4js/*.json $(DOCUMENTSERVER_CONFIG)/log4js/
- 
- 	# rename product specific folders
--	sed "s|onlyoffice\/documentserver|"$(DS_PREFIX)"|"  -i $(DOCUMENTSERVER_CONFIG)/*.json
-+	sed -i '' "s|onlyoffice\/documentserver|"$(DS_PREFIX)"|" $(DOCUMENTSERVER_CONFIG)/*.json
- 
- 	# rename db account params
--	sed 's|\("db.*": "\)onlyoffice\("\)|\1'$(ONLYOFFICE_VALUE)'\2|'  -i $(DOCUMENTSERVER_CONFIG)/*.json
-+	sed -i '' 's|\("db.*": "\)onlyoffice\("\)|\1'$(ONLYOFFICE_VALUE)'\2|' $(DOCUMENTSERVER_CONFIG)/*.json
- 
- 	# rename db schema name
--	sed 's|onlyoffice|'$(ONLYOFFICE_VALUE)'|'  -i $(DOCUMENTSERVER)/server/schema/**/*.sql
-+	sed -i '' 's|onlyoffice|'$(ONLYOFFICE_VALUE)'|' $(DOCUMENTSERVER)/server/schema/**/*.sql
- 
- 	# ignore CREATE DATABASE commands in MySQL
--	sed -r "s/^(CREATE DATABASE|USE)/-- \1/" -i $(DOCUMENTSERVER)/server/schema/mysql/*.sql
-+	sed -i '' -r "s/^(CREATE DATABASE|USE)/-- \1/" $(DOCUMENTSERVER)/server/schema/mysql/*.sql
- 
- 	# rename product in license
--	sed 's|ONLYOFFICE|'$(COMPANY_NAME)'|'  -i $(DOCUMENTSERVER)/server/3rd-Party.txt
--	sed 's|DocumentServer|'$(PRODUCT_NAME)'|'  -i $(DOCUMENTSERVER)/server/3rd-Party.txt
-+	sed -i '' 's|ONLYOFFICE|'$(COMPANY_NAME)'|' $(DOCUMENTSERVER)/server/3rd-Party.txt
-+	sed -i '' 's|DocumentServer|'$(PRODUCT_NAME)'|' $(DOCUMENTSERVER)/server/3rd-Party.txt
- 
- 	# Prevent for modification original config
- 	chmod ug=r $(DOCUMENTSERVER_CONFIG)/*.json
- 
--	cp -fr -t $(DOCUMENTSERVER) $(3RD_PARTY_LICENSE_FILES)
-+	cp -fr $(3RD_PARTY_LICENSE_FILES) $(DOCUMENTSERVER)
- 	rm -fr $(3RD_PARTY_LICENSE_FILES)
- 
- ifeq ($(PLATFORM),win)
-@@ -329,33 +350,33 @@ ifeq ($(PLATFORM),win)
- 	cat exe/license/3rd-Party.txt ; >> $(DOCUMENTSERVER)/3rd-Party.txt
- endif
- 
--	[ -f $(LICENSE_FILE) ] && cp -fr -t $(DOCUMENTSERVER) $(LICENSE_FILE) || true
-+	[ -f $(LICENSE_FILE) ] && cp -fr $(LICENSE_FILE) $(DOCUMENTSERVER) || true
- 
- 	chmod u+x $(DOCUMENTSERVER)/server/FileConverter/bin/x2t$(EXEC_EXT)
- 	#chmod u+x $(DOCUMENTSERVER)/server/FileConverter/bin/docbuilder$(EXEC_EXT)
- 	[ -f $(HTMLFILEINTERNAL)$(EXEC_EXT) ] && chmod u+x $(HTMLFILEINTERNAL)$(EXEC_EXT) || true
- 	chmod u+x $(DOCUMENTSERVER)/server/tools/allfontsgen$(EXEC_EXT)
- 
--	sed "s|\(_dc=\)0|\1"$(PACKAGE_VERSION)"|"  -i $(DOCUMENTSERVER)/web-apps/apps/api/documents/api.js
-+	sed -i '' "s|\(_dc=\)0|\1"$(PACKAGE_VERSION)"|" $(DOCUMENTSERVER)/web-apps/apps/api/documents/api.js
- 
- ifeq ($(PRODUCT_NAME_LOW), documentserver)
--	sed 's|\("packageType": \)[0-9]\+\(.*\)|\10\2|' -i $(DOCUMENTSERVER_CONFIG)/*.json
--	sed 's|\("editorDataStorage": "\).\+\(".*\)|\1editorDataMemory\2|' -i $(DOCUMENTSERVER_CONFIG)/*.json
-+	sed -i '' 's|\("packageType": \)[0-9]\+\(.*\)|\10\2|' $(DOCUMENTSERVER_CONFIG)/*.json
-+	sed -i '' 's|\("editorDataStorage": "\).\+\(".*\)|\1editorDataMemory\2|' $(DOCUMENTSERVER_CONFIG)/*.json
- endif
- 
- ifeq ($(PRODUCT_NAME_LOW), $(filter $(PRODUCT_NAME_LOW),documentserver-ee documentserver-ie))
*** 290 LINES SKIPPED ***