www/onlyoffice-documentserver: Add new port

ONLYOFFICE Document Server is an online office suite comprising viewers and
editors for texts, spreadsheets and presentations, fully compatible with
Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing
in real time.

WWW: https://www.onlyoffice.com/

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D33923
This commit is contained in:
Mikael Urankar 2022-01-18 15:42:42 +01:00
parent 4a590f670b
commit e6f2735684
128 changed files with 29848 additions and 2 deletions

2
GIDs
View File

@ -242,7 +242,7 @@ owncast:*:299:
backuppc:*:300:
openvpn:*:301:
netdata:*:302:
# free: 303
onlyoffice:*:303:www
# free: 304
# free: 305
# free: 306

2
UIDs
View File

@ -247,7 +247,7 @@ owncast:*:299:299::0:0:& daemon:/nonexistent:/usr/sbin/nologin
backuppc:*:300:300::0:0:BackupPC pseudo-user:/nonexistent:/usr/sbin/nologin
openvpn:*:301:301::0:0:OpenVPN pseudo-user:/nonexistent:/usr/sbin/nologin
netdata:*:302:302::0:0:NetData Daemon:/var/cache/netdata:/usr/sbin/nologin
# free: 303
onlyoffice:*:303:303::0:0:Onlyoffice pseudo-user:/usr/local/www/onlyoffice/documentserver:/usr/sbin/nologin
# free: 304
# free: 305
# free: 306

View File

@ -476,6 +476,7 @@
SUBDIR += oneshot
SUBDIR += onionbalance
SUBDIR += onionshare
SUBDIR += onlyoffice-documentserver
SUBDIR += openarc
SUBDIR += opencart
SUBDIR += orangehrm

View File

@ -0,0 +1,208 @@
PORTNAME= onlyoffice-documentserver
DISTVERSIONPREFIX= v
DISTVERSION= 6.4.2
CATEGORIES= www
MASTER_SITES+= LOCAL/mikael/v8/:source1 \
LOCAL/mikael/onlyoffice/:source2 \
https://nodejs.org/dist/v16.13.0/:source3 \
SF/optipng/OptiPNG/optipng-0.7.7/:source4
DISTFILES+= v8-8.7.220.31_all.tar.gz:source1 \
node-v16.13.0.tar.gz:source3 \
npm-cache-onlyoffice.tar.gz:source2 \
optipng-0.7.7.tar.gz:source4
MAINTAINER= mikael@FreeBSD.org
COMMENT= Secure office and productivity apps
LICENSE= AGPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Jinja2>=0:devel/py-Jinja2@${PY_FLAVOR} \
binutils>=0:devel/binutils \
boost-libs>0:devel/boost-libs \
glib>=2.54:devel/glib20 \
gn:devel/gn \
java:java/openjdk11 \
ninja:devel/ninja \
node:www/node16 \
npm:www/npm-node16
LIB_DEPENDS= libboost_regex.so:devel/boost-libs \
libiconv.so:converters/libiconv \
libicutu.so:devel/icu
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}supervisor>0:sysutils/py-supervisor@${PY_FLAVOR} \
curl:ftp/curl \
gsed:textproc/gsed \
nginx:www/nginx \
pg_dump:databases/postgresql${PGSQL_VER_NODOT}-server \
rabbitmq>0:net/rabbitmq \
webfonts>=0:x11-fonts/webfonts
USES= autoreconf:build dos2unix fakeroot gmake gnome iconv pgsql pkgconfig \
python:3.7+,build qt:5
USE_QT= qmake_build
USE_GITHUB= yes
GH_ACCOUNT= ONLYOFFICE
GH_PROJECT= DocumentServer
GH_TUPLE= ONLYOFFICE:core:0c29e4d:core/core \
ONLYOFFICE:core-fonts:3929a09:corefonts/core-fonts \
ONLYOFFICE:dictionaries:cfa50d3:dictionaries/dictionaries \
ONLYOFFICE:document-server-integration:v1.0.0:dsi/document-server-integration \
ONLYOFFICE:document-templates:v6.4.2.1:dt/document-templates \
ONLYOFFICE:sdkjs:9af7d08:sdkjs/sdkjs \
ONLYOFFICE:server:10929a0:server/server \
ONLYOFFICE:web-apps:1851cae:webapps/web-apps \
ONLYOFFICE:plugin-highlightcode:7ea4ddf:sdkjs_plugins_highlightcode/sdkjs-plugins/plugin-highlightcode \
ONLYOFFICE:plugin-macros:4027439:sdkjs_plugins_macros/sdkjs-plugins/plugin-macros \
ONLYOFFICE:plugin-mendeley:5a36bf9:sdkjs_plugins_mendeley/sdkjs-plugins/plugin-mendeley \
ONLYOFFICE:plugin-ocr:5b24c87:sdkjs_plugins_ocr/sdkjs-plugins/plugin-ocr \
ONLYOFFICE:plugin-photoeditor:995b5f6:sdkjs_plugins_photoeditor/sdkjs-plugins/plugin-photoeditor \
ONLYOFFICE:plugin-speech:fcec715:sdkjs_plugins_speech/sdkjs-plugins/plugin-speech \
ONLYOFFICE:plugin-thesaurus:4ada280:sdkjs_plugins_thesaurus/sdkjs-plugins/plugin-thesaurus \
ONLYOFFICE:plugin-translator:ba6caed:sdkjs_plugins_translator/sdkjs-plugins/plugin-translator \
ONLYOFFICE:plugin-youtube:4dec911:sdkjs_plugins_youtube/sdkjs-plugins/plugin-youtube \
ONLYOFFICE:plugin-zotero:c9f472f:sdkjs_plugins_zotero/sdkjs-plugins/plugin-zotero \
ONLYOFFICE:build_tools:cf4cac94:buildtools/build_tools \
ONLYOFFICE:DocumentBuilder:4169685e6:document_builder/DocumentBuilder \
ONLYOFFICE:onlyoffice.github.io:ca730969:sdkjs_plugins_v1/onlyoffice.github.io \
ONLYOFFICE:document-server-package:c12273c0a:dsp/document-server-package \
hackers-painters:katana-parser:499118d3:hackers_painters_katana/core/Common/3dParty/html/katana-parser \
google:gumbo-parser:aa91b27:google_gumbo/core/Common/3dParty/html/gumbo-parser
BINARY_ALIAS= python=${PYTHON_CMD}
USE_LDCONFIG= yes
WWWDIR= ${PREFIX}/www/onlyoffice
ETCDIR= ${PREFIX}/etc/onlyoffice
DS_USERNAME= onlyoffice
DS_GROUPNAME= onlyoffice
USERS= ${DS_USERNAME}
GROUPS= ${DS_GROUPNAME}
PLIST_SUB= DS_GROUPNAME=${DS_GROUPNAME} \
DS_USERNAME=${DS_USERNAME}
SUB_FILES= pkg-message
SUB_LIST= ETCDIR=${ETCDIR} \
PREFIX=${PREFIX} \
WWWDIR=${WWWDIR}
MAKE_ENV= BUILD_NUMBER="1" \
PKG_CACHE_PATH=${WRKDIR}/.pkg-cache \
PRODUCT_VERSION="${DISTVERSION}"
DOS2UNIX_FILES= document-server-package/common/documentserver/nginx/includes/http-common.conf.m4
CONFLICTS_BUILD=devel/googletest
post-extract:
@${MV} ${WRKDIR}/v8 ${WRKSRC}/core/Common/3dParty/v8
@${MKDIR} ${WRKDIR}/.pkg-cache/node
@${CP} ${DISTDIR}/node-v16.13.0.tar.gz ${WRKDIR}/.pkg-cache/node
# Checksum can be verified here: https://nodejs.org/dist/v16.13.0/SHASUMS256.txt
@${ECHO} "9c00e5b6024cfcbc9105f9c58cf160762e78659a345d100c5bd80a7fb38c684f node-v16.13.0.tar.gz" > \
${WRKDIR}/.pkg-cache/node/node-v16.13.0.tar.gz.sha256sum
@${MKDIR} ${WRKSRC}/sdkjs-plugins/v1
@${CP} ${WRKSRC}/onlyoffice.github.io/sdkjs-plugins/v1/* ${WRKSRC}/sdkjs-plugins/v1
@${MV} ${WRKSRC}/server/Common/config/production-linux.json ${WRKSRC}/server/Common/config/production-freebsd.json
@${MV} ${WRKSRC}/server/Common/config/development-linux.json ${WRKSRC}/server/Common/config/development-freebsd.json
post-patch:
@${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|' \
${WRKSRC}/core/Common/3dParty/v8/v8/build/toolchain/gcc_toolchain.gni \
${WRKSRC}/core/Common/3dParty/v8/v8/buildtools/third_party/libc++/BUILD.gn \
${WRKSRC}/core/DesktopEditor/fontengine/ApplicationFonts.cpp
@${REINPLACE_CMD} -e 's|%%CC%%|${CC}|' -e 's|%%CXX%%|${CXX}|' \
${WRKSRC}/core/Common/3dParty/v8/v8/build/toolchain/gcc_toolchain.gni \
${WRKSRC}/core/Common/base.pri
@${REINPLACE_CMD} 's|%%WRKDIR%%|${WRKDIR}|' \
${WRKSRC}/document-server-package/Makefile
@${REINPLACE_CMD} 's|%%WRKSRC%%|${WRKSRC}|' \
${WRKSRC}/build_tools/scripts/build_js.py \
${WRKSRC}/build_tools/scripts/build_server.py \
${WRKSRC}/document-server-package/Makefile
@${REINPLACE_CMD} -e 's|linux|freebsd|' -e 's|/etc|${LOCALBASE}/etc|' \
${WRKSRC}/document-server-package/common/documentserver/supervisor/ds-docservice.conf.m4 \
${WRKSRC}/document-server-package/common/documentserver/supervisor/ds-converter.conf.m4 \
${WRKSRC}/document-server-package/common/documentserver-example/supervisor/ds-example.conf.m4 \
${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-static-gzip.sh.m4 \
${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-update-securelink.sh.m4
@${REINPLACE_CMD} 's|/var/www|${LOCALBASE}/www|' \
${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-generate-allfonts.sh.m4 \
${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-static-gzip.sh.m4 \
${WRKSRC}/document-server-package/common/documentserver/supervisor/ds-converter.conf.m4 \
${WRKSRC}/document-server-package/common/documentserver/supervisor/ds-docservice.conf.m4 \
${WRKSRC}/document-server-package/common/documentserver/supervisor/ds-metrics.conf.m4
@${REINPLACE_CMD} -e 's|/var/lib|/var/db|' -e 's|/var/www|${LOCALBASE}/www|' \
-e 's|/usr/share|${LOCALBASE}/share|' -e 's|/etc|${LOCALBASE}/etc|' \
${WRKSRC}/server/Common/config/production-freebsd.json \
${WRKSRC}/server/Common/config/development-freebsd.json
@${REINPLACE_CMD} -e 's|bash|sh|' -e 's|sed|gsed|' \
${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-static-gzip.sh.m4 \
${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-update-securelink.sh.m4
@${REINPLACE_CMD} 's|%%DISTDIR%%|${DISTDIR}|' \
${WRKSRC}/web-apps/build/patches/optipng-bin+5.1.0.patch
@${RM} ${WRKSRC}/web-apps/build/patches/optipng-bin+5.1.0.patch.orig
@${FIND} ${WRKSRC}/server -type f -name npm-shrinkwrap.json -delete
do-build:
@${CP} ${FILESDIR}/packagejsons/server/package-lock.json ${WRKSRC}/server
@${CP} ${FILESDIR}/packagejsons/server/Common/package-lock.json ${WRKSRC}/server/Common
@cd ${WRKSRC}/web-apps/build ; ${SETENV} ${MAKE_ENV} npm install patch-package
@cd ${WRKSRC}/web-apps/build ; ${SETENV} ${MAKE_ENV} npm install optipng-bin@5.1.0
@cd ${WRKSRC}/web-apps/build ; node_modules/.bin/patch-package
@cd ${WRKSRC}/web-apps/build/node_modules ; ${SETENV} ${MAKE_ENV} npm build optipng-bin
@cd ${WRKSRC}/web-apps/build ; ${SETENV} ${MAKE_ENV} npm install patch-package
@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
@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}/build_tools/tools/freebsd ; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} automate.py
cd ${WRKSRC}/document-server-package ; ${SETENV} ${MAKE_ENV} ${GMAKE} freebsd
do-install:
# install the project
# do not strip docservice, converter and metrics
cd ${WRKSRC}/document-server-package/common/documentserver/home && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR}/documentserver
${INSTALL_SCRIPT} ${WRKSRC}/document-server-package/common/documentserver/bin/*.sh ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/document-server-package/common/documentserver/home/server/tools/all* ${STAGEDIR}${WWWDIR}/documentserver/server/tools
${INSTALL_PROGRAM} ${WRKSRC}/document-server-package/common/documentserver/home/server/FileConverter/bin/x2t ${STAGEDIR}${WWWDIR}/documentserver/server/FileConverter/bin
${INSTALL_PROGRAM} ${WRKSRC}/document-server-package/common/documentserver/home/server/FileConverter/bin/docbuilder ${STAGEDIR}${WWWDIR}/documentserver/server/FileConverter/bin
${INSTALL_PROGRAM} ${WRKSRC}/document-server-package/common/documentserver/home/npm/json ${STAGEDIR}${WWWDIR}/documentserver/npm
${INSTALL_LIB} ${WRKSRC}/document-server-package/common/documentserver/home/server/FileConverter/bin/*.so ${STAGEDIR}${PREFIX}/lib
${RM} ${STAGEDIR}${PREFIX}/bin/documentserver-letsencrypt.sh
# install conf
${MKDIR} ${STAGEDIR}${ETCDIR}/documentserver/supervisor \
${STAGEDIR}${ETCDIR}/documentserver/nginx/includes \
${STAGEDIR}${ETCDIR}/documentserver/logrotate
${RM} ${WRKSRC}/document-server-package/common/documentserver/config/*-mac.json ${WRKSRC}/document-server-package/common/documentserver/config/*-windows.json
cd ${WRKSRC}/document-server-package/common/documentserver/supervisor && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver/supervisor "-name *\.conf"
cd ${WRKSRC}/document-server-package/common/documentserver/logrotate && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver/logrotate "-name *\.conf"
.for f in ds.conf includes/http-common.conf includes/ds-common.conf includes/ds-docservice.conf includes/ds-letsencrypt.conf
${INSTALL_DATA} ${WRKSRC}/document-server-package/common/documentserver/nginx/${f} ${STAGEDIR}${ETCDIR}/documentserver/nginx/${f}.sample
.endfor
cd ${WRKSRC}/document-server-package/common/documentserver/nginx/includes && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver/nginx/includes "-name *\.conf"
cd ${WRKSRC}/document-server-package/common/documentserver/config && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver
${INSTALL_DATA} ${FILESDIR}/local.json.sample ${STAGEDIR}${ETCDIR}/documentserver
# create missing dir
${MKDIR} ${STAGEDIR}/var/log/onlyoffice/documentserver/docservice \
${STAGEDIR}/var/log/onlyoffice/documentserver/converter \
${STAGEDIR}/var/log/onlyoffice/documentserver/metrics \
${STAGEDIR}/var/db/onlyoffice/documentserver/App_Data/cache/files \
${STAGEDIR}/var/db/onlyoffice/documentserver/App_Data/docbuilder \
${STAGEDIR}${WWWDIR}/Data \
${STAGEDIR}${WWWDIR}/documentserver/fonts
.include <bsd.port.mk>

View File

@ -0,0 +1,59 @@
TIMESTAMP = 1641567875
SHA256 (v8-8.7.220.31_all.tar.gz) = 0d2e1355cbbb80130d87f9e0acfb94c72846f820339b8a1003875230a5d0fa2f
SIZE (v8-8.7.220.31_all.tar.gz) = 305810432
SHA256 (node-v16.13.0.tar.gz) = 9c00e5b6024cfcbc9105f9c58cf160762e78659a345d100c5bd80a7fb38c684f
SIZE (node-v16.13.0.tar.gz) = 63735070
SHA256 (npm-cache-onlyoffice.tar.gz) = 85c72a0b06439352f2a0ead2fb1412436c38b0dc3200c620f52967415adbf225
SIZE (npm-cache-onlyoffice.tar.gz) = 263763627
SHA256 (optipng-0.7.7.tar.gz) = 4f32f233cef870b3f95d3ad6428bfe4224ef34908f1b42b0badf858216654452
SIZE (optipng-0.7.7.tar.gz) = 2329555
SHA256 (ONLYOFFICE-DocumentServer-v6.4.2_GH0.tar.gz) = fac8bb07884149c042afabb2ab9ce8ba1c11dd35379eea1e2086d6d5bef45a5d
SIZE (ONLYOFFICE-DocumentServer-v6.4.2_GH0.tar.gz) = 51163
SHA256 (ONLYOFFICE-core-0c29e4d_GH0.tar.gz) = e522f85ce12c66f46edfb252efcf8f6205d693b95c3391bf485fb7accfd41735
SIZE (ONLYOFFICE-core-0c29e4d_GH0.tar.gz) = 83856852
SHA256 (ONLYOFFICE-core-fonts-3929a09_GH0.tar.gz) = f264251db39c2ac844644dfebccc6fa836afb2a27cce1bfc565645a48600b49b
SIZE (ONLYOFFICE-core-fonts-3929a09_GH0.tar.gz) = 95253093
SHA256 (ONLYOFFICE-dictionaries-cfa50d3_GH0.tar.gz) = b58d9df27bd3b8a5898a28727e247e282ecb1b770d7980205c0ef4eba5e5fa58
SIZE (ONLYOFFICE-dictionaries-cfa50d3_GH0.tar.gz) = 39363959
SHA256 (ONLYOFFICE-document-server-integration-v1.0.0_GH0.tar.gz) = f09c9384d3abea4d7e3ef31df333125d4e45cc4fa9ecc69a573ee6562231658a
SIZE (ONLYOFFICE-document-server-integration-v1.0.0_GH0.tar.gz) = 5227788
SHA256 (ONLYOFFICE-document-templates-v6.4.2.1_GH0.tar.gz) = b3ad21607446074d36a1913f6b1ac896e38911c8a9c7ffd4a7ea68f5cb6cf39f
SIZE (ONLYOFFICE-document-templates-v6.4.2.1_GH0.tar.gz) = 2152308
SHA256 (ONLYOFFICE-sdkjs-9af7d08_GH0.tar.gz) = 45198d1264b52e36a1e8c66d69130c214a713f4f0ee1a2b9428f95d75480e1e6
SIZE (ONLYOFFICE-sdkjs-9af7d08_GH0.tar.gz) = 11523531
SHA256 (ONLYOFFICE-server-10929a0_GH0.tar.gz) = 439822bbf9a3849823c63cff93b3af0d31560134e58b8b4562baec56d69dab14
SIZE (ONLYOFFICE-server-10929a0_GH0.tar.gz) = 242462
SHA256 (ONLYOFFICE-web-apps-1851cae_GH0.tar.gz) = 598f57b821013e14936a539ebfc7fe1da1ce673d85c95fdfdd607f8e4fa4b5e6
SIZE (ONLYOFFICE-web-apps-1851cae_GH0.tar.gz) = 215031184
SHA256 (ONLYOFFICE-plugin-highlightcode-7ea4ddf_GH0.tar.gz) = 74ec5782ee967bbddf4b524311dcc09be0e28a7e15ef07ce85b30c1fbf0dda90
SIZE (ONLYOFFICE-plugin-highlightcode-7ea4ddf_GH0.tar.gz) = 245219
SHA256 (ONLYOFFICE-plugin-macros-4027439_GH0.tar.gz) = faf8a2bee2c8eaa169eec6ceae272d168e0b6307a16845b5fb844f039cebd351
SIZE (ONLYOFFICE-plugin-macros-4027439_GH0.tar.gz) = 2616745
SHA256 (ONLYOFFICE-plugin-mendeley-5a36bf9_GH0.tar.gz) = 3da951e764ff201d8853ca70e1bc147a0b4bcf6a3b2134b067de8432c293bee0
SIZE (ONLYOFFICE-plugin-mendeley-5a36bf9_GH0.tar.gz) = 417551
SHA256 (ONLYOFFICE-plugin-ocr-5b24c87_GH0.tar.gz) = f39b418974868c863ce313873b876e47cd33a3469d786a9eade584c35881cbae
SIZE (ONLYOFFICE-plugin-ocr-5b24c87_GH0.tar.gz) = 169538
SHA256 (ONLYOFFICE-plugin-photoeditor-995b5f6_GH0.tar.gz) = 413b4444a9d3f47a57637f141066ea72e4e24bbbed9c0f45794b2d9da651d43c
SIZE (ONLYOFFICE-plugin-photoeditor-995b5f6_GH0.tar.gz) = 201051
SHA256 (ONLYOFFICE-plugin-speech-fcec715_GH0.tar.gz) = d85e322059d8b62176c0d3f6a0a999268932990e314242c6b4828ec1a28bbbd0
SIZE (ONLYOFFICE-plugin-speech-fcec715_GH0.tar.gz) = 68212
SHA256 (ONLYOFFICE-plugin-thesaurus-4ada280_GH0.tar.gz) = 8834dec6b1d3ac3aabe4c1c8697bbce859acee0b38137d1d8310631bf7da1286
SIZE (ONLYOFFICE-plugin-thesaurus-4ada280_GH0.tar.gz) = 42914
SHA256 (ONLYOFFICE-plugin-translator-ba6caed_GH0.tar.gz) = d78241b0a23e7b451c92d67a14626066e838dfe1fed098cf1032939c797cabf0
SIZE (ONLYOFFICE-plugin-translator-ba6caed_GH0.tar.gz) = 140898
SHA256 (ONLYOFFICE-plugin-youtube-4dec911_GH0.tar.gz) = 953526e6b8d56a21d1428be949cbb1dc1017b3a0d7f07703aaa860fdb5f9afc4
SIZE (ONLYOFFICE-plugin-youtube-4dec911_GH0.tar.gz) = 11635
SHA256 (ONLYOFFICE-plugin-zotero-c9f472f_GH0.tar.gz) = 8cabfed9f54e23630b7a0fec71db8e16c703b1c67eb85a439a09b5e311ac0ab9
SIZE (ONLYOFFICE-plugin-zotero-c9f472f_GH0.tar.gz) = 33816
SHA256 (ONLYOFFICE-build_tools-cf4cac94_GH0.tar.gz) = ef2617a425b3c4b5c893709725f2c4941cb872ecc8c6fbb966fb12ae80f50f18
SIZE (ONLYOFFICE-build_tools-cf4cac94_GH0.tar.gz) = 4089822
SHA256 (ONLYOFFICE-DocumentBuilder-4169685e6_GH0.tar.gz) = 697bd92c6d02973a5e9df78d3be888f7e305983eda3661e3a16ae7fbbee6bb9e
SIZE (ONLYOFFICE-DocumentBuilder-4169685e6_GH0.tar.gz) = 1271109
SHA256 (ONLYOFFICE-onlyoffice.github.io-ca730969_GH0.tar.gz) = 1612d7ab512bfe80001d40da99cb96761c0bfcd9026c1be5ba8ffa3a050ac085
SIZE (ONLYOFFICE-onlyoffice.github.io-ca730969_GH0.tar.gz) = 13278
SHA256 (ONLYOFFICE-document-server-package-c12273c0a_GH0.tar.gz) = c6b226a8616d1a897a64fdf3de4cdf2a70e9418fde911bb558cef84d57633fc5
SIZE (ONLYOFFICE-document-server-package-c12273c0a_GH0.tar.gz) = 171493
SHA256 (hackers-painters-katana-parser-499118d3_GH0.tar.gz) = ed83020cbe07877c7323d475491803797fac12ce4086966011c81023b9852c4b
SIZE (hackers-painters-katana-parser-499118d3_GH0.tar.gz) = 97209
SHA256 (google-gumbo-parser-aa91b27_GH0.tar.gz) = 1360f85c02fb2573a10f00abcddebc8f1ff277a16f66553439193af93afae335
SIZE (google-gumbo-parser-aa91b27_GH0.tar.gz) = 2119417

View File

@ -0,0 +1,24 @@
--- 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) {
if (targetPlatform === 'linuxstatic') {
args.push('--fully-static');
}
- // Link Time Optimization
- if (major >= 12) {
- if (system_1.hostPlatform !== 'win') {
- args.push('--enable-lto');
- }
- }
// DTrace
args.push('--without-dtrace');
// bundled npm package manager
args.push('--without-npm');
// Small ICU
- args.push('--with-intl=small-icu');
+ args.push('--with-intl=system-icu');
+ args.push('--shared-openssl');
+ args.push('--openssl-use-def-ca-store');
// Workaround for nodejs/node#39313
// All supported macOS versions have zlib as a system library
if (targetPlatform === 'macos') {

View File

@ -0,0 +1,174 @@
--- 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
@@ -521,3 +521,171 @@ index 0000000000..fb2d47f52b
'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 {

View File

@ -0,0 +1,43 @@
{
"services": {
"CoAuthoring": {
"sql": {
"type": "postgres",
"dbHost": "localhost",
"dbPort": "5432",
"dbName": "onlyoffice",
"dbUser": "onlyoffice",
"dbPass": "onlyoffice"
},
"token": {
"enable": {
"request": {
"inbox": false,
"outbox": false
},
"browser": false
},
"inbox": {
"header": "Authorization"
},
"outbox": {
"header": "Authorization"
}
},
"secret": {
"inbox": {
"string": "secret"
},
"outbox": {
"string": "secret"
},
"session": {
"string": "secret"
}
}
}
},
"rabbitmq": {
"url": "amqp://guest:guest@localhost"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
--- build_tools/build.pro.orig 2021-12-12 19:27:25 UTC
+++ build_tools/build.pro
@@ -8,6 +8,10 @@ include($$PWD/common.pri)
CONFIG += ordered
+core_freebsd {
+ CONFIG += no_desktop_apps
+ CONFIG += no_use_htmlfileinternal
+}
core_windows {
CONFIG += core_and_multimedia
}

View File

@ -0,0 +1,11 @@
--- build_tools/configure.py.orig 2021-12-08 10:18:20 UTC
+++ build_tools/configure.py
@@ -14,7 +14,7 @@ parser.add_option("--clean", action="store", type="str
parser.add_option("--module", action="store", type="string", dest="module", default="builder", help="defines what modules to build. You can specify several of them, e.g. --module 'core desktop builder server mobile'")
parser.add_option("--develop", action="store", type="string", dest="develop", default="0", help="defines develop mode")
parser.add_option("--beta", action="store", type="string", dest="beta", default="0", help="defines beta mode")
-parser.add_option("--platform", action="store", type="string", dest="platform", default="native", help="defines the destination platform for your build ['win_64', 'win_32', 'win_64_xp', 'win_32_xp', 'linux_64', 'linux_32', 'mac_64', 'ios', 'android_arm64_v8a', 'android_armv7', 'android_x86', 'android_x86_64'; combinations: 'native': your current system (windows/linux/mac only); 'all': all available systems; 'windows': win_64 win_32 win_64_xp win_32_xp; 'linux': linux_64 linux_32; 'mac': mac_64; 'android': android_arm64_v8a android_armv7 android_x86 android_x86_64]")
+parser.add_option("--platform", action="store", type="string", dest="platform", default="native", help="defines the destination platform for your build ['win_64', 'win_32', 'win_64_xp', 'win_32_xp', 'freebsd_64', 'linux_64', 'linux_32', 'mac_64', 'ios', 'android_arm64_v8a', 'android_armv7', 'android_x86', 'android_x86_64'; combinations: 'native': your current system (windows/linux/mac only); 'all': all available systems; 'windows': win_64 win_32 win_64_xp win_32_xp; 'freebsd': freebsd_64;'linux': linux_64 linux_32; 'mac': mac_64; 'android': android_arm64_v8a android_armv7 android_x86 android_x86_64]")
parser.add_option("--config", action="store", type="string", dest="config", default="", help="provides ability to specify additional parameters for qmake")
parser.add_option("--qt-dir", action="store", type="string", dest="qt-dir", default="", help="defines qmake directory path. qmake can be found in qt-dir/compiler/bin directory")
parser.add_option("--qt-dir-xp", action="store", type="string", dest="qt-dir-xp", default="", help="defines qmake directory path for Windows XP. qmake can be found in 'qt-dir/compiler/bin directory")

View File

@ -0,0 +1,29 @@
--- build_tools/make.py.orig 2021-11-16 07:07:24 UTC
+++ build_tools/make.py
@@ -13,6 +13,7 @@ import build_js
import build_server
import deploy
import make_common
+import os
import develop
# parse configuration
@@ -54,7 +55,17 @@ base.check_build_version(base_dir)
# update
if ("1" == config.option("update")):
repositories = base.get_repositories()
- base.update_repositories(repositories)
+# base.update_repositories(repositories)
+
+ # Apply patches if available
+ patchdir = base_dir + '/patches/' + base.host_platform()
+ if os.path.exists(patchdir) :
+ for root, dirs, files in os.walk(patchdir) :
+ for filename in files :
+ tmpdir = base_dir + '/../' + filename.split('.', 1)[0]
+ print('Patching directory %s' % tmpdir)
+ base.cmd("patch", ["-d", tmpdir, "-i", patchdir + "/" + filename])
+
base.configure_common_apps()

View File

@ -0,0 +1,21 @@
--- build_tools/scripts/base.py.orig 2021-11-16 08:07:24 UTC
+++ build_tools/scripts/base.py
@@ -1092,9 +1092,15 @@ def copy_sdkjs_plugins_server(dst_dir, is_name_as_guid
def support_old_versions_plugins(out_dir):
if is_file(out_dir + "/pluginBase.js"):
return
- download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js", out_dir + "/plugins.js")
- download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", out_dir + "/plugins-ui.js")
- download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", out_dir + "/plugins.css")
+# download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js", out_dir + "/plugins.js")
+# download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", out_dir + "/plugins-ui.js")
+# download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", out_dir + "/plugins.css")
+ git_dir = get_script_dir() + "/../.."
+ plugins_dir = git_dir + "/sdkjs-plugins"
+ copy_file(plugins_dir + "/v1/plugins.js", out_dir + "/plugins.js")
+ copy_file(plugins_dir + "/v1/plugins-ui.js", out_dir + "/plugins-ui.js")
+ copy_file(plugins_dir + "/v1/plugins.css", out_dir + "/plugins.css")
+
content_plugin_base = ""
with open(get_path(out_dir + "/plugins.js"), "r") as file:
content_plugin_base += file.read()

View File

@ -0,0 +1,11 @@
--- build_tools/scripts/build_js.py.orig 2021-12-21 17:52:55 UTC
+++ build_tools/scripts/build_js.py
@@ -97,7 +97,7 @@ def _run_npm_cli(directory):
return base.cmd_in_dir(directory, "npm", ["install", "-g", "grunt-cli"])
def _run_grunt(directory, params=[]):
- return base.cmd_in_dir(directory, "grunt", params)
+ return base.cmd_in_dir(directory, "%%WRKSRC%%/sdkjs/node_modules/.bin/grunt", params)
def build_interface(directory):
_run_npm(directory)

View File

@ -0,0 +1,52 @@
--- build_tools/scripts/build_server.py.orig 2021-11-16 08:07:24 UTC
+++ build_tools/scripts/build_server.py
@@ -17,7 +17,7 @@ def make():
branding_dir = git_dir + '/' + config.option("branding") + '/server'
base.cmd_in_dir(server_dir, "npm", ["install"])
- base.cmd_in_dir(server_dir, "grunt", ["--no-color", "-v"] + base.server_addons_param())
+ base.cmd_in_dir(server_dir, "%%WRKSRC%%/server/node_modules/.bin/grunt", ["--no-color", "-v"] + base.server_addons_param())
#env variables
product_version = base.get_env('PRODUCT_VERSION')
@@ -41,29 +41,34 @@ def make():
if(base.is_exist(custom_public_key)):
base.copy_file(custom_public_key, server_build_dir + '/Common/sources')
- pkg_target = "node10"
+ pkg_target = "node16"
+ if ("freebsd" == base.host_platform()):
+ pkg_target += "-freebsd"
+ pkgBin = "%%WRKSRC%%/server/node_modules/.bin/pkg"
+ pkg_target = "node16"
+
if ("linux" == base.host_platform()):
pkg_target += "-linux"
if ("windows" == base.host_platform()):
pkg_target += "-win"
- base.cmd_in_dir(server_build_dir + "/DocService", "pkg", [".", "-t", pkg_target, "--options", "max_old_space_size=4096", "-o", "docservice"])
- base.cmd_in_dir(server_build_dir + "/FileConverter", "pkg", [".", "-t", pkg_target, "-o", "converter"])
- base.cmd_in_dir(server_build_dir + "/Metrics", "pkg", [".", "-t", pkg_target, "-o", "metrics"])
+ base.cmd_in_dir(server_build_dir + "/DocService", pkgBin, [".", "-t", pkg_target, "--options", "max_old_space_size=4096", "-o", "docservice"])
+ base.cmd_in_dir(server_build_dir + "/FileConverter", pkgBin, [".", "-t", pkg_target, "-o", "converter"])
+ base.cmd_in_dir(server_build_dir + "/Metrics", pkgBin, [".", "-t", pkg_target, "-o", "metrics"])
example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs"
base.delete_dir(example_dir + "/node_modules")
base.cmd_in_dir(example_dir, "npm", ["install"])
sync_rpc_lib_dir = example_dir + "/node_modules/sync-rpc/lib"
patch_file = base.get_script_dir() + "/../tools/linux/sync-rpc.patch"
- if ("linux" == base.host_platform()):
+ if ("linux" == base.host_platform() or "freebsd" == base.host_platform()):
base.cmd_in_dir(sync_rpc_lib_dir, "patch", ["-N", "-i", patch_file])
if ("windows" == base.host_platform()):
patch_exe_dir = base.git_dir() + "/usr/bin"
base.cmd_in_dir(patch_exe_dir, "patch.exe", ["-N", "-d", sync_rpc_lib_dir, "-i", patch_file])
- base.cmd_in_dir(example_dir, "pkg", [".", "-t", pkg_target, "-o", "example"])
+ base.cmd_in_dir(example_dir, pkgBin, [".", "-t", pkg_target, "-o", "example"])
def build_server_develop():
server_dir = base.get_script_dir() + "/../../server"

View File

@ -0,0 +1,38 @@
--- build_tools/scripts/config.py.orig 2021-12-08 10:18:20 UTC
+++ build_tools/scripts/config.py
@@ -26,6 +26,7 @@ def parse():
global platforms
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp",
"linux_64", "linux_32",
+ "freebsd_64",
"mac_64", "mac_arm64",
"ios",
"android_arm64_v8a", "android_armv7", "android_x86", "android_x86_64"]
@@ -39,6 +40,8 @@ def parse():
options["platform"] += " win_64 win_32"
elif ("linux" == host_platform):
options["platform"] += " linux_64 linux_32"
+ elif ("freebsd" == host_platform):
+ options["platform"] += " freebsd_64"
else:
options["platform"] += " mac_64"
@@ -50,6 +53,8 @@ def parse():
options["platform"] += (" win_" + bits)
elif ("linux" == host_platform):
options["platform"] += (" linux_" + bits)
+ elif ("freebsd" == host_platform):
+ options["platform"] += (" freebsd_" + bits)
else:
options["platform"] += (" mac_" + bits)
@@ -90,6 +95,9 @@ def check_compiler(platform):
if (0 == platform.find("win")):
compiler["compiler"] = "msvc2015"
compiler["compiler_64"] = "msvc2015_64"
+ elif (0 == platform.find("freebsd")):
+ compiler["compiler"] = "clang"
+ compiler["compiler_64"] = "clang_64"
elif (0 == platform.find("linux")):
compiler["compiler"] = "gcc"
compiler["compiler_64"] = "gcc_64"

View File

@ -0,0 +1,36 @@
--- build_tools/scripts/core_common/make_common.py.orig 2021-11-16 07:07:24 UTC
+++ build_tools/scripts/core_common/make_common.py
@@ -7,22 +7,23 @@ sys.path.append('..')
import config
import base
-import boost
-import cef
-import icu
-import openssl
+#import boost
+#import cef
+#import icu
+#import openssl
import v8
import html2
-import hunspell
+#import hunspell
import glew
def make():
- boost.make()
- cef.make()
- icu.make()
- openssl.make()
+ if base.host_platform() != 'freebsd' :
+ boost.make()
+ cef.make()
+ icu.make()
+ openssl.make()
v8.make()
html2.make()
- hunspell.make(False)
+# hunspell.make(False)
glew.make()
return

View File

@ -0,0 +1,87 @@
--- build_tools/scripts/core_common/modules/v8.py.orig 2021-11-16 07:07:24 UTC
+++ build_tools/scripts/core_common/modules/v8.py
@@ -8,6 +8,7 @@ import os
import subprocess
def clean():
+ return
if base.is_dir("depot_tools"):
base.delete_dir_with_access_error("depot_tools");
base.delete_dir("depot_tools")
@@ -25,6 +26,8 @@ def clean():
def is_main_platform():
if (config.check_option("platform", "win_64") or config.check_option("platform", "win_32")):
return True
+ if config.check_option("platform", "freebsd_64"):
+ return True
if (config.check_option("platform", "linux_64") or config.check_option("platform", "linux_32")):
return True
if config.check_option("platform", "mac_64"):
@@ -80,23 +83,23 @@ def make():
base.set_env("DEPOT_TOOLS_WIN_TOOLCHAIN", "0")
base.set_env("GYP_MSVS_VERSION", "2015")
- base.common_check_version("v8", "1", clean)
+# base.common_check_version("v8", "1", clean)
if not base.is_dir("v8/out.gn"):
clean()
- if not base.is_dir("depot_tools"):
- base.cmd("git", ["clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"])
- if ("windows" == base.host_platform()):
- # hack for 32 bit system!!!
- if base.is_file("depot_tools/cipd.ps1"):
- base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64")
+# if not base.is_dir("depot_tools"):
+# base.cmd("git", ["clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"])
+# if ("windows" == base.host_platform()):
+# # hack for 32 bit system!!!
+# if base.is_file("depot_tools/cipd.ps1"):
+# base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64")
+#
+# os.environ["PATH"] = base_dir + "/depot_tools" + os.pathsep + os.environ["PATH"]
+#
+# if not base.is_dir("v8/out.gn"):
+# base.cmd("gclient")
- os.environ["PATH"] = base_dir + "/depot_tools" + os.pathsep + os.environ["PATH"]
-
- if not base.is_dir("v8/out.gn"):
- base.cmd("gclient")
-
# --------------------------------------------------------------------------
# fetch
if not base.is_dir("v8"):
@@ -114,8 +117,8 @@ def make():
base.delete_dir_with_access_error("v8/buildtools/win")
base.cmd("git", ["config", "--system", "core.longpaths", "true"])
base.cmd("gclient", ["sync", "--force"], True)
- else:
- base.cmd("gclient", ["sync"], True)
+# else:
+# base.cmd("gclient", ["sync"], True)
# normal version !!!
#base.cmd("gclient", ["sync"], True)
@@ -127,7 +130,7 @@ def make():
if base.is_dir("v8/third_party/binutils/Linux_ia32/Release"):
base.delete_dir("v8/third_party/binutils/Linux_ia32/Release")
- base.cmd("gclient", ["sync", "--no-history"])
+# base.cmd("gclient", ["sync", "--no-history"])
if base.is_dir("v8/third_party/binutils/Linux_x64/Release/bin"):
for file in os.listdir("v8/third_party/binutils/Linux_x64/Release/bin"):
@@ -160,6 +163,11 @@ def make():
base_args64 = "target_cpu=\\\"x64\\\" v8_target_cpu=\\\"x64\\\" v8_static_library=true is_component_build=false v8_use_snapshot=false"
base_args32 = "target_cpu=\\\"x86\\\" v8_target_cpu=\\\"x86\\\" v8_static_library=true is_component_build=false v8_use_snapshot=false"
+
+# v8_monolithic=true
+ if config.check_option("platform", "freebsd_64"):
+ base.cmd2("gn", ["gen", "out.gn/freebsd_64", "--args=\"v8_monolithic=true is_debug=false v8_static_library=true is_component_build=false is_clang=true use_sysroot=false treat_warnings_as_errors=false clang_use_chrome_plugins=false use_lld=true use_custom_libcxx=false v8_use_external_startup_data=false is_component_build=false\""])
+ base.cmd("ninja", ["-C", "out.gn/freebsd_64"])
if config.check_option("platform", "linux_64"):
base.cmd2("gn", ["gen", "out.gn/linux_64", "--args=\"is_debug=false " + base_args64 + " is_clang=" + is_use_clang() + " use_sysroot=false treat_warnings_as_errors=false\""])

View File

@ -0,0 +1,37 @@
--- build_tools/scripts/deploy_server.py.orig 2021-11-16 07:07:24 UTC
+++ build_tools/scripts/deploy_server.py
@@ -92,7 +92,7 @@ def make():
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", converter_dir + "/icudt58.dll")
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icuuc58.dll", converter_dir + "/icuuc58.dll")
- if (0 == platform.find("linux")):
+ if (0 == platform.find("linux") and 0 != platform.find('freebsd')):
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", converter_dir + "/libicudata.so.58")
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.so.58", converter_dir + "/libicuuc.so.58")
@@ -102,6 +102,8 @@ def make():
if (0 == platform.find("win")):
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", converter_dir + "/")
+ elif (0 == platform.find("freebsd")):
+ pass
elif (-1 == config.option("config").find("use_javascript_core")):
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", converter_dir + "/icudtl.dat")
@@ -119,9 +121,13 @@ def make():
base.copy_sdkjs_plugins(js_dir + "/sdkjs-plugins", False, True)
base.copy_sdkjs_plugins_server(js_dir + "/sdkjs-plugins", False, True)
base.create_dir(js_dir + "/sdkjs-plugins/v1")
- base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js", js_dir + "/sdkjs-plugins/v1/plugins.js")
- base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", js_dir + "/sdkjs-plugins/v1/plugins-ui.js")
- base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", js_dir + "/sdkjs-plugins/v1/plugins.css")
+# base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js", js_dir + "/sdkjs-plugins/v1/plugins.js")
+# base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", js_dir + "/sdkjs-plugins/v1/plugins-ui.js")
+# base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", js_dir + "/sdkjs-plugins/v1/plugins.css")
+ base.copy_file(plugins_dir + "/v1/plugins.js", js_dir + "/sdkjs-plugins/v1/plugins.js")
+ base.copy_file(plugins_dir + "/v1/plugins-ui.js", js_dir + "/sdkjs-plugins/v1/plugins-ui.js")
+ base.copy_file(plugins_dir + "/v1/plugins.css", js_dir + "/sdkjs-plugins/v1/plugins.css")
+
base.support_old_versions_plugins(js_dir + "/sdkjs-plugins")
# tools

View File

@ -0,0 +1,11 @@
--- build_tools/scripts/develop/release.py.orig 2021-12-08 10:18:20 UTC
+++ build_tools/scripts/develop/release.py
@@ -44,7 +44,7 @@ repositories.update(base.get_plugins('autocomplete, ea
# Add other repositories
repositories['core-ext'] = [True, False]
-base.update_repositories(repositories)
+#base.update_repositories(repositories)
repositories['onlyoffice'] = [True, False]

View File

@ -0,0 +1,107 @@
--- build_tools/tools/freebsd/automate.py.orig 2021-12-18 16:54:46 UTC
+++ build_tools/tools/freebsd/automate.py
@@ -0,0 +1,104 @@
+#!/usr/bin/env python
+
+import sys
+sys.path.append('../../scripts')
+import base
+import os
+import subprocess
+
+def get_branch_name(directory):
+ cur_dir = os.getcwd()
+ os.chdir(directory)
+ # detect build_tools branch
+ #command = "git branch --show-current"
+ command = "git symbolic-ref --short -q HEAD"
+ popen = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
+ current_branch = "master"
+ try:
+ stdout, stderr = popen.communicate()
+ popen.wait()
+ current_branch = stdout.strip().decode("utf-8")
+ finally:
+ popen.stdout.close()
+ popen.stderr.close()
+ os.chdir(cur_dir)
+ return current_branch
+
+def install_deps():
+ if base.is_file("./packages_complete"):
+ return
+
+ # dependencies
+ packages = ["git-lite",
+ "bash",
+ "png",
+ "jpeg-turbo",
+ "p7zip",
+ "qt5-qmake",
+ "boost-libs",
+ "openjdk8",
+ "openjdk11",
+ "subversion"]
+
+# base.cmd("sudo", ["pkg", "install"] + packages)
+ base.set_env('QT_SELECT', 'qt5')
+
+ # nodejs
+# if not base.is_file("./node_js_setup_10.x"):
+# base.cmd("sudo", ["touch", "./node_js_setup_10.x"])
+# base.cmd("sudo", ["npm", "install", "-g", "npm@6"])
+
+ return
+
+if not base.is_file("./node_js_setup_10.x"):
+ print("install dependencies...")
+ install_deps()
+
+if not base.is_dir("./qt"):
+ base.cmd("mkdir", ["qt",])
+ base.cmd("ln", ["-s", "/usr/local/lib/qt5", "qt/clang_64"])
+
+# Apply a patch on the node_gyp cache in case of npm-node10 use..
+#base.cmd("bash", ["patch_nodegyp.sh",])
+
+branch = get_branch_name("../..")
+
+array_args = sys.argv[1:]
+array_modules = []
+
+config = {}
+for arg in array_args:
+ if (0 == arg.find("--")):
+ indexEq = arg.find("=")
+ if (-1 != indexEq):
+ config[arg[2:indexEq]] = arg[indexEq + 1:]
+ else:
+ # XXX Currently only server has been checked for compilation under FreeBSD
+ if arg != 'server':
+ print("module %s not supported yet under FreeBSD" % arg)
+ array_modules.append(arg)
+
+if ("branch" in config):
+ branch = config["branch"]
+
+print("---------------------------------------------")
+print("build branch: " + branch)
+print("---------------------------------------------")
+
+modules = " ".join(array_modules)
+# XXX Currently only server has been checked for compilation under FreeBSD
+if "" == modules:
+ modules = "server"
+
+print("---------------------------------------------")
+print("build modules: " + modules)
+print("---------------------------------------------")
+
+build_tools_params = ["--branch", branch,
+ "--module", modules,
+ "--update", "1",
+ "--platform", "freebsd_64",
+ "--qt-dir", os.getcwd() + "/qt"]
+
+base.cmd_in_dir("../..", "./configure.py", build_tools_params)
+base.cmd_in_dir("../..", "./make.py")

View File

@ -0,0 +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

View File

@ -0,0 +1,11 @@
--- core/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/cipher.h.orig 2021-09-30 12:13:32 UTC
+++ core/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/cipher.h
@@ -33,7 +33,7 @@
#include <stddef.h>
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
#include <inttypes.h>
#endif

View File

@ -0,0 +1,11 @@
--- core/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/digest.h.orig 2021-09-30 12:13:32 UTC
+++ core/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/digest.h
@@ -31,7 +31,7 @@
*/
#pragma once
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
#include <inttypes.h>
#endif

View File

@ -0,0 +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

View File

@ -0,0 +1,16 @@
--- core/Common/3dParty/boost/boost.pri.orig 2021-09-30 12:13:32 UTC
+++ core/Common/3dParty/boost/boost.pri
@@ -1,5 +1,11 @@
-INCLUDEPATH += $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/include
-CORE_BOOST_LIBS = $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/lib
+!core_freebsd {
+ INCLUDEPATH += $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/include
+ CORE_BOOST_LIBS = $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/lib
+}
+core_freebsd {
+ INCLUDEPATH += /usr/local/include
+ CORE_BOOST_LIBS = /usr/local/lib
+}
core_android {
INCLUDEPATH += $$PWD/build/android/include

View File

@ -0,0 +1,10 @@
--- core/Common/3dParty/cryptopp/project/cryptopp.pro.orig 2021-09-30 12:13:32 UTC
+++ core/Common/3dParty/cryptopp/project/cryptopp.pro
@@ -11,6 +11,7 @@ PWD_ROOT_DIR = $$PWD
include(../../../../Common/base.pri)
+core_freebsd:DEFINES -= NDEBUG
core_linux:DEFINES -= NDEBUG
core_mac:DEFINES -= MAC
core_ios:DEFINES -= MAC

View File

@ -0,0 +1,10 @@
--- core/Common/3dParty/html/gumbo.pri.orig 2021-12-18 10:21:34 UTC
+++ core/Common/3dParty/html/gumbo.pri
@@ -1,6 +1,7 @@
INCLUDEPATH += $$PWD
DEPENDPATH += $$PWD
+core_freebsd:QMAKE_CFLAGS += -std=c99
core_linux:QMAKE_CFLAGS += -std=c99
core_windows:INCLUDEPATH += $$PWD/gumbo-parser/visualc/include

View File

@ -0,0 +1,16 @@
--- core/Common/3dParty/icu/icu.pri.orig 2021-09-30 12:13:32 UTC
+++ core/Common/3dParty/icu/icu.pri
@@ -8,6 +8,13 @@ core_windows {
}
LIBS += -L$$PWD/$$CORE_BUILDS_PLATFORM_PREFIX/build -licuuc
+}
+
+core_freebsd {
+ INCLUDEPATH += /usr/local/include
+
+ LIBS += /usr/local/lib/libicuuc.so
+ LIBS += /usr/local/lib/libicudata.so
}
core_linux {

View File

@ -0,0 +1,27 @@
--- core/Common/3dParty/v8/v8.pri.orig 2021-09-30 12:13:32 UTC
+++ core/Common/3dParty/v8/v8.pri
@@ -31,6 +31,24 @@ core_windows {
LIBS += -lShlwapi
}
+core_freebsd {
+ CONFIG += c++14
+ CONFIG += use_v8_monolith
+ DEFINES += V8_VERSION_87_PLUS
+ DEFINES += V8_COMPRESS_POINTERS
+ use_v8_monolith {
+ LIBS += -L$$CORE_V8_PATH_LIBS -lv8_monolith
+ } else {
+ SNAPSHOT_LIB=v8_snapshot
+ !exists($$CORE_V8_PATH_LIBS/libv8_snapshot.a) {
+ SNAPSHOT_LIB=v8_nosnapshot
+ }
+
+ LIBS += -L$$CORE_V8_PATH_LIBS -lv8_initializers -lv8_init -lv8_base -lv8_libplatform -lv8_libbase -l$$SNAPSHOT_LIB -lv8_libsampler
+ LIBS += -L$$CORE_V8_PATH_LIBS/third_party/icu -licui18n -licuuc
+ }
+}
+
core_linux {
use_v8_monolith {
LIBS += -L$$CORE_V8_PATH_LIBS -lv8_monolith

View File

@ -0,0 +1,32 @@
--- core/Common/3dParty/v8/v8/BUILD.gn.orig 2020-12-15 11:23:25 UTC
+++ core/Common/3dParty/v8/v8/BUILD.gn
@@ -4068,7 +4068,7 @@ v8_component("v8_libbase") {
}
}
- if (is_linux || is_chromeos) {
+ if ((is_linux || is_chromeos) && !is_bsd) {
sources += [
"src/base/debug/stack_trace_posix.cc",
"src/base/platform/platform-linux.cc",
@@ -4088,6 +4088,12 @@ v8_component("v8_libbase") {
"dl",
"rt",
]
+ } else if (is_bsd) {
+ sources += [
+ "src/base/debug/stack_trace_posix.cc",
+ "src/base/platform/platform-freebsd.cc",
+ ]
+ libs = [ "rt", "execinfo" ]
} else if (is_android) {
if (current_toolchain == host_toolchain) {
libs = [
@@ -4431,6 +4437,7 @@ if (v8_monolithic) {
":v8_libsampler",
"//build/win:default_exe_manifest",
]
+ libs = ["execinfo"]
configs = [ ":internal_config" ]
}

View File

@ -0,0 +1,30 @@
--- core/Common/3dParty/v8/v8/build/config/BUILD.gn.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/config/BUILD.gn
@@ -133,7 +133,7 @@ config("debug") {
# builds, and we have to tell it to turn it off.
defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
}
- } else if ((is_linux || is_chromeos) && current_cpu == "x64" && enable_iterator_debugging) {
+ } else if ((is_linux || is_chromeos || is_bsd) && current_cpu == "x64" && enable_iterator_debugging) {
# Enable libstdc++ debugging facilities to help catch problems early, see
# http://crbug.com/65151 .
# TODO(phajdan.jr): Should we enable this for all of POSIX?
@@ -231,9 +231,7 @@ config("default_libs") {
]
} else if (is_linux || is_chromeos) {
libs = [
- "dl",
"pthread",
- "rt",
]
}
}
@@ -316,7 +314,7 @@ config("executable_config") {
"//build/config/ios:ios_dynamic_flags",
"//build/config/ios:ios_executable_flags",
]
- } else if (is_linux || is_chromeos || is_android || current_os == "aix") {
+ } else if (is_linux || is_bsd || is_chromeos || is_android || current_os == "aix") {
configs += [ "//build/config/gcc:executable_config" ]
if (is_chromecast) {
configs += [ "//build/config/chromecast:executable_config" ]

View File

@ -0,0 +1,48 @@
--- core/Common/3dParty/v8/v8/build/config/BUILDCONFIG.gn.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/config/BUILDCONFIG.gn
@@ -131,10 +131,10 @@ declare_args() {
is_official_build = false
# Whether we're a traditional desktop unix.
- is_desktop_linux = current_os == "linux"
+ is_desktop_linux = current_os == "linux" || current_os == "freebsd"
# Set to true when compiling with the Clang compiler.
- is_clang = current_os != "linux" ||
+ is_clang = current_os != "linux" || current_os == "freebsd" ||
(current_cpu != "s390x" && current_cpu != "s390" &&
current_cpu != "ppc64" && current_cpu != "ppc" &&
current_cpu != "mips" && current_cpu != "mips64")
@@ -186,8 +186,8 @@ if (host_toolchain == "") {
# TODO(dpranke): Add some sort of assert here that verifies that
# no toolchain omitted host_toolchain from its toolchain_args().
- if (host_os == "linux") {
- if (target_os != "linux") {
+ if (host_os == "linux" || host_os == "freebsd") {
+ if (target_os != "linux" && target_os != "freebsd") {
host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
} else if (is_clang) {
host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
@@ -224,7 +224,7 @@ if (target_os == "android") {
assert(host_os == "linux" || host_os == "mac",
"Android builds are only supported on Linux and Mac hosts.")
_default_toolchain = "//build/toolchain/android:android_clang_$target_cpu"
-} else if (target_os == "chromeos" || target_os == "linux") {
+} else if (target_os == "chromeos" || target_os == "linux" || target_os == "freebsd") {
# See comments in build/toolchain/cros/BUILD.gn about board compiles.
if (is_clang) {
_default_toolchain = "//build/toolchain/linux:clang_$target_cpu"
@@ -288,10 +288,11 @@ is_android = current_os == "android"
is_chromeos = current_os == "chromeos"
is_fuchsia = current_os == "fuchsia"
is_ios = current_os == "ios"
-is_linux = current_os == "linux"
+is_linux = current_os == "linux" || current_os == "freebsd"
is_mac = current_os == "mac"
is_nacl = current_os == "nacl"
is_win = current_os == "win" || current_os == "winuwp"
+is_bsd = current_os == "freebsd"
is_apple = is_ios || is_mac
is_posix = !is_win && !is_fuchsia

View File

@ -0,0 +1,92 @@
--- core/Common/3dParty/v8/v8/build/config/compiler/BUILD.gn.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/config/compiler/BUILD.gn
@@ -128,7 +128,7 @@ declare_args() {
#
# TODO(crbug.com/977230): Enabling this when 'use_xcode_clang' is true may
# call an old clang that doesn't support auto-init.
- init_stack_vars = !is_android && !use_xcode_clang
+ init_stack_vars = !is_android && !use_xcode_clang && !is_bsd
# This argument is to control whether enabling text section splitting in the
# final binary. When enabled, the separated text sections with prefix
@@ -291,7 +291,7 @@ config("compiler") {
}
# Linker warnings.
- if (fatal_linker_warnings && !is_apple && current_os != "aix") {
+ if (fatal_linker_warnings && !is_apple && !is_bsd && current_os != "aix") {
ldflags += [ "-Wl,--fatal-warnings" ]
}
if (fatal_linker_warnings && is_apple &&
@@ -389,7 +389,7 @@ config("compiler") {
# Compiler instrumentation can introduce dependencies in DSOs to symbols in
# the executable they are loaded into, so they are unresolved at link-time.
- if (!using_sanitizer) {
+ if (!using_sanitizer && !is_bsd) {
ldflags += [
"-Wl,-z,defs",
"-Wl,--as-needed",
@@ -480,7 +480,7 @@ config("compiler") {
ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
}
- if (is_clang && !is_nacl && !use_xcode_clang) {
+ if (is_clang && !is_nacl && !use_xcode_clang && !is_bsd) {
cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ]
cflags += [
@@ -776,7 +776,7 @@ config("compiler_cpu_abi") {
cflags += [ "-mtune=$arm_tune" ]
}
} else if (current_cpu == "arm64") {
- if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
+ if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_bsd) {
cflags += [ "--target=aarch64-linux-gnu" ]
ldflags += [ "--target=aarch64-linux-gnu" ]
}
@@ -1129,7 +1129,7 @@ config("compiler_deterministic") {
"-Xclang",
".",
]
- if (!is_win) {
+ if (!is_win && !is_bsd) {
# We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
}
@@ -1512,7 +1512,7 @@ config("default_warnings") {
cflags += [ "-Wno-nonportable-include-path" ]
}
- if (current_toolchain == host_toolchain || !use_xcode_clang) {
+ if ((current_toolchain == host_toolchain || !use_xcode_clang) && !is_bsd) {
# Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not
# recognize.
cflags += [
@@ -1764,7 +1764,7 @@ config("thin_archive") {
# Mac and iOS use the mac-specific "libtool" command, not ar, which doesn't
# have a "thin archive" mode (it does accept -T, but it means truncating
# archive names to 16 characters, which is not what we want).
- if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) {
+ if ((is_posix && !is_nacl && !is_apple && !is_bsd) || is_fuchsia) {
arflags = [ "-T" ]
} else if (is_win && use_lld) {
arflags = [ "/llvmlibthin" ]
@@ -2297,7 +2297,7 @@ config("symbols") {
# flag, so we can use use -g1 for pnacl and nacl-clang compiles.
# gcc nacl is is_nacl && !is_clang, pnacl and nacl-clang are && is_clang.
if (!is_nacl || is_clang) {
- cflags += [ "-g2" ]
+ cflags += [ "-g0" ]
}
# TODO(https://crbug.com/1050118): Investigate missing debug info on mac.
@@ -2339,7 +2339,7 @@ config("symbols") {
# DWARF info may be corrupt; offsets in a range list entry are in different
# sections" there. Maybe just a bug in nacl_switch_32.S.
if (!is_apple && !is_nacl && current_cpu != "x86" &&
- (use_gold || use_lld)) {
+ (use_gold || use_lld) && !is_bsd) {
if (is_clang) {
# This flag enables the GNU-format pubnames and pubtypes sections,
# which lld needs in order to generate a correct GDB index.

View File

@ -0,0 +1,11 @@
--- core/Common/3dParty/v8/v8/build/config/compiler/compiler.gni.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/config/compiler/compiler.gni
@@ -192,7 +192,7 @@ declare_args() {
declare_args() {
# Whether to use the gold linker from binutils instead of lld or bfd.
use_gold =
- !use_lld && !(is_chromecast && is_linux &&
+ !is_bsd && !use_lld && !(is_chromecast && is_linux &&
(current_cpu == "arm" || current_cpu == "mipsel")) &&
((is_linux && (current_cpu == "x64" || current_cpu == "x86" ||
current_cpu == "arm" || current_cpu == "arm64" ||

View File

@ -0,0 +1,11 @@
--- core/Common/3dParty/v8/v8/build/config/features.gni.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/config/features.gni
@@ -26,7 +26,7 @@ declare_args() {
proprietary_codecs = is_chrome_branded || is_chromecast
# libudev usage. This currently only affects the content layer.
- use_udev = (is_linux || is_chromeos) && !is_chromecast
+ use_udev = (is_linux || is_chromeos) && !is_chromecast && !is_bsd
use_dbus = (is_linux || is_chromeos) && !is_chromecast

View File

@ -0,0 +1,9 @@
--- core/Common/3dParty/v8/v8/build/config/freetype/freetype.gni.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/config/freetype/freetype.gni
@@ -10,5 +10,5 @@ declare_args() {
# than version 2.7.1 and have color bitmap support compiled in. WARNING:
# System FreeType configurations other than as described WILL INTRODUCE TEXT
# RENDERING AND SECURITY REGRESSIONS.
- use_system_freetype = false
+ use_system_freetype = true
}

View File

@ -0,0 +1,11 @@
--- core/Common/3dParty/v8/v8/build/config/linux/BUILD.gn.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/config/linux/BUILD.gn
@@ -30,7 +30,7 @@ config("runtime_library") {
if ((!(is_chromeos || chromeos_is_browser_only) ||
default_toolchain != "//build/toolchain/cros:target") &&
- (!use_custom_libcxx || current_cpu == "mipsel")) {
+ (!use_custom_libcxx || current_cpu == "mipsel") && !is_bsd) {
libs = [ "atomic" ]
}
}

View File

@ -0,0 +1,26 @@
--- core/Common/3dParty/v8/v8/build/config/linux/pkg-config.py.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/config/linux/pkg-config.py
@@ -59,8 +59,12 @@ def SetConfigPath(options):
print("You must specify an architecture via -a if using a sysroot.")
sys.exit(1)
- libdir = sysroot + '/usr/' + options.system_libdir + '/pkgconfig'
- libdir += ':' + sysroot + '/usr/share/pkgconfig'
+ if "linux" in sys.platform:
+ libdir = sysroot + '/libdata/' + options.system_libdir + '/pkgconfig'
+ libdir += ':' + sysroot + '/usr/share/pkgconfig'
+ elif "bsd" in sys.platform:
+ libdir = sysroot + '/libdata/pkgconfig'
+ libdir += ':' + '/usr/libdata/pkgconfig'
os.environ['PKG_CONFIG_LIBDIR'] = libdir
return libdir
@@ -109,7 +113,7 @@ def main():
# If this is run on non-Linux platforms, just return nothing and indicate
# success. This allows us to "kind of emulate" a Linux build from other
# platforms.
- if "linux" not in sys.platform:
+ if "bsd" not in sys.platform:
print("[[],[],[],[],[]]")
return 0

View File

@ -0,0 +1,14 @@
--- core/Common/3dParty/v8/v8/build/config/sysroot.gni.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/config/sysroot.gni
@@ -21,9 +21,9 @@ declare_args() {
# Controls default is_linux sysroot. If set to true, and sysroot
# is empty, default sysroot is calculated.
- use_sysroot = current_cpu == "x86" || current_cpu == "x64" ||
+ use_sysroot = !is_bsd && (current_cpu == "x86" || current_cpu == "x64" ||
current_cpu == "arm" || current_cpu == "arm64" ||
- current_cpu == "mipsel" || current_cpu == "mips64el"
+ current_cpu == "mipsel" || current_cpu == "mips64el")
}
if (sysroot == "") {

View File

@ -0,0 +1,11 @@
--- core/Common/3dParty/v8/v8/build/detect_host_arch.py.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/detect_host_arch.py
@@ -21,6 +21,8 @@ def HostArch():
host_arch = 'ia32'
elif host_arch in ['x86_64', 'amd64']:
host_arch = 'x64'
+ elif host_arch.startswith('arm64'):
+ host_arch = 'arm64'
elif host_arch.startswith('arm'):
host_arch = 'arm'
elif host_arch.startswith('aarch64'):

View File

@ -0,0 +1,11 @@
--- core/Common/3dParty/v8/v8/build/gn_run_binary.py.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/gn_run_binary.py
@@ -24,7 +24,7 @@ if not os.path.isabs(path):
# The rest of the arguments are passed directly to the executable.
args = [path] + sys.argv[2:]
-ret = subprocess.call(args)
+ret = subprocess.call(args, env={"CHROME_EXE_PATH":"${WRKSRC}/out/Release/chrome"})
if ret != 0:
if ret <= -100:
# Windows error codes such as 0xC0000005 and 0xC0000409 are much easier to

View File

@ -0,0 +1,29 @@
--- core/Common/3dParty/v8/v8/build/linux/chrome.map.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/linux/chrome.map
@@ -1,4 +1,7 @@
{
+local:
+ *;
+
global:
__bss_start;
__data_start;
@@ -20,6 +23,10 @@ global:
# Program entry point.
_start;
+ # FreeBSD specific variables.
+ __progname;
+ environ;
+
# Memory allocation symbols. We want chrome and any libraries to
# share the same heap, so it is correct to export these symbols.
calloc;
@@ -81,7 +88,4 @@ global:
localtime64;
localtime64_r;
localtime_r;
-
-local:
- *;
};

View File

@ -0,0 +1,53 @@
--- core/Common/3dParty/v8/v8/build/linux/libpci/BUILD.gn.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/linux/libpci/BUILD.gn
@@ -3,20 +3,36 @@
# found in the LICENSE file.
import("//tools/generate_library_loader/generate_library_loader.gni")
+import("//build/config/linux/pkg_config.gni")
-# This generates a target named "libpci".
-generate_library_loader("libpci") {
- name = "LibPciLoader"
- output_h = "libpci.h"
- output_cc = "libpci_loader.cc"
- header = "<pci/pci.h>"
+declare_args() {
+ use_system_libpci = is_bsd
+}
- functions = [
- "pci_alloc",
- "pci_init",
- "pci_cleanup",
- "pci_scan_bus",
- "pci_fill_info",
- "pci_lookup_name",
- ]
+if (use_system_libpci) {
+ pkg_config("system_libpci") {
+ packages = [ "libpci" ]
+ }
+
+ source_set("libpci") {
+ public_configs = [ ":system_libpci" ]
+ }
+
+} else {
+ # This generates a target named "libpci".
+ generate_library_loader("libpci") {
+ name = "LibPciLoader"
+ output_h = "libpci.h"
+ output_cc = "libpci_loader.cc"
+ header = "<pci/pci.h>"
+
+ functions = [
+ "pci_alloc",
+ "pci_init",
+ "pci_cleanup",
+ "pci_scan_bus",
+ "pci_fill_info",
+ "pci_lookup_name",
+ ]
+ }
}

View File

@ -0,0 +1,27 @@
--- core/Common/3dParty/v8/v8/build/linux/unbundle/libusb.gn.orig 2021-12-18 17:45:22 UTC
+++ core/Common/3dParty/v8/v8/build/linux/unbundle/libusb.gn
@@ -0,0 +1,24 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/linux/pkg_config.gni")
+import("//build/shim_headers.gni")
+
+pkg_config("system_libusb") {
+ packages = [ "libusb-1.0" ]
+}
+
+shim_headers("libusb_shim") {
+ root_path = "src/libusb"
+ headers = [
+ "libusb.h",
+ ]
+}
+
+source_set("libusb") {
+ deps = [
+ ":libusb_shim",
+ ]
+ public_configs = [ ":system_libusb" ]
+}

View File

@ -0,0 +1,10 @@
--- core/Common/3dParty/v8/v8/build/linux/unbundle/replace_gn_files.py.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/linux/unbundle/replace_gn_files.py
@@ -27,6 +27,7 @@ REPLACEMENTS = {
'libevent': 'base/third_party/libevent/BUILD.gn',
'libjpeg': 'third_party/libjpeg.gni',
'libpng': 'third_party/libpng/BUILD.gn',
+ 'libusb': 'third_party/libusb/BUILD.gn',
'libvpx': 'third_party/libvpx/BUILD.gn',
'libwebp': 'third_party/libwebp/BUILD.gn',
'libxml': 'third_party/libxml/BUILD.gn',

View File

@ -0,0 +1,45 @@
--- core/Common/3dParty/v8/v8/build/toolchain/gcc_toolchain.gni.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/toolchain/gcc_toolchain.gni
@@ -50,6 +50,11 @@ if (enable_resource_allowlist_generation) {
"enable_resource_allowlist_generation=true does not work for target_os=$target_os")
}
+declare_args() {
+ extra_cxxflags = ""
+ extra_ldflags = ""
+}
+
# This template defines a toolchain for something that works like gcc
# (including clang).
#
@@ -641,13 +646,23 @@ template("clang_toolchain") {
}
gcc_toolchain(target_name) {
- prefix = rebase_path("$clang_base_path/bin", root_build_dir)
- cc = "$prefix/clang"
- cxx = "$prefix/clang++"
- ld = cxx
- readelf = "${toolprefix}readelf"
- ar = "${prefix}/llvm-ar"
- nm = "${toolprefix}nm"
+ if (is_bsd) {
+ prefix = "%%LOCALBASE%%/bin"
+ cc = "%%CC%%"
+ cxx = "%%CXX%%"
+ ld = cxx
+ readelf = "${toolprefix}readelf"
+ ar = "${prefix}/ar"
+ nm = "${prefix}/nm"
+ } else {
+ prefix = rebase_path("$clang_base_path/bin", root_build_dir)
+ cc = "$prefix/clang"
+ cxx = "$prefix/clang++"
+ ld = cxx
+ readelf = "${toolprefix}readelf"
+ ar = "${prefix}/llvm-ar"
+ nm = "${toolprefix}nm"
+ }
forward_variables_from(invoker,
[

View File

@ -0,0 +1,17 @@
--- core/Common/3dParty/v8/v8/build/toolchain/get_concurrent_links.py.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/toolchain/get_concurrent_links.py
@@ -53,6 +53,14 @@ def _GetTotalMemoryInBytes():
return int(subprocess.check_output(['sysctl', '-n', 'hw.memsize']))
except Exception:
return 0
+ elif sys.platform.startswith('freebsd'):
+ try:
+ avail_bytes = int(subprocess.check_output(['sysctl', '-n', 'hw.physmem']))
+ # With -fuse-lld it doesn't take a lot of ram, feel free to change that
+ # 1 * ... to needed amount
+ return max(1, avail_bytes / (1 * (2 ** 30))) # total / 4GB
+ except Exception:
+ return 1
# TODO(scottmg): Implement this for other platforms.
return 0

View File

@ -0,0 +1,10 @@
--- core/Common/3dParty/v8/v8/build/toolchain/linux/BUILD.gn.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/build/toolchain/linux/BUILD.gn
@@ -22,7 +22,6 @@ clang_toolchain("clang_arm") {
}
clang_toolchain("clang_arm64") {
- toolprefix = "aarch64-linux-gnu-"
toolchain_args = {
current_cpu = "arm64"
current_os = "linux"

View File

@ -0,0 +1,13 @@
--- core/Common/3dParty/v8/v8/build/win/BUILD.gn.orig 2021-12-20 12:36:58 UTC
+++ core/Common/3dParty/v8/v8/build/win/BUILD.gn
@@ -10,8 +10,8 @@ import("//build/config/win/manifest.gni")
# be converted to check target platform before assigning source files to the
# sources variable. Remove this import and set_sources_assignment_filter call
# when the file has been converted. See https://crbug.com/1018739 for details.
-import("//build/config/deprecated_default_sources_assignment_filter.gni")
-set_sources_assignment_filter(deprecated_default_sources_assignment_filter)
+#import("//build/config/deprecated_default_sources_assignment_filter.gni")
+#set_sources_assignment_filter(deprecated_default_sources_assignment_filter)
# Depending on this target will cause the manifests for Chrome's default
# Windows and common control compatibility and elevation for executables.

View File

@ -0,0 +1,11 @@
--- core/Common/3dParty/v8/v8/buildtools/third_party/libc++/BUILD.gn.orig 2020-11-16 13:30:51 UTC
+++ core/Common/3dParty/v8/v8/buildtools/third_party/libc++/BUILD.gn
@@ -14,7 +14,7 @@ config("config") {
# its implementation.
cflags += [ "-Wno-macro-redefined" ]
} else {
- cflags += [ "-fPIC" ]
+ cflags += [ "-fPIC", "-I%%LOCALBASE%%/include" ]
}
}

View File

@ -0,0 +1,21 @@
--- core/Common/3dParty/v8/v8/include/v8config.h.orig 2020-12-15 11:23:25 UTC
+++ core/Common/3dParty/v8/v8/include/v8config.h
@@ -276,7 +276,18 @@
# define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \
(__has_attribute(warn_unused_result))
+// Work around Clang bug present in 9.0.1, at least.
+//
+// Clang stores alignment as a 32-bit unsigned integer, but V8 only uses
+// V8_ASSUME_ALIGNED() for a 4GB (2^32) alignment
+// (kPtrComprIsolateRootAlignment). As such, the alignment overflows and
+// becomes zero, triggering an internal Clang assertion that alignment must not
+// be zero.
+#if 0
# define V8_HAS_BUILTIN_ASSUME_ALIGNED (__has_builtin(__builtin_assume_aligned))
+#else
+# define V8_HAS_BUILTIN_ASSUME_ALIGNED 0
+#endif
# define V8_HAS_BUILTIN_BSWAP16 (__has_builtin(__builtin_bswap16))
# define V8_HAS_BUILTIN_BSWAP32 (__has_builtin(__builtin_bswap32))
# define V8_HAS_BUILTIN_BSWAP64 (__has_builtin(__builtin_bswap64))

View File

@ -0,0 +1,11 @@
--- core/Common/3dParty/v8/v8/src/api/api.cc.orig 2020-12-15 11:23:25 UTC
+++ core/Common/3dParty/v8/v8/src/api/api.cc
@@ -5760,7 +5760,7 @@ bool v8::V8::Initialize(const int build_config) {
return true;
}
-#if V8_OS_LINUX || V8_OS_MACOSX
+#if V8_OS_LINUX || V8_OS_MACOSX || V8_OS_OPENBSD || V8_OS_FREEBSD
bool TryHandleWebAssemblyTrapPosix(int sig_code, siginfo_t* info,
void* context) {
#if V8_TARGET_ARCH_X64 && !V8_OS_ANDROID

View File

@ -0,0 +1,18 @@
--- core/Common/3dParty/v8/v8/src/base/cpu.cc.orig 2020-12-15 11:23:25 UTC
+++ core/Common/3dParty/v8/v8/src/base/cpu.cc
@@ -534,6 +534,7 @@ CPU::CPU()
#if V8_OS_LINUX
+#if V8_OS_LINUX
CPUInfo cpu_info;
// Extract implementor from the "CPU implementer" field.
@@ -567,6 +568,7 @@ CPU::CPU()
}
delete[] part;
}
+#endif
// Extract architecture from the "CPU Architecture" field.
// The list is well-known, unlike the the output of

View File

@ -0,0 +1,13 @@
--- core/Common/3dParty/v8/v8/src/base/platform/platform-freebsd.cc.orig 2020-12-15 11:23:25 UTC
+++ core/Common/3dParty/v8/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;

View File

@ -0,0 +1,24 @@
--- core/Common/3dParty/v8/v8/src/base/platform/platform-posix.cc.orig 2020-12-15 11:23:25 UTC
+++ core/Common/3dParty/v8/v8/src/base/platform/platform-posix.cc
@@ -466,7 +466,7 @@ bool OS::DiscardSystemPages(void* address, size_t size
// static
bool OS::HasLazyCommits() {
-#if V8_OS_AIX || V8_OS_LINUX || V8_OS_MACOSX
+#if V8_OS_AIX || V8_OS_LINUX || V8_OS_MACOSX || V8_OS_FREEBSD
return true;
#else
// TODO(bbudge) Return true for all POSIX platforms.
@@ -597,6 +597,12 @@ int OS::GetCurrentThreadId() {
return static_cast<int>(syscall(__NR_gettid));
#elif V8_OS_ANDROID
return static_cast<int>(gettid());
+#elif V8_OS_DRAGONFLYBSD || defined(__DragonFly__)
+ return static_cast<int>(lwp_gettid());
+#elif V8_OS_FREEBSD
+ return static_cast<int>(pthread_getthreadid_np());
+#elif V8_OS_NETBSD
+ return static_cast<int>(_lwp_self());
#elif V8_OS_AIX
return static_cast<int>(thread_self());
#elif V8_OS_FUCHSIA

View File

@ -0,0 +1,19 @@
--- core/Common/3dParty/v8/v8/src/d8/d8-posix.cc.orig 2020-12-15 11:23:25 UTC
+++ core/Common/3dParty/v8/v8/src/d8/d8-posix.cc
@@ -4,6 +4,8 @@
#include <errno.h>
#include <fcntl.h>
+#include <sys/types.h>
+#include <netinet/in.h>
#include <netinet/ip.h>
#include <signal.h>
#include <stdlib.h>
@@ -12,7 +14,6 @@
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>

View File

@ -0,0 +1,74 @@
--- core/Common/3dParty/v8/v8/src/objects/js-list-format.cc.orig 2020-12-15 11:23:25 UTC
+++ core/Common/3dParty/v8/v8/src/objects/js-list-format.cc
@@ -29,46 +29,27 @@ namespace v8 {
namespace internal {
namespace {
-const char* kStandard = "standard";
-const char* kOr = "or";
-const char* kUnit = "unit";
-const char* kStandardShort = "standard-short";
-const char* kOrShort = "or-short";
-const char* kUnitShort = "unit-short";
-const char* kStandardNarrow = "standard-narrow";
-const char* kOrNarrow = "or-narrow";
-const char* kUnitNarrow = "unit-narrow";
-const char* GetIcuStyleString(JSListFormat::Style style,
- JSListFormat::Type type) {
+UListFormatterWidth GetIcuWidth(JSListFormat::Style style) {
+ switch (style) {
+ case JSListFormat::Style::LONG:
+ return ULISTFMT_WIDTH_WIDE;
+ case JSListFormat::Style::SHORT:
+ return ULISTFMT_WIDTH_SHORT;
+ case JSListFormat::Style::NARROW:
+ return ULISTFMT_WIDTH_NARROW;
+ }
+ UNREACHABLE();
+}
+
+UListFormatterType GetIcuType(JSListFormat::Type type) {
switch (type) {
case JSListFormat::Type::CONJUNCTION:
- switch (style) {
- case JSListFormat::Style::LONG:
- return kStandard;
- case JSListFormat::Style::SHORT:
- return kStandardShort;
- case JSListFormat::Style::NARROW:
- return kStandardNarrow;
- }
+ return ULISTFMT_TYPE_AND;
case JSListFormat::Type::DISJUNCTION:
- switch (style) {
- case JSListFormat::Style::LONG:
- return kOr;
- case JSListFormat::Style::SHORT:
- return kOrShort;
- case JSListFormat::Style::NARROW:
- return kOrNarrow;
- }
+ return ULISTFMT_TYPE_OR;
case JSListFormat::Type::UNIT:
- switch (style) {
- case JSListFormat::Style::LONG:
- return kUnit;
- case JSListFormat::Style::SHORT:
- return kUnitShort;
- case JSListFormat::Style::NARROW:
- return kUnitNarrow;
- }
+ return ULISTFMT_TYPE_UNITS;
}
UNREACHABLE();
}
@@ -143,7 +124,7 @@ MaybeHandle<JSListFormat> JSListFormat::New(Isolate* i
icu::Locale icu_locale = r.icu_locale;
UErrorCode status = U_ZERO_ERROR;
icu::ListFormatter* formatter = icu::ListFormatter::createInstance(
- icu_locale, GetIcuStyleString(style_enum, type_enum), status);
+ icu_locale, GetIcuType(type_enum), GetIcuWidth(style_enum), status);
if (U_FAILURE(status) || formatter == nullptr) {
delete formatter;
THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),

View File

@ -0,0 +1,18 @@
https://github.com/v8/v8/commit/eac21d572e92a82f5656379bc90f8ecf1ff884fc
--- core/Common/3dParty/v8/v8/testing/gmock/BUILD.gn.orig 2020-12-15 12:23:25 UTC
+++ core/Common/3dParty/v8/v8/testing/gmock/BUILD.gn
@@ -15,12 +15,7 @@ source_set("gmock") {
"include/gmock/gmock-matchers.h",
"include/gmock/gmock.h",
]
- deps = [ "//third_party/googletest:gmock" ]
-
- public_configs = [
- "//third_party/googletest:gmock_config",
- "//third_party/googletest:gtest_config",
- ]
+ public_deps = [ "//third_party/googletest:gmock" ]
}
# The file/directory layout of Google Test is not yet considered stable. Until

View File

@ -0,0 +1,11 @@
--- core/Common/3dParty/v8/v8/third_party/zlib/BUILD.gn.orig 2020-11-16 13:31:04 UTC
+++ core/Common/3dParty/v8/v8/third_party/zlib/BUILD.gn
@@ -108,6 +108,8 @@ if (use_arm_neon_optimizations) {
defines = [ "CRC32_ARMV8_CRC32" ]
if (is_android) {
defines += [ "ARMV8_OS_ANDROID" ]
+ } else if (is_bsd) {
+ defines += [ "ARMV8_OS_FREEBSD" ]
} else if (is_linux || is_chromeos) {
defines += [ "ARMV8_OS_LINUX" ]
} else if (is_mac) {

View File

@ -0,0 +1,48 @@
--- core/Common/3dParty/v8/v8/third_party/zlib/cpu_features.c.orig 2020-11-16 13:31:04 UTC
+++ core/Common/3dParty/v8/v8/third_party/zlib/cpu_features.c
@@ -31,11 +31,20 @@ int ZLIB_INTERNAL x86_cpu_enable_simd = 0;
#ifndef CPU_NO_SIMD
-#if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || defined(ARMV8_OS_FUCHSIA)
+#if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || defined(ARMV8_OS_FUCHSIA) || defined(ARMV8_OS_FREEBSD)
#include <pthread.h>
#endif
-#if defined(ARMV8_OS_ANDROID)
+#if defined(ARMV8_OS_FREEBSD)
+#include <machine/armreg.h>
+#include <sys/types.h>
+#ifndef ID_AA64ISAR0_AES_VAL
+#define ID_AA64ISAR0_AES_VAL ID_AA64ISAR0_AES
+#endif
+#ifndef ID_AA64ISAR0_CRC32_VAL
+#define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32
+#endif
+#elif defined(ARMV8_OS_ANDROID)
#include <cpu-features.h>
#elif defined(ARMV8_OS_LINUX)
#include <asm/hwcap.h>
@@ -56,7 +65,7 @@ int ZLIB_INTERNAL x86_cpu_enable_simd = 0;
static void _cpu_check_features(void);
#endif
-#if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || defined(ARMV8_OS_MACOS) || defined(ARMV8_OS_FUCHSIA) || defined(X86_NOT_WINDOWS)
+#if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || defined(ARMV8_OS_MACOS) || defined(ARMV8_OS_FUCHSIA) || defined(X86_NOT_WINDOWS) || defined(ARMV8_OS_FREEBSD)
#if !defined(ARMV8_OS_MACOS)
// _cpu_check_features() doesn't need to do anything on mac/arm since all
// features are known at build time, so don't call it.
@@ -123,6 +132,13 @@ static void _cpu_check_features(void)
#elif defined(ARMV8_OS_WINDOWS)
arm_cpu_enable_crc32 = IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
arm_cpu_enable_pmull = IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
+#elif defined(ARMV8_OS_FREEBSD)
+ uint64_t id_aa64isar0;
+ id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1);
+ if (ID_AA64ISAR0_AES_VAL(id_aa64isar0) == ID_AA64ISAR0_AES_PMULL)
+ arm_cpu_enable_pmull = 1;
+ if (ID_AA64ISAR0_CRC32_VAL(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE)
+ arm_cpu_enable_crc32 = 1;
#endif
}
#endif

View File

@ -0,0 +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;

View File

@ -0,0 +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

View File

@ -0,0 +1,42 @@
--- 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_
}
+freebsd-clang {
+ message("freebsd-clang")
+ CONFIG += core_freebsd
+ CONFIG += core_freebsd_64
+ QMAKE_CC = %%CC%%
+ QMAKE_CXX = %%CXX%%
+}
+
win32:contains(QMAKE_TARGET.arch, x86_64): {
CONFIG += core_win_64
}
@@ -165,6 +173,14 @@ core_windows {
}
}
+core_freebsd {
+ equals(TEMPLATE, app) {
+ QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
+ QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN/system\'"
+ QMAKE_LFLAGS += -Wl,--disable-new-dtags
+ }
+}
+
core_linux {
equals(TEMPLATE, app) {
QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
@@ -178,6 +194,9 @@ core_win_32 {
}
core_win_64 {
CORE_BUILDS_PLATFORM_PREFIX = win_64
+}
+core_freebsd_64 {
+ CORE_BUILDS_PLATFORM_PREFIX = freebsd_64
}
core_linux_32 {
CORE_BUILDS_PLATFORM_PREFIX = linux_32

View File

@ -0,0 +1,21 @@
--- core/Common/kernel.pro.orig 2021-09-30 12:13:32 UTC
+++ core/Common/kernel.pro
@@ -42,6 +42,18 @@ core_windows {
LIBS += -lRpcrt4
LIBS += -lShell32
}
+core_freebsd {
+ CONFIG += use_external_download
+
+ use_external_download {
+ DEFINES += USE_EXTERNAL_DOWNLOAD
+ } else {
+ include(../Common/3dParty/curl/curl.pri)
+ }
+
+ SOURCES += \
+ ./FileDownloader/FileDownloader_curl.cpp
+}
core_linux {
CONFIG += use_external_download

View File

@ -0,0 +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

View File

@ -0,0 +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

View File

@ -0,0 +1,14 @@
--- core/DesktopEditor/Qt_build/graphics/project/graphics_fonts.pri.orig 2021-12-18 10:21:34 UTC
+++ core/DesktopEditor/Qt_build/graphics/project/graphics_fonts.pri
@@ -3,6 +3,11 @@ DEFINES += \
_QT \
FT2_BUILD_LIBRARY
+core_freebsd {
+ DEFINES += \
+ HAVE_UNISTD_H
+}
+
core_linux {
DEFINES += \
HAVE_UNISTD_H

View File

@ -0,0 +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);

View File

@ -0,0 +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);

View File

@ -0,0 +1,14 @@
--- 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

View File

@ -0,0 +1,20 @@
--- core/DesktopEditor/allthemesgen/main.cpp.orig 2021-12-18 19:29:47 UTC
+++ core/DesktopEditor/allthemesgen/main.cpp
@@ -48,7 +48,7 @@
#undef CreateDirectory
#endif
-#ifdef LINUX
+#if defined(LINUX) || defined (__FreeBSD__)
#include <unistd.h>
#include <sys/wait.h>
#include <stdio.h>
@@ -179,7 +179,7 @@ namespace NSX2T
#endif
-#ifdef LINUX
+#if defined(LINUX) || defined (__FreeBSD__)
pid_t pid = fork(); // create child process
int status;

View File

@ -0,0 +1,64 @@
--- 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>
-#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 );
#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
}
} 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
#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;
#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
}
#if defined(_WIN32) || defined (_WIN64)
if (deleteRoot) RemoveDirectoryW(strDirectory.c_str());
-#elif __linux__
+#elif defined(__linux__) || defined(__FreeBSD__)
BYTE* pUtf8 = NULL;
LONG lLen = 0;
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);
#elif MAC
BYTE* pUtf8 = NULL;
LONG lLen = 0;

View File

@ -0,0 +1,42 @@
--- core/DesktopEditor/common/File.cpp.orig 2021-09-30 12:13:32 UTC
+++ core/DesktopEditor/common/File.cpp
@@ -39,11 +39,15 @@
#include <windows.h>
#endif
-#ifdef _LINUX
+#if defined(_LINUX) || defined(__FreeBSD__)
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
+#if defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/sysctl.h>
#endif
+#endif
#ifdef _IOS
const char* fileSystemRepresentation(const std::wstring& sFileName);
@@ -1613,6 +1617,22 @@ namespace NSFile
return L"";
}
+ std::string sUTF8(buf);
+ std::wstring sRet = CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)sUTF8.c_str(), sUTF8.length());
+ return sRet;
+#endif
+
+#if defined(__FreeBSD__)
+ int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
+ char buf[NS_FILE_MAX_PATH];
+ size_t size = NS_FILE_MAX_PATH;
+
+ memset(buf, 0, NS_FILE_MAX_PATH);
+ if (sysctl(mib, 4, &buf, &size, NULL, 0) != 0) {
+ size = readlink("/proc/curproc/file", buf, size - 1);
+ if (size < 0)
+ return L"";
+ }
std::string sUTF8(buf);
std::wstring sRet = CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)sUTF8.c_str(), sUTF8.length());
return sRet;

View File

@ -0,0 +1,29 @@
--- core/DesktopEditor/common/Path.cpp.orig 2021-09-30 12:13:32 UTC
+++ core/DesktopEditor/common/Path.cpp
@@ -34,7 +34,7 @@
#if defined(_WIN32) || defined (_WIN64)
#include <tchar.h>
-#elif __linux__ || MAC
+#elif __linux__ || __FreeBSD__ || MAC
#include <libgen.h>
#endif
@@ -53,7 +53,7 @@ namespace NSSystemPath
sRes.append(tFolder);
if(sRes.length() > 0)
sRes.erase(sRes.length()-1);
-#elif __linux__ || MAC
+#elif __linux__ || __FreeBSD__ || MAC
BYTE* pUtf8 = NULL;
LONG lLen = 0;
NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strFileName.c_str(), strFileName.length(), pUtf8, lLen, false);
@@ -73,7 +73,7 @@ namespace NSSystemPath
sRes.append(tFilename);
sRes.append(tExt);
return sRes;
-#elif __linux__ || MAC
+#elif __linux__ || __FreeBSD__ || MAC
BYTE* pUtf8 = NULL;
LONG lLen = 0;
NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strFileName.c_str(), strFileName.length(), pUtf8, lLen, false);

View File

@ -0,0 +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;

View File

@ -0,0 +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>

View File

@ -0,0 +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 ();

View File

@ -0,0 +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

View File

@ -0,0 +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"

View File

@ -0,0 +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"

View File

@ -0,0 +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

View File

@ -0,0 +1,11 @@
--- core/DesktopEditor/cximage/CxImage/ximapng.h.orig 2021-09-30 12:13:32 UTC
+++ core/DesktopEditor/cximage/CxImage/ximapng.h
@@ -22,7 +22,7 @@
#if CXIMAGE_SUPPORT_PNG
extern "C" {
-#ifdef _LINUX
+#if defined(_LINUX) || defined(__FreeBSD__)
#undef _DLL
#include <png.h>
#include <pngstruct.h>

View File

@ -0,0 +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);

View File

@ -0,0 +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

View File

@ -0,0 +1,38 @@
--- core/DesktopEditor/cximage/tiff/tif_config.h.orig 2021-09-30 12:13:32 UTC
+++ core/DesktopEditor/cximage/tiff/tif_config.h
@@ -19,7 +19,7 @@
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
-#ifndef _LINUX
+#if !defined(_LINUX) && !defined(__FreeBSD__)
#define HAVE_IO_H 1
#endif
@@ -35,7 +35,7 @@
/* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG 4
-#ifndef _LINUX
+#if !defined(_LINUX) && !defined(__FreeBSD__)
/* Signed 64-bit type */
#define TIFF_INT64_T signed __int64
@@ -43,7 +43,7 @@
#define TIFF_UINT64_T unsigned __int64
#endif
-#ifdef _LINUX
+#if defined(_LINUX) || defined(__FreeBSD__)
#include <inttypes.h>
/* Signed 64-bit type */
@@ -69,7 +69,7 @@
//# endif
//#endif
-#ifndef _LINUX
+#if !defined(_LINUX) && !defined(__FreeBSD__)
#define lfind _lfind
#endif
/*

View File

@ -0,0 +1,11 @@
--- core/DesktopEditor/cximage/tiff/tiffconf.h.orig 2021-09-30 12:13:32 UTC
+++ core/DesktopEditor/cximage/tiff/tiffconf.h
@@ -33,7 +33,7 @@
#define TIFF_UINT64_T unsigned __int64
#endif
-#ifdef _LINUX
+#if defined(_LINUX) || defined(__FreeBSD__)
#include <inttypes.h>
/* Signed 64-bit type */

View File

@ -0,0 +1,11 @@
--- 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

View File

@ -0,0 +1,11 @@
--- core/DesktopEditor/doctrenderer/app_builder/main.cpp.orig 2021-09-30 12:13:32 UTC
+++ core/DesktopEditor/doctrenderer/app_builder/main.cpp
@@ -34,7 +34,7 @@
#include "../docbuilder.h"
#include "../../common/File.h"
-#ifdef LINUX
+#if defined(LINUX) || defined(__FreeBSD__)
#include "../../../DesktopEditor/common/File.h"
#endif

View File

@ -0,0 +1,29 @@
--- core/DesktopEditor/doctrenderer/docbuilder_p.h.orig 2021-09-30 12:13:32 UTC
+++ core/DesktopEditor/doctrenderer/docbuilder_p.h
@@ -50,7 +50,7 @@
#include "embed/NativeControlEmbed.h"
#include "embed/MemoryStreamEmbed.h"
#include "embed/GraphicsEmbed.h"
-#ifdef LINUX
+#if defined(LINUX) || defined(__FreeBSD__)
#include <unistd.h>
#include <sys/wait.h>
#include <stdio.h>
@@ -536,7 +536,7 @@ namespace NSDoctRenderer
#endif
- #ifdef LINUX
+ #if defined(LINUX) || defined(__FreeBSD__)
pid_t pid = fork(); // create child process
int status;
@@ -848,7 +848,7 @@ namespace NSDoctRenderer
#endif
- #ifdef LINUX
+ #if defined(LINUX) || defined(__FreeBSD__)
pid_t pid = fork(); // create child process
int status;

View File

@ -0,0 +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
}

View File

@ -0,0 +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;
}

View File

@ -0,0 +1,22 @@
--- core/DesktopEditor/fontengine/ApplicationFonts.cpp.orig 2021-09-30 12:13:32 UTC
+++ core/DesktopEditor/fontengine/ApplicationFonts.cpp
@@ -1596,6 +1596,8 @@ void CApplicationFonts::Initialize(bool bIsCheckSelect
#if defined(_LINUX) && !defined(_MAC) && !defined(__ANDROID__)
m_oList.LoadFromFolder(L"/usr/share/fonts");
+#else if defined(__FreeBSD__)
+ m_oList.LoadFromFolder(L"%%LOCALBASE%%/share/fonts");
#endif
#if defined(_MAC) && !defined(_IOS)
@@ -1769,6 +1771,10 @@ 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);
+ return _array;
+#elif defined(__FreeBSD__)
+ std::vector<std::wstring> _array = NSDirectory::GetFiles(L"/usr/share/fonts", true);
+ NSDirectory::GetFiles2(L"%%LOCALBASE%%/share/fonts", _array, true);
return _array;
#endif

View File

@ -0,0 +1,11 @@
--- core/DesktopEditor/fontengine/MemoryStream.h.orig 2021-09-30 12:13:32 UTC
+++ core/DesktopEditor/fontengine/MemoryStream.h
@@ -41,7 +41,7 @@
//#define _LOGGING_NATIVE_
#endif
-#ifdef _LINUX
+#if defined(_LINUX) || defined(__FreeBSD__)
#include <stdlib.h>
#endif

View File

@ -0,0 +1,11 @@
--- core/DesktopEditor/fontengine/fontconverter/MemoryUtils.h.orig 2021-09-30 12:13:32 UTC
+++ core/DesktopEditor/fontengine/fontconverter/MemoryUtils.h
@@ -37,7 +37,7 @@
#include <string>
#include <stdlib.h>
-#ifdef __linux__
+#ifdef __linux__ || __FreeBSD__
#include <string.h>
#endif

View File

@ -0,0 +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

View File

@ -0,0 +1,14 @@
--- core/DesktopEditor/graphics/pro/graphics.pro.orig 2021-12-18 11:22:47 UTC
+++ core/DesktopEditor/graphics/pro/graphics.pro
@@ -35,6 +35,11 @@ DEFINES += \
DEFINES += FT_SUPPORT_UTF8_IN_NAMES
+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

View File

@ -0,0 +1,15 @@
--- core/DesktopEditor/graphics/pro/raster.pri.orig 2021-12-18 10:21:34 UTC
+++ core/DesktopEditor/graphics/pro/raster.pri
@@ -11,6 +11,12 @@ DEFINES += \
MNG_STORE_CHUNKS\
MNG_ERROR_TELLTALE
+core_freebsd {
+ DEFINES += \
+ HAVE_UNISTD_H
+ QMAKE_CXXFLAGS += -Wno-narrowing
+}
+
core_linux {
DEFINES += \
HAVE_UNISTD_H

View File

@ -0,0 +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

Some files were not shown because too many files have changed in this diff Show More