Compare commits

..

99 Commits

Author SHA1 Message Date
332cd6240b Add libaom to libheif build 2026-02-02 13:35:28 +03:00
4dda7dfa7a Merge branch 'release/v9.3.0' into develop 2026-01-14 15:40:31 +03:00
4001a636db Fix boost build (macos) 2026-01-12 17:01:23 +03:00
cf4c2fc02f [build] Pin @yao-pkg/pkg to version 6.11.0; For bug 76727 2025-12-30 17:17:58 +03:00
f94a95df22 Merge branch 'hotfix/v9.2.1' into release/v9.3.0 2025-12-28 15:07:46 +03:00
7cbaa00356 Merge branch hotfix/v9.2.1 into develop 2025-12-26 16:09:43 +00:00
76fd5a0d37 Merge pull request 'Add starmath lib to sln.json' (#158) from fix/build-starmath into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/158
2025-12-26 11:43:21 +00:00
db1b2c01fc Add starmath lib to deploy 2025-12-26 15:40:03 +04:00
9cc6e0b749 Add starmath lib to sln.json 2025-12-26 14:44:12 +04:00
8912b82d1f Fix typo 2025-12-26 10:58:34 +03:00
d6e215595f Fix create whl package 2025-12-26 02:01:25 +03:00
6f59b470a3 Refactoring 2025-12-26 01:42:56 +03:00
9241aa8a9b Fix typo 2025-12-26 01:10:22 +03:00
87a7c2922b Remove symlinks in whl package 2025-12-26 00:46:05 +03:00
211348776c Fix icu build for mac_64 2025-12-26 00:37:12 +03:00
b2f6b6e2c3 Fix deploy macos builder 2025-12-25 23:50:17 +03:00
ee324a764e Fix desktopeditors-help packages upload 2025-12-24 11:15:13 +03:00
cee13fbcbe Remove use sysroot for copy (generate) boost headers 2025-12-23 15:08:34 +03:00
453786b595 Remove debug commit 2025-12-22 20:08:01 +03:00
9eb7651e84 Merge branch 'hotfix/v9.2.1' of https://git.onlyoffice.com/ONLYOFFICE/build_tools into hotfix/v9.2.1 2025-12-22 19:55:17 +03:00
7b37cc9f83 Fix fetch sysroots 2025-12-22 19:55:07 +03:00
c2a38839dd Fix sysroot fetch command 2025-12-22 19:54:50 +03:00
be9f90d220 Fix deploy for cross arm builds 2025-12-22 12:25:21 +03:00
91937f3d77 Add instructions for linux setup 2025-12-22 06:05:35 +03:00
e70acf9822 Refactoring sysroots 2025-12-22 05:59:02 +03:00
243a14ddb9 Fix typo 2025-12-21 22:58:04 +03:00
fd7cf76aea Fix typo 2025-12-21 22:00:32 +03:00
e48534d14c Fix typo 2025-12-21 20:51:38 +03:00
055ff85f68 Fix typo 2025-12-21 18:46:25 +03:00
12a1765ca0 Fix v8.data path 2025-12-21 18:45:21 +03:00
763dea4889 Add script for fetch python 2025-12-21 17:03:55 +03:00
38a3863213 Fix typo 2025-12-21 16:31:07 +03:00
c860de3721 Add missed file 2025-12-21 15:43:18 +03:00
3ce6a41dce Refactoring sysroots 2025-12-21 15:11:47 +03:00
c69158af8f Refactoring fetch sysroots 2025-12-20 22:56:27 +03:00
b47b412529 Refactoring 2025-12-20 22:44:35 +03:00
355ae98932 Merge branch hotfix/v9.2.1 into release/v9.3.0 2025-12-17 15:25:36 +00:00
4d812fa6d2 Merge branch hotfix/v9.2.1 into develop 2025-12-17 15:25:35 +00:00
430a9878e5 Merge pull request 'Up version to 9.2.1' (#156) from fix/version9.2.1 into hotfix/v9.2.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/156
2025-12-16 07:06:39 +00:00
561c648069 Up version to 9.2.1 2025-12-16 10:08:45 +05:00
f99bcd2ed0 Merge branch release/v9.2.0 into develop 2025-12-10 10:29:26 +00:00
df1c566005 Merge branch release/v9.2.0 into master 2025-12-10 10:29:24 +00:00
d548d731ae Update scripts/package_builder.py 2025-12-09 13:46:12 +00:00
4e1cfb10b4 [develop] Fix check_rabbitmq and check_postgreSQL not starting on Debian 2025-12-05 18:38:08 +03:00
4d767c127b Merge branch release/v9.2.0 into master 2025-12-01 07:23:27 +00:00
71d9e34164 Fix check arm system 2025-11-28 13:54:34 +03:00
d3a2f05945 Merge pull request 'Up version to 9.2.0' (#154) from fix/version9.2.0 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/154
2025-11-27 15:13:31 +00:00
97b4421e3c Up version to 9.2.0 2025-11-27 19:50:23 +05:00
73576ff817 Merge branch 'release/v9.2.0' of https://git.onlyoffice.com/ONLYOFFICE/build_tools into release/v9.2.0 2025-11-21 22:48:04 +03:00
b4ba33bb69 Remove AI agent from macos v8 version 2025-11-21 22:47:54 +03:00
e04df1ba9a Optimize package build 2025-11-21 15:43:01 +03:00
dd148a105e Merge pull request 'Fix desktop build' (#152) from fix/sysroot into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/152
2025-11-14 18:04:41 +00:00
acf75749c2 Fix desktop build 2025-11-14 07:03:45 +03:00
354e4a6a04 Merge pull request 'Fix build with newer qmake' (#151) from fix/sysroot into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/151
2025-11-13 12:19:21 +00:00
b85fb9c07c Fix build with newer qmake 2025-11-13 14:33:11 +03:00
40b95455a0 Fix package branding build (#146)
Co-authored-by: Semyon Bezrukov <semen.bezrukov@onlyoffice.com>
Co-committed-by: Semyon Bezrukov <semen.bezrukov@onlyoffice.com>
2025-10-28 15:13:29 +00:00
eef1d728b5 Merge branch release/v9.1.0 into develop 2025-10-28 11:57:35 +00:00
cc24ee8e85 Merge branch release/v9.1.0 into master 2025-10-28 11:57:34 +00:00
62ab1f9935 Fix xp build 2025-10-27 18:44:19 +03:00
dd26863a2b Enable agent 2025-10-27 14:25:46 +03:00
c02a387a64 Add support version for v8_89 2025-10-27 14:24:46 +03:00
0fd6852fe8 Merge pull request 'Fix build for mac_64' (#145) from release/v9.1.0 into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/145
2025-10-27 11:01:07 +00:00
0dbf009c6b Fix build for mac_64 2025-10-27 14:00:06 +03:00
44b6d2d64f Fix windows arm64 packages build 2025-10-23 16:19:18 +03:00
b2ce2bbcad Merge pull request 'release/v9.1.0' (#143) from release/v9.1.0 into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/143
2025-10-21 20:20:48 +00:00
133192df35 Fix build 2025-10-20 21:14:13 +03:00
c45cf77747 Fix socket.io fetch 2025-10-19 20:41:21 +03:00
9f898d6873 Merge pull request 'feature/win-arm-qemu' (#142) from feature/win-arm-qemu into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/142
2025-10-18 08:48:04 +00:00
61bf2d9413 Fix typo 2025-10-18 11:47:14 +03:00
0c8b3e5919 Refactoring 2025-10-18 11:44:05 +03:00
6fd500e55d Remove unused code 2025-10-17 19:07:17 +03:00
10f7dcee17 Add exe extension 2025-10-17 19:02:45 +03:00
2fcdef2e00 Add README.md 2025-10-17 18:36:20 +03:00
2ec27065f8 Add start.bat and gitignore 2025-10-17 18:18:27 +03:00
4f804ba0e6 Add shutdown 2025-10-17 18:02:16 +03:00
7fb05a51f9 Fix bug 2025-10-17 17:51:27 +03:00
30e3202fd5 Rewrite deploying 2025-10-17 17:40:35 +03:00
b6b09d17f4 Add config option 2025-10-17 14:38:46 +03:00
8a70f3d14a Add generation for all products 2025-10-17 14:03:13 +03:00
aaa5096526 Fix bug 2025-10-16 17:05:44 +03:00
668aa88c6e Developing execution win arm qemu 2025-10-16 17:03:01 +03:00
ec544ca9ab Developing 2025-10-16 14:34:16 +03:00
17ee00a04c Fix windows build 2025-10-15 17:25:47 +03:00
bc4daa9546 Merge pull request '[jsdoc] Fix paths' (#141) from fix/js-doc into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/141
2025-10-15 11:14:48 +00:00
099003b250 [jsdoc] Fix paths 2025-10-15 18:11:05 +07:00
4ca5e4bcb5 Merge branch release/v9.1.0 into master 2025-10-14 14:34:05 +00:00
ee4469885e Merge pull request 'Fix intecative request to keyboard' (#140) from fix/docker-debconfig into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/140
2025-10-13 14:41:47 +00:00
1350955f67 Fix intecative request to keyboard 2025-10-13 18:47:08 +05:00
de36280085 Fix build 2025-10-13 13:17:08 +03:00
0399ea1cb1 Merge pull request 'fix/docker-cmake3.30' (#139) from fix/docker-cmake3.30 into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/139
2025-10-12 14:24:30 +00:00
41ed9824ab Disable ai-agent 2025-10-10 14:23:22 +03:00
842df5ffd0 Up version to 9.1.0 2025-10-08 14:49:36 +05:00
d0e3f36313 Add cmake3.30 in Dockerfile 2025-10-08 12:26:25 +05:00
2ffc1b9347 Merge branch hotfix/v9.0.4 into master 2025-09-11 08:38:14 +00:00
5a403cb3ac Merge pull request 'fix/jsdoc' (#107) from fix/jsdoc into master 2025-08-13 14:29:55 +00:00
d435dd496b [jsdoc] Fix typo 2025-08-12 19:05:12 +07:00
252a5c306d [jsdoc] gen plugins events summary file 2025-08-12 19:04:28 +07:00
fc9d060a78 Merge branch hotfix/v9.0.4 into master 2025-08-06 08:26:46 +00:00
6c700fe492 Merge branch hotfix/v9.0.4 into master 2025-08-05 14:06:58 +00:00
57 changed files with 1247 additions and 682 deletions

3
.gitignore vendored
View File

@ -15,6 +15,3 @@ tests/puppeteer/package.json
tests/puppeteer/package-lock.json
scripts/sdkjs_common/jsdoc/node_modules
scripts/sdkjs_common/jsdoc/package-lock.json
tools/linux/python3/
tools/linux/python3.tar.gz
tools/linux/sysroot/sysroot_ubuntu_1604

View File

@ -1,13 +1,24 @@
FROM ubuntu:20.04
ENV TZ=Etc/UTC
ENV DEBIAN_FRONTEND=noninteractive
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN echo 'keyboard-configuration keyboard-configuration/layoutcode string us' | debconf-set-selections && \
echo 'keyboard-configuration keyboard-configuration/modelcode string pc105' | debconf-set-selections
RUN apt-get -y update && \
apt-get -y install tar \
sudo \
wget
RUN wget https://github.com/Kitware/CMake/releases/download/v3.30.0/cmake-3.30.0-linux-x86_64.tar.gz && \
tar -xzf cmake-3.30.0-linux-x86_64.tar.gz -C /opt && \
ln -s /opt/cmake-3.30.0-linux-x86_64/bin/cmake /usr/local/bin/cmake && \
ln -s /opt/cmake-3.30.0-linux-x86_64/bin/ctest /usr/local/bin/ctest && \
rm cmake-3.30.0-linux-x86_64.tar.gz
ADD . /build_tools
WORKDIR /build_tools

View File

@ -43,6 +43,7 @@ parser.add_option("--vs-path", action="store", type="string", dest="vs-path", de
parser.add_option("--siteUrl", action="store", type="string", dest="siteUrl", default="127.0.0.1", help="site url")
parser.add_option("--multiprocess", action="store", type="string", dest="multiprocess", default="1", help="provides ability to specify single process for make")
parser.add_option("--sysroot", action="store", type="string", dest="sysroot", default="0", help="provides ability to use sysroot (ubuntu 16.04) to build c++ code. If value is \"1\", then the sysroot from tools/linux/sysroot will be used, and if it is not there, it will download it and unpack it. You can also set value as the path to the your own sysroot (rarely used). Only for linux")
parser.add_option("--qemu-win-arm64-dir", action="store", type="string", dest="qemu-win-arm64-dir", default="", help="dir to qemu virtual machine for win_arm64 cross build. It should contains start.bat. More info in tools/win/qemu.")
(options, args) = parser.parse_args(arguments)
configOptions = vars(options)

66
linux-start.sh Normal file
View File

@ -0,0 +1,66 @@
sudo apt-get install git curl wget p7zip-full
sudo apt-get install git-lfs
# for old system (ubuntu 16)
#curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
#sudo apt-get install git-lfs
# save login
git config --global credential.helper store
# clone build_tools
git clone https://git.onlyoffice.com/ONLYOFFICE/build_tools.git
# deps =========================================
cd ./build_tools/tools/linux
# python 3.10
./python.sh
# qt
#./python3/bin/python3 ./qt_binary_fetch.py amd64
#./python3/bin/python3 ./qt_binary_fetch.py arm64
./python3/bin/python3 ./qt_binary_fetch.py all
# deps
./python3/bin/python3 ./deps.py
# cmake 3.30
sudo ./cmake.sh
cd ../../
# ==============================================
# sysroots (IF NEEDED) =========================
cd ./build_tools/tools/linux/sysroot
#./python3/bin/python3 ./fetch.py amd64
#./python3/bin/python3 ./fetch.py arm64
./../python3/bin/python3 ./fetch.py all
cd ../../../
# ==============================================
# configure ====================================
./tools/linux/python3/bin/python3 ./configure.py --clean "0" --update-light "1" --update "1" --branch "hotfix/v9.2.1" --module "desktop" --qt-dir "$(pwd)/tools/linux/qt_build/Qt-5.9.9"
# with sysroot: sysroot "1"
# ==============================================
# cross build linux_arm64
sudo apt install qemu-user qemu-user-static binfmt-support
sudo update-binfmts --enable qemu-aarch64
# 1) without sysroot
#sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
#sudo dpkg --add-architecture arm64
#sudo apt update
#... install all dev packages ...
# 2) official supported: with sysroot
./tools/linux/python3/bin/python3 ./configure.py sysroot "1" #...

View File

@ -37,9 +37,11 @@ def is_os_64bit():
return platform.machine().endswith('64')
def is_os_arm():
if -1 == platform.machine().find('arm'):
return False
return True
if -1 != platform.machine().lower().find('arm'):
return True
if -1 != platform.machine().lower().find('aarch64'):
return True
return False
def get_platform():
return platform.machine().lower()
@ -431,11 +433,46 @@ def cmd_in_dir(directory, prog, args=[], is_no_errors=False):
return ret
def cmd_in_dir_qemu(platform, directory, prog, args=[], is_no_errors=False):
if (platform == "linux_arm64"):
return cmd_in_dir(directory, "qemu-aarch64", ["-L", "/usr/aarch64-linux-gnu", prog] + args, is_no_errors)
if (platform == "linux_arm32"):
return cmd_in_dir(directory, "qemu-arm", ["-L", "/usr/arm-linux-gnueabi", prog] + args, is_no_errors)
return 0
platform_config = {
"linux_arm64": {
"qemu": "qemu-aarch64",
"default_libs": "/usr/aarch64-linux-gnu"
},
"linux_arm32": {
"qemu": "qemu-arm",
"default_libs": "/usr/arm-linux-gnueabi"
}
}
if platform not in platform_config:
return 0
libs_path = platform_config[platform]["default_libs"]
if config.option("sysroot") != "":
libs_path = config.option("sysroot_" + platform)
return cmd_in_dir(directory, platform_config[platform]["qemu"], ["-L", libs_path, prog] + args, is_no_errors)
def create_qemu_wrapper(binary_path, platform):
binary_dir = os.path.dirname(binary_path)
binary_name = os.path.basename(binary_path)
binary_bin = binary_path + '.bin'
sysroot = config.option("sysroot_" + platform)
if os.path.exists(binary_path):
os.rename(binary_path, binary_bin)
wrapper_content = f'''#!/bin/bash
DIR="$(cd "$(dirname "${{BASH_SOURCE[0]}}")" && pwd)"
export QEMU_LD_PREFIX={sysroot}
exec qemu-aarch64 -L {sysroot} "$DIR/{binary_name}.bin" "$@"
'''
with open(binary_path, 'w') as f:
f.write(wrapper_content)
os.chmod(binary_path, 0o755)
return binary_bin
def cmd_and_return_cwd(prog, args=[], is_no_errors=False):
cur_dir = os.getcwd()
@ -689,18 +726,25 @@ def git_dir():
if ("windows" == host_platform()):
return run_command("git --info-path")['stdout'] + "/../../.."
def get_prefix_cross_compiler_arm64():
cross_compiler_arm64 = config.option("arm64-toolchain-bin")
if is_file(cross_compiler_arm64 + "/aarch64-linux-gnu-g++") and is_file(cross_compiler_arm64 + "/aarch64-linux-gnu-gcc"):
return "aarch64-linux-gnu-"
if is_file(cross_compiler_arm64 + "/aarch64-unknown-linux-gnu-g++") and is_file(cross_compiler_arm64 + "/aarch64-unknown-linux-gnu-gcc"):
return "aarch64-unknown-linux-gnu-"
return ""
def get_compiler_gcc_prefix(platform):
directory = "/usr/bin"
if config.option("sysroot") != "":
use_platform = platform
if ("linux_arm64" == platform and not is_os_arm()):
use_platform = "linux_64"
directory = config.option("sysroot_" + use_platform) + "/usr/bin"
if ("linux_arm64" == platform and not is_os_arm()):
return directory + "/aarch64-linux-gnu-"
return directory + "/"
def get_gcc_version():
gcc_path = "gcc"
# if use sysroot - fix gcc version
if config.option("sysroot") != "":
gcc_path = config.option("sysroot") + "/usr/bin/gcc"
return 5004
gcc_path = "gcc"
gcc_version_major = 4
gcc_version_minor = 0
gcc_version_str = run_command(gcc_path + " -dumpfullversion -dumpversion")['stdout']
@ -750,13 +794,6 @@ def qt_setup(platform):
set_env("QT_QMAKE_ADDON", "-spec win32-arm64-msvc2017")
set_env("QT_DEPLOY", qt_dir + "/bin")
if ("linux_arm64" == platform):
cross_compiler_arm64 = config.option("arm64-toolchain-bin")
if ("" != cross_compiler_arm64):
set_env("ARM64_TOOLCHAIN_BIN", cross_compiler_arm64)
set_env("ARM64_TOOLCHAIN_BIN_PREFIX", get_prefix_cross_compiler_arm64())
return qt_dir
def qt_version():
@ -897,30 +934,35 @@ def qt_copy_lib(lib, dir):
def _check_icu_common(dir, out):
isExist = False
for file in glob.glob(dir + "/libicu*"):
isExist = True
break
# Skip static libraries
if not file.endswith('.a'):
isExist = True
break
if isExist:
copy_files(dir + "/libicui18n*", out)
copy_files(dir + "/libicuuc*", out)
copy_files(dir + "/libicudata*", out)
# Copy only shared libraries (skip .a files)
for pattern in ["/libicui18n*", "/libicuuc*", "/libicudata*"]:
for file in glob.glob(dir + pattern):
if not file.endswith('.a'):
copy_file(file, out)
return isExist
def qt_copy_icu(out):
def qt_copy_icu(out, platform):
tests = [get_env("QT_DEPLOY") + "/../lib"]
prefix = ""
postfixes = [""]
# TODO add for linux arm desktop build
if config.option("sysroot") != "":
prefix = config.option("sysroot")
if config.option("sysroot_" + platform) != "":
prefix = config.option("sysroot_" + platform)
else:
prefix = ""
postfixes += ["/x86_64-linux-gnu"]
postfixes += ["/i386-linux-gnu"]
if ("linux_64" == platform):
postfixes += ["/x86_64-linux-gnu"]
elif ("linux_arm64" == platform):
postfixes += ["/aarch64-linux-gnu"]
elif ("linux_32" == platform):
postfixes += ["/i386-linux-gnu"]
for postfix in postfixes:
tests += [prefix + "/lib" + postfix]
tests += [prefix + "/lib64" + postfix]
@ -1349,7 +1391,8 @@ def mac_correct_rpath_x2t(dir):
mac_correct_rpath_library("OFDFile", ["UnicodeConverter", "kernel", "graphics", "PdfFile"])
mac_correct_rpath_library("DocxRenderer", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("IWorkFile", ["UnicodeConverter", "kernel"])
mac_correct_rpath_library("HWPFile", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("HWPFile", ["UnicodeConverter", "kernel", "graphics", "StarMathConverter"])
mac_correct_rpath_library("StarMathConverter", ["kernel"])
def correct_core_executable(name, libs):
cmd("chmod", ["-v", "+x", name])
@ -1357,7 +1400,7 @@ def mac_correct_rpath_x2t(dir):
mac_correct_rpath_binary(name, mac_icu_libs + libs)
return
correct_core_executable("x2t", ["UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer", "DocxRenderer", "IWorkFile", "HWPFile"])
correct_core_executable("x2t", ["UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer", "DocxRenderer", "IWorkFile", "HWPFile", "StarMathConverter"])
if is_file("./allfontsgen"):
correct_core_executable("allfontsgen", ["UnicodeConverter", "kernel", "graphics"])
if is_file("./allthemesgen"):
@ -1664,6 +1707,9 @@ def replaceFileLicence(path, license):
def copy_v8_files(core_dir, deploy_dir, platform, is_xp=False):
if (-1 != config.option("config").find("use_javascript_core")):
return
if (0 == platform.find("mac")) and not (config.check_option("config", "use_v8")):
return
directory_v8 = core_dir + "/Common/3dParty"
if is_xp:
@ -1887,25 +1933,38 @@ def check_module_version(actual_version, clear_func):
clear_func()
return
def set_sysroot_env():
def set_sysroot_env(platform):
global ENV_BEFORE_SYSROOT
ENV_BEFORE_SYSROOT = dict(os.environ)
if "linux" == host_platform() and config.option("sysroot") != "":
os.environ['PATH'] = config.option("sysroot") + "/usr/bin:" + get_env("PATH")
os.environ['LD_LIBRARY_PATH'] = config.get_custom_sysroot_lib()
os.environ['QMAKE_CUSTOM_SYSROOT'] = config.option("sysroot")
os.environ['PKG_CONFIG_PATH'] = config.get_custom_sysroot_lib() + "/pkgconfig"
os.environ['CC'] = config.get_custom_sysroot_bin() + "/gcc"
os.environ['CXX'] = config.get_custom_sysroot_bin() + "/g++"
os.environ['CFLAGS'] = "--sysroot=" + config.option("sysroot")
os.environ['CXXFLAGS'] = "--sysroot=" + config.option("sysroot")
check_python()
if "linux" != host_platform():
return
if config.option("sysroot") == "":
return
path = config.option("sysroot_" + platform)
sysroot_path_bin = config.get_custom_sysroot_bin(platform)
compiler_gcc_prefix = get_compiler_gcc_prefix(platform)
os.environ['PATH'] = sysroot_path_bin + ":" + get_env("PATH")
os.environ['LD_LIBRARY_PATH'] = config.get_custom_sysroot_lib(platform)
os.environ['CC'] = compiler_gcc_prefix + "gcc"
os.environ['CXX'] = compiler_gcc_prefix + "g++"
os.environ['AR'] = compiler_gcc_prefix + "ar"
os.environ['RANLIB'] = compiler_gcc_prefix + "ranlib"
os.environ['CFLAGS'] = "--sysroot=" + path
os.environ['CXXFLAGS'] = "--sysroot=" + path
os.environ['LDFLAGS'] = "--sysroot=" + path
check_python()
return
def restore_sysroot_env():
os.environ.clear()
os.environ.update(ENV_BEFORE_SYSROOT)
def check_python():
if ("linux" != host_platform()):
return
@ -1914,8 +1973,9 @@ def check_python():
if not is_dir(directory + "/python3"):
download('https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/python/python3.tar.gz', directory + "/python3.tar.gz")
cmd("tar", ["xfz", directory + "/python3.tar.gz", "-C", directory])
cmd("ln", ["-s", directory_bin + "/python3", directory_bin + "/python"])
download('https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/python/extract.sh', directory + "/extract.sh")
cmd_in_dir(directory, "chmod", ["+x", "./extract.sh"])
cmd_in_dir(directory, "./extract.sh")
directory_bin = directory_bin.replace(" ", "\\ ")
os.environ["PATH"] = directory_bin + os.pathsep + os.environ["PATH"]
return
@ -1972,6 +2032,36 @@ def get_autobuild_version(product, platform="", branch="", build=""):
download_addon = download_branch + "/" + download_build + "/" + product + "-" + download_platform + ".7z"
return "http://repo-doc-onlyoffice-com.s3.amazonaws.com/archive/" + download_addon
def is_use_create_artifacts_qemu_any_platform():
if config.check_option("platform", "win_arm64") and not is_os_arm():
return True
return False
def is_use_create_artifacts_qemu(platform):
if platform == "win_arm64" and not is_os_arm():
return True
return False
def create_artifacts_qemu_any_platform():
if not is_use_create_artifacts_qemu_any_platform():
return
if config.check_option("platform", "win_arm64"):
create_artifacts_qemu_win_arm()
return;
def create_artifacts_qemu_win_arm():
if config.option("qemu-win-arm64-dir") == "":
print("For deploying win_arm64 on non arm host you should provide qemu-win-arm64-dir. More info in tools/win/qemu/README.md")
return
old_curr_dir = os.path.abspath(os.curdir)
qemu_dir = os.path.abspath(config.option("qemu-win-arm64-dir"))
os.chdir(qemu_dir)
start_qemu_bat_path = f"start.bat"
cmd(start_qemu_bat_path, [])
os.chdir(old_curr_dir)
def create_x2t_js_cache(dir, product, platform):
# mac
if is_file(dir + "/libdoctrenderer.dylib") or is_dir(dir + "/doctrenderer.framework"):

View File

@ -63,12 +63,6 @@ def parse():
if not check_option("platform", "win_64"):
options["platform"] = "win_64 " + options["platform"]
if ("linux" == host_platform) and check_option("platform", "linux_arm64") and not base.is_os_arm():
if not check_option("platform", "linux_64"):
# linux_64 binaries need only for desktop
if check_option("module", "desktop"):
options["platform"] = "linux_64 " + options["platform"]
if check_option("platform", "xp") and ("windows" == host_platform):
options["platform"] += " win_64_xp win_32_xp"
@ -93,17 +87,17 @@ def parse():
options["sysroot"] = ""
elif options["sysroot"] == "1":
dst_dir = os.path.abspath(base.get_script_dir(__file__) + '/../tools/linux/sysroot')
custom_sysroot = dst_dir + '/sysroot_ubuntu_1604'
options["sysroot"] = custom_sysroot
if not os.path.isdir(custom_sysroot):
print("Sysroot is not found, downloading...")
sysroot_url = 'https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/sysroot/sysroot_ubuntu_1604.tar.xz'
base.download(sysroot_url, dst_dir + '/sysroot_ubuntu_1604.tar.xz')
os.mkdir(custom_sysroot)
print("Unpacking...")
base.cmd2('tar', ['-xf', dst_dir + '/sysroot_ubuntu_1604.tar.xz', '-C', dst_dir])
if os.path.exists(dst_dir + '/sysroot_ubuntu_1604.tar.xz'):
os.remove(dst_dir + '/sysroot_ubuntu_1604.tar.xz')
dst_dir_amd64 = dst_dir + "/ubuntu16-amd64-sysroot"
dst_dir_arm64 = dst_dir + "/ubuntu16-arm64-sysroot"
if not base.is_dir(dst_dir_amd64) or not base.is_dir(dst_dir_arm64):
base.cmd_in_dir(dst_dir, "python3", ["./fetch.py", "all"])
options["sysroot_linux_64"] = dst_dir_amd64
options["sysroot_linux_arm64"] = dst_dir_arm64
else:
# specific sysroot => one platform for build!
options["sysroot"] = "1"
options["sysroot_linux_64"] = options["sysroot"]
options["sysroot_linux_arm64"] = options["sysroot"]
if is_cef_107():
extend_option("config", "cef_version_107")
@ -131,12 +125,6 @@ def parse():
if not "sdkjs-plugin-server" in options:
options["sdkjs-plugin-server"] = "default"
if not "arm64-toolchain-bin" in options:
if not "sysroot" in options:
options["arm64-toolchain-bin"] = "/usr/bin"
else:
options["arm64-toolchain-bin"] = get_custom_sysroot_bin()
if check_option("platform", "ios"):
if not check_option("config", "no_bundle_xcframeworks"):
if not check_option("config", "bundle_xcframeworks"):
@ -236,13 +224,25 @@ def is_mobile_platform():
return True
return False
def get_custom_sysroot_bin():
return option("sysroot") + "/usr/bin"
def get_custom_sysroot_bin(platform):
use_platform = platform
if "linux_arm64" == platform and not base.is_os_arm():
# use cross compiler
use_platform = "linux_64"
# todo 32bit support?
def get_custom_sysroot_lib():
if base.is_os_64bit():
return option("sysroot") + "/usr/lib/x86_64-linux-gnu"
return option("sysroot_" + use_platform) + "/usr/bin"
def get_custom_sysroot_lib(platform, isNatural=False):
use_platform = platform
if "linux_arm64" == platform and not base.is_os_arm() and not isNatural:
# use cross compiler
use_platform = "linux_64"
if ("linux_64" == use_platform):
return option("sysroot_linux_64") + "/usr/lib/x86_64-linux-gnu"
if ("linux_arm64" == use_platform):
return option("sysroot_linux_arm64") + "/usr/lib/aarch64-linux-gnu"
return ""
def parse_defaults():
defaults_path = base.get_script_dir() + "/../defaults"

View File

@ -26,7 +26,6 @@ import hyphen
import googletest
import libvlc
import heif
import webp
def check_android_ndk_macos_arm(dir):
if base.is_dir(dir + "/darwin-x86_64") and not base.is_dir(dir + "/darwin-arm64"):
@ -56,7 +55,6 @@ def make():
googletest.make()
oo_brotli.make()
heif.make()
webp.make()
if config.check_option("build-libvlc", "1"):
libvlc.make()

View File

@ -138,14 +138,14 @@ def make():
if (-1 != config.option("platform").find("android")) and not base.is_dir("../build/android"):
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"])
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
if config.check_option("platform", "mac_64") and not base.is_dir("../build/mac_64"):
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "mac_64")
directory_build = base_dir + "/build/mac_64/lib"
base.delete_file(directory_build + "/libboost_system.a")
base.delete_file(directory_build + "/libboost_system.dylib")
base.copy_files(directory_build + "/mac_64/*.a", directory_build)
if (-1 != config.option("platform").find("mac_arm64")) and not base.is_dir("../build/mac_arm64"):
if config.check_option("platform", "mac_arm64") and not base.is_dir("../build/mac_arm64"):
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "mac_arm64")
directory_build = base_dir + "/build/mac_arm64/lib"
base.delete_file(directory_build + "/libboost_system.a")

View File

@ -14,18 +14,8 @@ def make(src_dir, modules, build_platform="android", qmake_addon=""):
print("boost-headers...")
# for b2 checks
if config.option("sysroot") != "":
base.set_sysroot_env()
b2_addon = "cflags=\"--sysroot=" + config.option("sysroot") + "\""
b2_addon = "cxxflags=\"--sysroot=" + config.option("sysroot") + "\""
b2_addon = "linkflags=\"--sysroot=" + config.option("sysroot") + "\""
base.cmd("./bootstrap.sh", ["--with-libraries=system"])
base.cmd("./b2", ["--prefix=./../build/" + build_platform, "headers", "install", b2_addon])
if config.option("sysroot") != "":
base.restore_sysroot_env()
base.cmd("./bootstrap.sh", ["--with-libraries=system"])
base.cmd("./b2", ["--prefix=./../build/" + build_platform, "headers", "install"])
for module in modules:
print("boost-module: " + module + " ...")

View File

@ -21,7 +21,7 @@ def make():
os.chdir(base_dir)
base.check_module_version("2", clear_module)
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32", "mac_64", "mac_arm64", "win_arm64"]
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32", "mac_64", "mac_arm64", "win_arm64", "linux_arm64"]
for platform in platforms:
if not config.check_option("platform", platform):

View File

@ -10,6 +10,7 @@ import config
# libs versions
X265_VERSION = "4.1"
DE265_VERSION = "1.0.16"
AOM_VERSION = "3.12.0"
# 1.18.2 - the latest version of libheif supporting C++11 builds (as for now)
HEIF_VERSION = "1.18.2"
@ -21,31 +22,11 @@ IOS_CMAKE_TOOLCHAIN_FILE = base.get_script_dir() + "/../../core/Common/3dParty/h
ANDROID_CMAKE_TOOLCHAIN_FILE = base.get_env("ANDROID_NDK_ROOT") + "/build/cmake/android.toolchain.cmake"
# linux arm64 cmake toolchain
LINUX_ARM64_CMAKE_TOOLCHAIN_FILE = base.get_script_dir() + "/../tools/linux/arm/cross_arm64/linux-arm64.toolchain.cmake"
LINUX_SYSTEM_AARCH64_TOOLCHAIN_FILE = base.get_script_dir() + "/../tools/linux/sysroot/system-aarch64.toolchain.cmake"
LINUX_CUSTOM_SYSROOT_TOOLCHAIN_FILE = base.get_script_dir() + "/../tools/linux/sysroot/custom-sysroot.toolchain.cmake"
OLD_ENV = dict()
# get custom sysroot vars as str
def setup_custom_sysroot_env() -> str:
env_vars = []
env_vars += ['LD_LIBRARY_PATH=\"' + config.get_custom_sysroot_lib() + "\""]
env_vars += ['PATH=\"' + config.option("sysroot") + "/usr/bin:" + base.get_env("PATH") + "\""]
env_vars += ['CC=\"' + config.get_custom_sysroot_bin() + "/gcc\""]
env_vars += ['CXX=\"' + config.get_custom_sysroot_bin() + "/g++\""]
env_vars += ['AR=\"' + config.get_custom_sysroot_bin() + "/ar\""]
env_vars += ['RABLIB=\"' + config.get_custom_sysroot_bin() + "/ranlib\""]
env_vars += ['CFLAGS=\"' + "--sysroot=" + config.option("sysroot") + "\""]
env_vars += ['CXXFLAGS=\"' + "--sysroot=" + config.option("sysroot") + "\""]
env_vars += ['LDFLAGS=\"' + "--sysroot=" + config.option("sysroot") + "\""]
env_str = ""
for env_var in env_vars:
env_str += env_var + " "
return env_str
def get_vs_version():
vs_version = "14 2015"
if config.option("vs-version") == "2019":
@ -90,10 +71,11 @@ def build_with_cmake(platform, cmake_args, build_type):
cmake_args_ext += ["-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11", "-DCMAKE_OSX_ARCHITECTURES=x86_64"]
elif platform == "mac_arm64":
cmake_args_ext += ["-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0", "-DCMAKE_OSX_ARCHITECTURES=arm64"]
elif platform == "linux_arm64":
cmake_args += ["-DCMAKE_TOOLCHAIN_FILE=" + LINUX_ARM64_CMAKE_TOOLCHAIN_FILE]
elif config.option("sysroot") != "":
cmake_args += ["-DCMAKE_TOOLCHAIN_FILE=" + LINUX_CUSTOM_SYSROOT_TOOLCHAIN_FILE] # force use custom CXXFLAGS with Release/Debug build
# force use custom CXXFLAGS with Release/Debug build
cmake_args += ["-DCMAKE_TOOLCHAIN_FILE=" + LINUX_CUSTOM_SYSROOT_TOOLCHAIN_FILE]
elif platform == "linux_arm64" and not base.is_os_arm():
cmake_args += ["-DCMAKE_TOOLCHAIN_FILE=" + LINUX_SYSTEM_AARCH64_TOOLCHAIN_FILE]
# IOS
elif "ios" in platform:
cmake_args_ext = [
@ -127,16 +109,20 @@ def build_with_cmake(platform, cmake_args, build_type):
cmake_args_ext += get_cmake_args_android("x86_64", "21")
# env setup for custom sysroot
env_str = setup_custom_sysroot_env() if config.option("sysroot") != "" else ""
if config.option("sysroot") != "":
base.set_sysroot_env("linux_arm64")
# run cmake
base.cmd(env_str + "cmake", cmake_args + cmake_args_ext)
base.cmd("cmake", cmake_args + cmake_args_ext)
# build
if "Unix Makefiles" in cmake_args_ext:
base.cmd(env_str + "make", ["-j4"])
base.cmd("make", ["-j4"])
else:
base.cmd("cmake", ["--build", ".", "--config", build_type])
if config.option("sysroot") != "":
base.restore_sysroot_env()
return
# general make function that calls `build_func` callback for configured platform(s) with specified cmake arguments
@ -294,6 +280,52 @@ def make_de265(base_dir, build_type):
make_common(build_de265, cmake_args)
return
def make_aom(base_dir, build_type):
# fetch lib repo
if not base.is_dir("aom"):
fetch_repo("https://aomedia.googlesource.com/aom", f"v{AOM_VERSION}")
# prepare cmake args
cmake_dir = base_dir + "/aom"
cmake_args = [
cmake_dir,
"-DCMAKE_BUILD_TYPE=" + build_type,
"-DBUILD_SHARED_LIBS=OFF", # do not build shared libs
"-DENABLE_SDL=OFF", # disable SDL
"-DENABLE_DECODER=ON", # enable AOM V1 decoder (for AVIF image format)
"-DENABLE_ENCODER=ON", # enable AOM V1 encoder (for AVIF image format)
"-DENABLE_TESTS=OFF", # do not build tests
"-DENABLE_DOCS=OFF", # do not build docs
"-DENABLE_EXAMPLES=OFF", # do not build examples
"-DENABLE_TOOLS=OFF", # do not build lib tools
]
# lib build function
def build_aom(platform, cmake_args):
# check if target lib has already been built
build_dir = get_build_dir(base_dir, "aom", platform, build_type)
if platform.find("win") != -1:
target_lib = os.path.join(build_dir, build_type, "aom.lib")
else:
target_lib = os.path.join(build_dir, "aom.a")
if base.is_file(target_lib):
return
# go to the build directory
base.create_dir(build_dir)
os.chdir(build_dir)
# run build
build_with_cmake(platform, cmake_args, build_type)
# for ios copy target library from the default build path
if platform.find("ios") != -1:
xcode_sdk = get_xcode_sdk(platform)
base.copy_file(f"/{build_type}-{xcode_sdk}/aom.a", build_dir)
# reset directory
os.chdir(base_dir)
return
make_common(build_aom, cmake_args)
return
def make_heif(base_dir, build_type):
# fetch lib repo
if not base.is_dir("libheif"):
@ -318,8 +350,8 @@ def make_heif(base_dir, build_type):
"-DCMAKE_BUILD_TYPE=" + build_type,
"-DBUILD_SHARED_LIBS=OFF", # do not build shared libs
"-DWITH_LIBSHARPYUV=OFF", # do not build libsharpyuv (for RGB <--> YUV color space conversions)
"-DWITH_AOM_DECODER=OFF", # do not build AOM V1 decoder (for AVIF image format)
"-DWITH_AOM_ENCODER=OFF", # do not build AOM V1 encoder (for AVIF image format)
"-DWITH_AOM_DECODER=ON", # enable AOM V1 decoder (for AVIF image format)
"-DWITH_AOM_ENCODER=ON", # enable AOM V1 encoder (for AVIF image format)
"-DWITH_GDK_PIXBUF=OFF", # do not build gdk-pixbuf plugin (UNIX only)
"-DWITH_GNOME=OFF", # do not build gnome plugin (Linux only)
"-DWITH_EXAMPLES=OFF", # do not build examples
@ -346,19 +378,23 @@ def make_heif(base_dir, build_type):
# add paths to dependent libraries and includes to cmake args
de265_build_dir = get_build_dir(base_dir, "libde265", platform, build_type)
x265_build_dir = get_build_dir(base_dir, "x265_git", platform, build_type)
aom_build_dir = get_build_dir(base_dir, "aom", platform, build_type)
cmake_args_ext = [
f"-DLIBDE265_INCLUDE_DIR={de265_build_dir}",
f"-DX265_INCLUDE_DIR={x265_build_dir}"
f"-DX265_INCLUDE_DIR={x265_build_dir}",
f"-DAOM_INCLUDE_DIR={base_dir}/aom"
]
if platform.find("win") != -1:
cmake_args_ext += [
f"-DLIBDE265_LIBRARY={de265_build_dir}/libde265/{build_type}/libde265.lib",
f"-DX265_LIBRARY={x265_build_dir}/{build_type}/x265-static.lib"
f"-DX265_LIBRARY={x265_build_dir}/{build_type}/x265-static.lib",
f"-DAOM_LIBRARY={aom_build_dir}/{build_type}/aom.lib"
]
else:
cmake_args_ext += [
f"-DLIBDE265_LIBRARY={de265_build_dir}/libde265/libde265.a",
f"-DX265_LIBRARY={x265_build_dir}/libx265.a"
f"-DX265_LIBRARY={x265_build_dir}/libx265.a",
f"-DAOM_LIBRARY={aom_build_dir}/aom.a"
]
# run build
build_with_cmake(platform, cmake_args + cmake_args_ext, build_type)
@ -374,6 +410,8 @@ def make_heif(base_dir, build_type):
return
def clear_module():
if base.is_dir("aom"):
base.delete_dir_with_access_error("aom")
if base.is_dir("libde265"):
base.delete_dir_with_access_error("libde265")
if base.is_dir("x265_git"):
@ -404,6 +442,8 @@ def make():
make_x265(base_dir, build_type)
# build decoder library
make_de265(base_dir, build_type)
# build decoder/encoder library for AVIF image format
make_aom(base_dir, build_type)
# build libheif
make_heif(base_dir, build_type)

View File

@ -35,7 +35,7 @@ def make():
old_cur = os.getcwd()
os.chdir(base_dir)
base.check_module_version("7", clear_module)
base.check_module_version("8", clear_module)
if (-1 != config.option("platform").find("android")):
icu_android.make()
@ -136,13 +136,15 @@ def make():
base.cmd(command_configure, ["Linux", "--prefix=" + base_dir + "/icu/cross_build_install"])
base.replaceInFile("./../source/icudefs.mk.in", "LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)", "LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS) " + command_compile_addon)
else:
base.set_sysroot_env()
base.set_sysroot_env("linux_64")
sysroot_path = config.option("sysroot_linux_64")
sysroot_path_bin = config.get_custom_sysroot_bin("linux_64")
base.cmd_exe("./../source/configure", ["--prefix=" + base_dir + "/icu/cross_build_install",
"CC=" + config.get_custom_sysroot_bin() + "/gcc", "CXX=" + config.get_custom_sysroot_bin() + "/g++",
"AR=" + config.get_custom_sysroot_bin() + "/ar", "RANLIB=" + config.get_custom_sysroot_bin() + "/ranlib",
"CFLAGS=--sysroot=" + config.option("sysroot"),
"CXXFLAGS=--sysroot=" + config.option("sysroot") + " " + command_compile_addon,
"LDFLAGS=--sysroot=" + config.option("sysroot")])
"CC=" + sysroot_path_bin + "/gcc", "CXX=" + sysroot_path_bin + "/g++",
"AR=" + sysroot_path_bin + "/ar", "RANLIB=" + sysroot_path_bin + "/ranlib",
"CFLAGS=--sysroot=" + sysroot_path,
"CXXFLAGS=--sysroot=" + sysroot_path + " " + command_compile_addon,
"LDFLAGS=--sysroot=" + sysroot_path])
if "" == config.option("sysroot"):
base.cmd("make", ["-j4"])
@ -161,9 +163,11 @@ def make():
if config.check_option("platform", "linux_arm64") and not base.is_dir(base_dir + "/linux_arm64") and not base.is_os_arm():
base.create_dir(base_dir + "/icu/linux_arm64")
os.chdir(base_dir + "/icu/linux_arm64")
base_arm_tool_dir = config.option('arm64-toolchain-bin') + '/' + base.get_prefix_cross_compiler_arm64()
compiler_gcc_prefix = base.get_compiler_gcc_prefix("linux_arm64")
if config.option("sysroot") != "":
base.set_sysroot_env("linux_arm64")
base.cmd("./../source/configure", ["--host=arm-linux", "--prefix=" + base_dir + "/icu/linux_arm64_install", "--with-cross-build=" + base_dir + "/icu/cross_build",
"CC=" + base_arm_tool_dir + "gcc", "CXX=" + base_arm_tool_dir + "g++", "AR=" + base_arm_tool_dir + "ar", "RANLIB=" + base_arm_tool_dir + "ranlib"])
"CC=" + compiler_gcc_prefix + "gcc", "CXX=" + compiler_gcc_prefix + "g++", "AR=" + compiler_gcc_prefix + "ar", "RANLIB=" + compiler_gcc_prefix + "ranlib"])
base.cmd("make", ["-j4"])
base.cmd("make", ["install"], True)
base.create_dir(base_dir + "/linux_arm64")
@ -171,6 +175,8 @@ def make():
base.copy_file(base_dir + "/icu/linux_arm64_install/lib/libicudata.so." + icu_major + "." + icu_minor, base_dir + "/linux_arm64/build/libicudata.so." + icu_major)
base.copy_file(base_dir + "/icu/linux_arm64_install/lib/libicuuc.so." + icu_major + "." + icu_minor, base_dir + "/linux_arm64/build/libicuuc.so." + icu_major)
base.copy_dir(base_dir + "/icu/linux_arm64_install/include", base_dir + "/linux_arm64/build/include")
if config.option("sysroot") != "":
base.restore_sysroot_env()
os.chdir("../..")

View File

@ -41,7 +41,7 @@ if not base.is_dir(current_dir + "/mac_cross_64"):
old_env = change_icu_defs("x86_64")
base.cmd("../icu/source/runConfigureICU", ["MacOSX",
"--prefix=" + current_dir + "/mac_cross_64", "--enable-static"])
"--prefix=" + current_dir + "/mac_64_install", "--enable-static"])
base.cmd("make", ["-j4"])
base.cmd("make", ["install"], True)
@ -58,7 +58,7 @@ addon = []
if not base.is_os_arm():
addon = ["--host=aarch64-apple-darwin"]
base.cmd("./configure", ["--prefix=" + current_dir + "/mac_arm_64",
base.cmd("./configure", ["--prefix=" + current_dir + "/mac_arm64_install",
"--with-cross-build=" + current_dir + "/mac_cross_64", "--enable-static", "VERBOSE=1"] + addon)
base.cmd("make", ["-j4"])
@ -80,25 +80,26 @@ base.create_dir(current_dir + "/mac_64/build")
base.create_dir(current_dir + "/mac_arm64")
base.create_dir(current_dir + "/mac_arm64/build")
base.copy_dir(current_dir + "/mac_cross_64/include", current_dir + "/mac_64/build/include")
base.copy_dir(current_dir + "/mac_64_install/include", current_dir + "/mac_64/build/include")
# copy shared libs
base.copy_file(current_dir + "/mac_cross_64/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicudata." + icu_major + ".dylib")
base.copy_file(current_dir + "/mac_cross_64/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicuuc." + icu_major + ".dylib")
base.copy_file(current_dir + "/mac_64_install/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicudata." + icu_major + ".dylib")
base.copy_file(current_dir + "/mac_64_install/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicuuc." + icu_major + ".dylib")
# copy static libs
base.copy_file(current_dir + "/mac_cross_64/lib/libicudata.a", current_dir + "/mac_64/build")
base.copy_file(current_dir + "/mac_cross_64/lib/libicui18n.a", current_dir + "/mac_64/build")
base.copy_file(current_dir + "/mac_cross_64/lib/libicuuc.a", current_dir + "/mac_64/build")
base.copy_file(current_dir + "/mac_64_install/lib/libicudata.a", current_dir + "/mac_64/build")
base.copy_file(current_dir + "/mac_64_install/lib/libicui18n.a", current_dir + "/mac_64/build")
base.copy_file(current_dir + "/mac_64_install/lib/libicuuc.a", current_dir + "/mac_64/build")
base.copy_dir(current_dir + "/mac_arm_64/include", current_dir + "/mac_arm64/build/include")
base.copy_dir(current_dir + "/mac_arm64_install/include", current_dir + "/mac_arm64/build/include")
# copy shared libs
base.copy_file(current_dir + "/mac_arm_64/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicudata." + icu_major + ".dylib")
base.copy_file(current_dir + "/mac_arm_64/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicuuc." + icu_major + ".dylib")
base.copy_file(current_dir + "/mac_arm64_install/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicudata." + icu_major + ".dylib")
base.copy_file(current_dir + "/mac_arm64_install/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicuuc." + icu_major + ".dylib")
# copy static libs
base.copy_file(current_dir + "/mac_arm_64/lib/libicudata.a", current_dir + "/mac_arm64/build")
base.copy_file(current_dir + "/mac_arm_64/lib/libicui18n.a", current_dir + "/mac_arm64/build")
base.copy_file(current_dir + "/mac_arm_64/lib/libicuuc.a", current_dir + "/mac_arm64/build")
base.copy_file(current_dir + "/mac_arm64_install/lib/libicudata.a", current_dir + "/mac_arm64/build")
base.copy_file(current_dir + "/mac_arm64_install/lib/libicui18n.a", current_dir + "/mac_arm64/build")
base.copy_file(current_dir + "/mac_arm64_install/lib/libicuuc.a", current_dir + "/mac_arm64/build")
base.delete_dir(current_dir + "/mac_cross_64")
base.delete_dir(current_dir + "/mac_arm_64")
base.delete_dir(current_dir + "/mac_64_install")
base.delete_dir(current_dir + "/mac_arm64_install")
os.chdir(current_dir_old)

View File

@ -99,34 +99,34 @@ def make():
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden")
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden")
else:
base.replaceInFile("./Makefile", "CROSS_COMPILE=", "CROSS_COMPILE=" + config.get_custom_sysroot_bin() + "/")
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden --sysroot=" + config.option("sysroot"))
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden --sysroot=" + config.option("sysroot"))
base.replaceInFile("./Makefile", "CROSS_COMPILE=", "CROSS_COMPILE=" + config.get_custom_sysroot_bin("linux_64") + "/")
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden --sysroot=" + config.option("sysroot_linux_64"))
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden --sysroot=" + config.option("sysroot_linux_64"))
if config.option("sysroot") == "":
base.cmd("make", [])
base.cmd("make", ["install"])
base.cmd("make", ["clean"], True)
else:
base.set_sysroot_env()
base.set_sysroot_env("linux_64")
base.cmd_exe("make", [])
base.cmd_exe("make", ["install"])
base.cmd_exe("make", ["clean"], True)
base.restore_sysroot_env()
if (-1 != config.option("platform").find("linux_arm64")) and not base.is_dir("../build/linux_arm64"):
if ("x86_64" != platform.machine()):
if (base.is_os_arm()):
base.copy_dir("../build/linux_64", "../build/linux_arm64")
else:
cross_compiler_arm64 = config.option("arm64-toolchain-bin")
if ("" == cross_compiler_arm64):
cross_compiler_arm64 = "/usr/bin"
cross_compiler_arm64_prefix = cross_compiler_arm64 + "/" + base.get_prefix_cross_compiler_arm64()
base.cmd("./Configure", ["linux-aarch64", "--cross-compile-prefix=" + cross_compiler_arm64_prefix, "enable-md2", "no-shared", "no-asm", "no-tests", "--prefix=" + old_cur_dir + "/build/linux_arm64", "--openssldir=" + old_cur_dir + "/build/linux_arm64"])
if config.option("sysroot") != "":
base.set_sysroot_env("linux_arm64")
base.cmd("./Configure", ["linux-aarch64", "enable-md2", "no-shared", "no-asm", "no-tests", "--prefix=" + old_cur_dir + "/build/linux_arm64", "--openssldir=" + old_cur_dir + "/build/linux_arm64"])
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden")
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden")
base.cmd("make", [], True)
base.cmd("make", ["install"], True)
if config.option("sysroot") != "":
base.restore_sysroot_env()
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
base.cmd("./Configure", ["enable-md2", "no-shared", "no-asm", "darwin64-x86_64-cc", "--prefix=" + old_cur_dir + "/build/mac_64", "--openssldir=" + old_cur_dir + "/build/mac_64", "-mmacosx-version-min=10.11"])

View File

@ -8,6 +8,11 @@ import os
import subprocess
import glob
def clean():
if base.is_dir("socket.io-client-cpp"):
base.delete_dir_with_access_error("socket.io-client-cpp")
return
def correct_namespace(dir):
folder = dir
if ("/" != folder[-1:]):
@ -25,6 +30,12 @@ def correct_namespace(dir):
def make():
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/socketio"
old_cur = os.getcwd()
os.chdir(base_dir)
base.common_check_version("socketio", "1", clean)
os.chdir(old_cur)
if not base.is_dir(base_dir + "/socket.io-client-cpp"):
base.cmd_in_dir(base_dir, "git", ["clone", "https://github.com/socketio/socket.io-client-cpp.git"])
base.cmd_in_dir(base_dir + "/socket.io-client-cpp", "git", ["checkout", "da779141a7379cc30c870d48295033bc16a23c66"])
@ -37,6 +48,7 @@ def make():
base.apply_patch(base_dir + "/socket.io-client-cpp/src/internal/sio_client_impl.cpp", base_dir + "/patches/sio_client_impl_fail.patch")
base.apply_patch(base_dir + "/socket.io-client-cpp/src/internal/sio_client_impl.cpp", base_dir + "/patches/sio_client_impl_open.patch")
base.apply_patch(base_dir + "/socket.io-client-cpp/src/internal/sio_client_impl.cpp", base_dir + "/patches/sio_client_impl_close_timeout.patch")
base.apply_patch(base_dir + "/socket.io-client-cpp/src/internal/sio_client_impl.cpp", base_dir + "/patches/sio_client_impl_encode.patch")
# no tls realization (remove if socket.io fix this)
dst_dir = base_dir + "/socket.io-client-cpp/src_no_tls"

View File

@ -44,14 +44,9 @@ def is_xp_platform():
return False
def is_use_clang():
gcc_version = base.get_gcc_version()
is_clang = "false"
if config.option("sysroot") == "" and (gcc_version >= 6000 or "1" == config.option("use-clang")):
is_clang = "true"
print("gcc version: " + str(gcc_version) + ", use clang:" + is_clang)
return is_clang
if config.option("sysroot") == "" and "1" == config.option("use-clang"):
return "true"
return "false"
def make():
if not is_main_platform():
@ -235,8 +230,7 @@ def make_xp():
base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64")
# old variant
#path_to_python2 = "/depot_tools/win_tools-2_7_13_chromium7_bin/python/bin"
path_to_python2 = "/depot_tools/bootstrap-2@3_8_10_chromium_23_bin/python/bin"
path_to_python2 = "/depot_tools/bootstrap-2@3_11_8_chromium_35_bin/python/bin"
os.environ["PATH"] = os.pathsep.join([base_dir + "/depot_tools",
base_dir + path_to_python2,
config.option("vs-path") + "/../Common7/IDE",

View File

@ -7,6 +7,25 @@ import base
import os
import subprocess
def clean():
if base.is_dir("depot_tools"):
base.delete_dir_with_access_error("depot_tools")
base.delete_dir("depot_tools")
if base.is_dir("v8"):
base.delete_dir_with_access_error("v8")
base.delete_dir("v8")
if base.is_exist("./.gclient"):
base.delete_file("./.gclient")
if base.is_exist("./.gclient_entries"):
base.delete_file("./.gclient_entries")
if base.is_exist("./.gclient_previous_sync_commits"):
base.delete_file("./.gclient_previous_sync_commits")
if base.is_exist("./.gcs_entries"):
base.delete_file("./.gcs_entries")
if base.is_exist("./.cipd"):
base.delete_dir("./.cipd")
return
def change_bootstrap():
base.move_file("./depot_tools/bootstrap/manifest.txt", "./depot_tools/bootstrap/manifest.txt.bak")
content = "# changed by build_tools\n\n"
@ -16,7 +35,11 @@ def change_bootstrap():
content += "infra/3pp/tools/cpython/${platform} version:2@2.7.18.chromium.39\n\n"
content += "@Subdir python3\n"
content += "infra/3pp/tools/cpython3/${platform} version:2@3.8.10.chromium.23\n\n"
if ("windows" == base.host_platform()):
content += "infra/3pp/tools/cpython3/${platform} version:2@3.11.8.chromium.35\n\n"
else:
content += "infra/3pp/tools/cpython3/${platform} version:2@3.8.10.chromium.23\n\n"
content += "@Subdir git\n"
content += "infra/3pp/tools/git/${platform} version:2@2.41.0.chromium.11\n"
@ -74,6 +97,9 @@ def make_args(args, platform, is_64=True, is_debug=False):
if (platform == "windows"):
args_copy.append("is_clang=false")
if (platform == "mac") and base.is_os_arm():
args_copy.append("host_cpu=\\\"x64\\\"")
if linux_clang != True:
args_copy.append("use_custom_libcxx=false")
@ -146,6 +172,8 @@ def make():
base.cmd("git", ["config", "--global", "http.postBuffer", "157286400"], True)
os.chdir(base_dir)
base.common_check_version("v8", "1", clean)
if not base.is_dir("depot_tools"):
base.cmd("git", ["clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"])
change_bootstrap()
@ -207,16 +235,18 @@ def make():
if config.check_option("platform", "linux_64"):
if config.option("sysroot") != "":
sysroot_path = config.option("sysroot_linux_64")
sysroot_path_bin = config.get_custom_sysroot_bin("linux_64")
src_replace = "config(\"compiler\") {\n asmflags = []\n cflags = []\n cflags_c = []\n cflags_cc = []\n cflags_objc = []\n cflags_objcc = []\n ldflags = []"
dst_replace = "config(\"compiler\") {\n asmflags = []\n cflags = [\"--sysroot=" + config.option("sysroot") + "\"]" + "\n cflags_c = []\n cflags_cc = [\"--sysroot=" + config.option("sysroot") + "\"]" + "\n cflags_objc = []\n cflags_objcc = []\n ldflags = [\"--sysroot=" + config.option("sysroot") + "\"]"
dst_replace = "config(\"compiler\") {\n asmflags = []\n cflags = [\"--sysroot=" + sysroot_path + "\"]" + "\n cflags_c = []\n cflags_cc = [\"--sysroot=" + sysroot_path + "\"]" + "\n cflags_objc = []\n cflags_objcc = []\n ldflags = [\"--sysroot=" + sysroot_path + "\"]"
base.replaceInFile("build/config/compiler/BUILD.gn", src_replace, dst_replace)
src_replace = "gcc_toolchain(\"x64\") {\n cc = \"gcc\"\n cxx = \"g++\""
dst_replace = "gcc_toolchain(\"x64\") {\n cc = \""+ config.get_custom_sysroot_bin() + "/gcc\"\n cxx = \"" + config.get_custom_sysroot_bin() + "/g++\""
dst_replace = "gcc_toolchain(\"x64\") {\n cc = \""+ sysroot_path_bin + "/gcc\"\n cxx = \"" + sysroot_path_bin + "/g++\""
base.replaceInFile("build/toolchain/linux/BUILD.gn", src_replace, dst_replace)
old_env = dict(os.environ)
base.set_sysroot_env()
base.set_sysroot_env("linux_64")
base.cmd2("gn", ["gen", "out.gn/linux_64", make_args(gn_args, "linux")], False)
base.cmd2("ninja", ["-C", "out.gn/linux_64"], False)
base.restore_sysroot_env()

View File

@ -1,208 +0,0 @@
import sys
sys.path.append('../..')
import base
import os
import config
ARCHES = {"win_64" : "x64",
"win_32" : "x86",
"linux_64" : "x86_64-linux-gnu",
"linux_arm64" : "aarch64-linux-gnu",
"mac_64" : "x86_64-apple-darwin",
"mac_arm64" : "arm-apple-darwin",
"android_arm64_v8a" : "aarch64-linux-android",
"android_armv7" : "armv7a-linux-androideabi",
"android_x86" : "i686-linux-android",
"android_x86_64" : "x86_64-linux-android",
"ios" : "arm-apple-darwin",
"ios_simulator" : "x86_64-apple-darwin"}
def get_xcode_sdk(platform):
xcode_sdk = "iphoneos"
if "simulator" in platform:
xcode_sdk = "iphonesimulator"
return xcode_sdk
def get_ios_min_version(platform):
res = " -miphoneos-version-min=11.0"
if "simulator" in platform:
res = " -mios-simulator-version-min=11.0"
return res
def fetch_repo():
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/webp"
if not base.is_dir(base_dir):
base.create_dir(base_dir)
old_dir = os.getcwd()
os.chdir(base_dir)
if (base.is_dir("libwebp")):
base.delete_dir_with_access_error("libwebp")
if not base.is_dir("libwebp"):
base.cmd("git", ["clone", "--branch","v1.6.0", "https://chromium.googlesource.com/webm/libwebp"])
os.chdir(base_dir + "/libwebp")
return old_dir
def create_build_dir(platform, build_type) -> str:
build_dir = ""
if "win" in platform:
target_file = "libwebp"
if build_type == "debug":
target_file += "-debug"
target_file += ".lib"
build_dir = "./../build/" + platform + "/"
if not base.is_dir(build_dir):
base.create_dir(build_dir)
elif base.is_file(build_dir + build_type + "/" + ARCHES[platform] + "/lib/" + target_file):
build_dir = ""
else:
build_dir = "./../build/" + platform + "/" + build_type
if not base.is_dir(build_dir):
base.create_dir(build_dir)
if base.is_file(build_dir + "/src/.libs/libwebp.a"):
build_dir = ""
return build_dir
# get custom sysroot vars as str
def setup_custom_sysroot_env() -> str:
env_vars = []
env_vars += ['LD_LIBRARY_PATH=\"' + config.get_custom_sysroot_lib() + "\""]
env_vars += ['PATH=\"' + config.option("sysroot") + "/usr/bin:" + base.get_env("PATH") + "\""]
env_vars += ['CC=\"' + config.get_custom_sysroot_bin() + "/gcc\""]
env_vars += ['CXX=\"' + config.get_custom_sysroot_bin() + "/g++\""]
env_vars += ['AR=\"' + config.get_custom_sysroot_bin() + "/ar\""]
env_vars += ['RABLIB=\"' + config.get_custom_sysroot_bin() + "/ranlib\""]
env_vars += ['CFLAGS=\"' + "--sysroot=" + config.option("sysroot") + "\""]
env_vars += ['CXXFLAGS=\"' + "--sysroot=" + config.option("sysroot") + "\""]
env_vars += ['LDFLAGS=\"' + "--sysroot=" + config.option("sysroot") + "\""]
env_str = ""
for env_var in env_vars:
env_str += env_var + " "
return env_str
def get_args(platform, build_type, build_dir):
if "win" in platform:
args = []
args.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + ARCHES[platform])
args.append("call nmake /f Makefile.vc CFG=" + build_type + "-static" + " OBJDIR=" + build_dir)
return args
elif "linux" in platform:
cflags = "-O3 -DNDEBUG"
if build_type == "debug":
cflags = "-O0 -g"
if config.option("sysroot") != "":
cflags += " --sysroot=" + config.option("sysroot")
cross_arm64 = ""
if platform == "linux_arm64":
cross_cimpile_arm64 = config.option("arm64-toolchain-bin")
if "" == cross_cimpile_arm64:
cross_cimpile_arm64 = "/usr/bin"
cross_arm64 = "--cross-compile-prefix=" + cross_cimpile_arm64 + "/" + base.get_prefix_cross_compiler_arm64()
return ["--host=" + ARCHES[platform], "--enable-static", "--disable-shared",
"--disable-libwebpdecoder", "--disable-libwebpdemux",
"--disable-libwebpmux", "--disable-libwebpextras",
cross_arm64, "CFLAGS=" + cflags, "LDFLAGS=-static"]
elif "mac" in platform:
arch = ARCHES[platform]
short_arch = arch[:arch.find("-")]
if short_arch == "arm":
short_arch += "64"
cflags = "-O3 -DNDEBUG -arch " + short_arch + " -fPIC"
if build_type == "debug":
cflags = "-O0 -g -arch " + short_arch + " -fPIC"
return ["--host=" + arch, "--enable-static", "--disable-shared",
"--disable-libwebpdecoder", "--disable-libwebpdemux",
"--disable-libwebpmux", "--disable-libwebpextras",
"CFLAGS=" + cflags, "LDFLAGS=-arch " + short_arch]
elif "ios" in platform:
arch = ARCHES[platform]
short_arch = arch[:arch.find("-")]
if short_arch == "arm":
short_arch += "64"
xcode_sdk = get_xcode_sdk(platform)
version_min = get_ios_min_version(platform)
cflags = "-O3 -DNDEBUG -arch " + short_arch + version_min + " -fembed-bitcode"
if build_type == "debug":
cflags = "-O0 -g -arch " + short_arch + version_min + " -fembed-bitcode"
return ["--host=" + arch, "--enable-static", "--disable-shared",
"--disable-libwebpdecoder", "--disable-libwebpdemux",
"--disable-libwebpmux", "--disable-libwebpextras",
"CC=clang -arch " + short_arch + " -isysroot $(xcrun --sdk " + xcode_sdk + " --show-sdk-path)",
"CFLAGS=" + cflags]
elif "android" in platform:
cflags = "-O3 -DNDEBUG"
if build_type == "debug":
cflags = "-O0 -g"
return ["--host=" + ARCHES[platform], "--enable-static", "--disable-shared",
"--disable-libwebpdecoder", "--disable-libwebpdemux",
"--disable-libwebpmux", "--disable-libwebpextras",
"CFLAGS=" + cflags, "LDFLAGS=-static"]
def make():
print("[fetch & build]: webp")
old_dir = fetch_repo()
build_type = "release"
if -1 != config.option("config").lower().find("debug"):
build_type = "debug"
platform = config.option("platform")
build_dir = create_build_dir(platform, build_type)
if -1 != platform.find("ios"):
args_simulator = get_args("iossimulator", build_type, build_dir)
args = get_args(platform, build_type, build_dir)
if build_dir == "":
return
# WINDOWS
if "windows" == base.host_platform():
base.run_as_bat(args, True)
# LINUX
elif -1 != platform.find("linux"):
base.cmd("./autogen.sh")
os.chdir(build_dir)
if config.option("sysroot") != "":
args += ["CROSS_COMPILE=" + config.get_custom_sysroot_bin() + "/"]
env_str = setup_custom_sysroot_env() if config.option("sysroot") != "" else ""
base.cmd(env_str + "./../../../libwebp/configure", args)
base.cmd(env_str + "make", ["-j$(nproc)"])
# MAC, ANDROID
elif -1 != platform.find("mac") or -1 != platform.find("ios") or -1 != platform.find("android"):
base.cmd("./autogen.sh")
os.chdir(build_dir)
base.cmd("./../../../libwebp/configure", args)
base.cmd("make", ["-j$(sysctl -n hw.ncpu)"])
# IOS
elif -1 != platform.find("ios"):
base.cmd("./autogen.sh")
os.chdir(build_dir + "/ios")
base.cmd("./../../../libwebp/configure", args)
base.cmd("make", ["-j$(sysctl -n hw.ncpu)"])
os.chdir(build_dir + "/iossimulator")
base.cmd("./../../../libwebp/configure", args_simulator)
base.cmd("make", ["-j$(sysctl -n hw.ncpu)"])
os.chdir(build_dir)
base.cmd("lipo", ["-create", "/ios/src/.libs/libwebp.a", "/iossimulator/src/.libs/libwebp.a", "-output", "/libwebp.a"])
base.cmd("lipo", ["-create", "/ios/src/.libs/libwebpdecoder.a", "/iossimulator/src/.libs/libwebpdecoder.a", "-output", "/libwebpdecoder.a"])
base.cmd("lipo", ["-create", "/ios/src/.libs/libwebpdemux.a", "/iossimulator/src/.libs/libwebpdemux.a", "-output", "/libwebpdemux.a"])
base.cmd("lipo", ["-create", "/ios/src/.libs/libwebpmux.a", "/iossimulator/src/.libs/libwebpmux.a", "-output", "/libwebpmux.a"])
os.chdir(old_dir)
return

View File

@ -22,4 +22,6 @@ def make():
deploy_mobile.make()
if config.check_option("module", "osign"):
deploy_osign.make()
if base.is_use_create_artifacts_qemu_any_platform():
base.create_artifacts_qemu_any_platform()
return

View File

@ -47,6 +47,7 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "IWorkFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HWPFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DocxRenderer")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "StarMathConverter")
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", root_dir + "/cmap.bin")
if ("ios" == platform):

View File

@ -42,6 +42,7 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "HWPFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "DocxRenderer")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "hunspell")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "StarMathConverter")
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", archive_dir + "/cmap.bin")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "x2t")

View File

@ -72,6 +72,7 @@ def make():
base.copy_lib(build_libraries_path, root_dir + "/converter", "IWorkFile")
base.copy_lib(build_libraries_path, root_dir + "/converter", "HWPFile")
base.copy_lib(build_libraries_path, root_dir + "/converter", "DocxRenderer")
base.copy_lib(build_libraries_path, root_dir + "/converter", "StarMathConverter")
if ("ios" == platform):
base.copy_lib(build_libraries_path, root_dir + "/converter", "x2t")
@ -178,7 +179,7 @@ def make():
base.qt_copy_lib("Qt5DBus", root_dir)
base.qt_copy_lib("Qt5X11Extras", root_dir)
base.qt_copy_lib("Qt5XcbQpa", root_dir)
base.qt_copy_icu(root_dir)
base.qt_copy_icu(root_dir, platform)
if not base.check_congig_option_with_platfom(platform, "libvlc"):
base.copy_files(base.get_env("QT_DEPLOY") + "/../lib/libqgsttools_p.so*", root_dir)
@ -245,6 +246,8 @@ def make():
isUseAgent = True
if isWindowsXP:
isUseAgent = False
if (0 == platform.find("mac")) and (config.check_option("config", "use_v8")):
isUseAgent = False
if (isUseAgent):
agent_plugin_dir = git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/ai-agent"
@ -286,12 +289,12 @@ def make():
is_host_not_arm = False
host_platform = ""
if (platform == "mac_arm64" or platform == "win_arm64") and not base.is_os_arm():
# TODO: fix this on mac_arm64 (qemu)
# on windows we are using qemu
if (platform == "mac_arm64") and not base.is_os_arm():
is_host_not_arm = True
if platform == "mac_arm64":
host_platform = "mac_64"
elif platform == "win_arm64":
host_platform = "win_64"
host_platform = "mac_64"
# all themes generate ----
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "allfontsgen")
@ -304,22 +307,40 @@ def make():
if is_host_not_arm:
sdkjs_dir = root_dir + "/editors/sdkjs"
end_find_platform = sdkjs_dir.rfind("/" + platform + "/")
sdkjs_dir_64 = sdkjs_dir[0:end_find_platform] + "/" + host_platform + "/" + sdkjs_dir[end_find_platform+11:]
str1 = "/" + platform + "/"
str2 = "/" + host_platform + "/"
sdkjs_dir_host = sdkjs_dir.replace(str1, str2)
base.delete_dir(sdkjs_dir)
base.copy_dir(sdkjs_dir_64, sdkjs_dir)
base.copy_dir(sdkjs_dir_host, sdkjs_dir)
else:
themes_params = []
if ("" != config.option("themesparams")):
themes_params = ["--params=\"" + config.option("themesparams") + "\""]
base.cmd_exe(root_dir + "/converter/allfontsgen", ["--use-system=\"1\"", "--input=\"" + root_dir + "/fonts\"", "--input=\"" + git_dir + "/core-fonts\"", "--allfonts=\"" + root_dir + "/converter/AllFonts.js\"", "--selection=\"" + root_dir + "/converter/font_selection.bin\""], True)
base.cmd_exe(root_dir + "/converter/allthemesgen", ["--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\""] + themes_params, True)
params_allfontsgen = ["--use-system=\"1\"", "--input=\"" + root_dir + "/fonts\"", "--input=\"" + git_dir + "/core-fonts\"", "--allfonts=\"" + root_dir + "/converter/AllFonts.js\"", "--selection=\"" + root_dir + "/converter/font_selection.bin\""]
params_allthemesgen = ["--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\""] + themes_params
if (0 == platform.find("linux_arm") and not base.is_os_arm()):
x2t_origin = ""
if (config.option("sysroot") != ""):
x2t_origin = base.create_qemu_wrapper(root_dir + "/converter/x2t", platform)
base.cmd_in_dir_qemu(platform, root_dir + "/converter", "./allfontsgen", params_allfontsgen, True)
base.cmd_in_dir_qemu(platform, root_dir + "/converter", "./allthemesgen", params_allthemesgen, True)
if "" != x2t_origin:
base.delete_file(root_dir + "/converter/x2t")
base.move_file(x2t_origin, root_dir + "/converter/x2t")
else:
base.cmd_exe(root_dir + "/converter/allfontsgen", params_allfontsgen, True)
base.cmd_exe(root_dir + "/converter/allthemesgen", params_allthemesgen, True)
base.delete_file(root_dir + "/converter/AllFonts.js")
base.delete_file(root_dir + "/converter/font_selection.bin")
base.delete_file(root_dir + "/converter/fonts.log")
base.delete_exe(root_dir + "/converter/allfontsgen")
base.delete_exe(root_dir + "/converter/allthemesgen")
if not base.is_use_create_artifacts_qemu(platform):
base.delete_exe(root_dir + "/converter/allfontsgen")
base.delete_exe(root_dir + "/converter/allthemesgen")
if not isUseJSC:
base.delete_file(root_dir + "/editors/sdkjs/slide/sdk-all.cache")

View File

@ -65,6 +65,7 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "IWorkFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HWPFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DocxRenderer")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "StarMathConverter")
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", root_dir + "/cmap.bin")
if (0 == platform.find("win") or 0 == platform.find("linux") or 0 == platform.find("mac")):

View File

@ -93,6 +93,7 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "IWorkFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "HWPFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "DocxRenderer")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "StarMathConverter")
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", converter_dir + "/cmap.bin")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, converter_dir, "x2t")

View File

@ -111,7 +111,8 @@ def check_dependencies():
if (host_platform == 'windows'):
checksResult.append(check_nodejs())
if (config.option("sql-type") == 'mysql' and host_platform == 'windows'):
sql_type = config.option("sql-type")
if (sql_type == 'mysql' and host_platform == 'windows'):
checksResult.append(check_mysqlServer())
else:
checksResult.append(check_postgreSQL())
@ -300,9 +301,21 @@ def check_rabbitmq():
print('RabbitMQ is installed')
return dependence
elif (host_platform == 'linux'):
result = base.run_command('service rabbitmq-server status')['stdout']
if (result != ''):
print('Installed RabbitMQ is valid')
result = ''
# Prefer systemctl for systemd
systemctl_result = base.run_command('systemctl status rabbitmq-server')
if systemctl_result['returncode'] == 0 and systemctl_result['stdout']:
result = systemctl_result['stdout']
# Fallback to service for SysV
if result == '':
command_result = base.run_command('service rabbitmq-server status')
if command_result['returncode'] == 0 and command_result['stdout']:
result = command_result['stdout']
if result != '':
print('RabbitMQ is installed')
return dependence
print('RabbitMQ not found')
@ -517,8 +530,9 @@ def check_mysqlServer():
if (host_platform != 'windows'):
result = os.system(mysqlLoginSrt + ' -e "exit"')
if (result == 0):
connectionResult = base.run_command(connectionString)['stdout']
if (connectionResult.find('port') != -1 and connectionResult.find(config.option("db-port")) != -1):
connectionResult = base.run_command(connectionString)
expected_port = config.option("db-port")
if (connectionResult['stdout'].find('port') != -1 and connectionResult['stdout'].find(expected_port) != -1):
print('MySQL configuration is valid')
dependence.sqlPath = 'mysql'
return dependence
@ -533,13 +547,15 @@ def check_mysqlServer():
continue
mysql_full_name = 'MySQL Server ' + info['Version'] + ' '
connectionResult = base.run_command_in_dir(get_mysql_path_to_bin(info['Location']), connectionString)['stdout']
if (connectionResult.find('port') != -1 and connectionResult.find(config.option("db-port")) != -1):
mysql_bin_path = get_mysql_path_to_bin(info['Location'])
connectionResult = base.run_command_in_dir(mysql_bin_path, connectionString)
expected_port = config.option("db-port")
if (connectionResult['stdout'].find('port') != -1 and connectionResult['stdout'].find(expected_port) != -1):
print(mysql_full_name + 'configuration is valid')
dependence.sqlPath = info['Location']
return dependence
print(mysql_full_name + 'configuration is not valid:' + connectionResult)
print(mysql_full_name + 'configuration is not valid')
# if path exists, then further removal and installation fails(according to startup statistics). it is better to fix issue manually.
return dependence
@ -632,8 +648,8 @@ def get_postrgre_path_to_bin(postgrePath = ''):
return postgrePath
def get_postgreLoginSrting(userName):
if (host_platform == 'windows'):
return 'psql -U' + userName + ' '
return 'PGPASSWORD="' + config.option("db-pass") + '" psql -U' + userName + ' -hlocalhost '
return 'psql -U ' + userName + ' -h localhost '
return 'PGPASSWORD="' + config.option("db-pass") + '" psql -U ' + userName + ' -h localhost '
def get_postgreSQLInfoByFlag(flag):
arrInfo = []
@ -667,9 +683,10 @@ def check_postgreSQL():
if (host_platform == 'linux'):
result = os.system(postgreLoginSrt + ' -c "\q"')
connectionResult = base.run_command(connectionString)['stdout']
connectionResult = base.run_command(connectionString)
expected_port = config.option("db-port")
if (result != 0 or connectionResult.find(config.option("db-port")) == -1):
if (result != 0 or connectionResult['stdout'].find(expected_port) == -1):
print('Valid PostgreSQL not found!')
dependence.append_install('PostgreSQL')
dependence.append_uninstall('PostgreSQL')
@ -680,18 +697,20 @@ def check_postgreSQL():
arrInfo = get_postgreSQLInfo()
base.set_env('PGPASSWORD', config.option("db-pass"))
for info in arrInfo:
if (base.is_dir(info['Location']) == False):
continue
postgre_full_name = 'PostgreSQL ' + info['Version'][:2] + ' '
connectionResult = base.run_command_in_dir(get_postrgre_path_to_bin(info['Location']), connectionString)['stdout']
if (connectionResult.find(config.option("db-port")) != -1):
postgre_bin_path = get_postrgre_path_to_bin(info['Location'])
connectionResult = base.run_command_in_dir(postgre_bin_path, connectionString)
expected_port = config.option("db-port")
if (connectionResult['stdout'].find(expected_port) != -1):
print(postgre_full_name + 'configuration is valid')
dependence.sqlPath = info['Location']
return dependence
print(postgre_full_name + 'configuration is not valid')
print('Valid PostgreSQL not found')
@ -704,6 +723,8 @@ def check_postgreSQL():
return dependence
def check_postgreConfig(postgrePath = ''):
result = True
base.print_info('Checking PostgreSQL configuration')
if (host_platform == 'windows'):
base.set_env('PGPASSWORD', config.option("db-pass"))
@ -711,53 +732,78 @@ def check_postgreConfig(postgrePath = ''):
dbUser = config.option("db-user")
dbName = config.option("db-name")
dbPass = config.option("db-pass")
postgre_path_to_bin = get_postrgre_path_to_bin(postgrePath)
postgreLoginRoot = get_postgreLoginSrting(rootUser)
postgreLoginDbUser = get_postgreLoginSrting(dbUser)
creatdb_path = base.get_script_dir() + "/../../server/schema/postgresql/createdb.sql"
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + ' -c "\du ' + dbUser + '"')['stdout'].find(dbUser) != -1):
print('User ' + dbUser + ' is exist')
# Check if user exists
user_check_result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + ' -c "\du ' + dbUser + '"')
if (user_check_result['stdout'].find(dbUser) != -1):
# User exists, check password
if (os.system(postgreLoginDbUser + '-c "\q"') != 0):
print('Invalid user password!')
base.print_info('Changing password...')
print('Invalid user password, changing...')
result = change_userPass(dbUser, dbPass, postgre_path_to_bin) and result
else:
print('User ' + dbUser + ' not exist!')
base.print_info('Creating ' + dbName + ' user...')
print('Creating user ' + dbUser + '...')
result = create_postgreUser(dbUser, dbPass, postgre_path_to_bin) and result
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + ' -c "SELECT datname FROM pg_database;"')['stdout'].find(config.option("db-name")) == -1):
print('Database ' + dbName + ' not found')
base.print_info('Creating ' + dbName + ' database...')
result = create_postgreDb(dbName, postgre_path_to_bin) and configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
# Check if database exists
db_check_result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + ' -c "SELECT datname FROM pg_database;"')
if (db_check_result['stdout'].find(dbName) == -1):
print('Creating database ' + dbName + '...')
create_result = create_postgreDb(dbName, postgre_path_to_bin)
if create_result:
# Grant privileges to user on database and schema
base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + dbUser + ';"')
base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-d ' + dbName + ' -c "GRANT ALL ON SCHEMA public TO ' + dbUser + ';"')
configure_result = configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
result = create_result and configure_result
else:
result = False
else:
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "SELECT pg_size_pretty(pg_database_size(' + "'" + dbName + "'" + '));"')['stdout'].find('7559 kB') != -1):
print('Database ' + dbName + ' not configured')
base.print_info('Configuring ' + dbName + ' database...')
result = configureDb(dbName, creatdb_path, postgre_path_to_bin) and result
print('Database ' + dbName + ' is valid')
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "\l+ ' + dbName + '"')['stdout'].find(dbUser +'=CTc/' + rootUser) == -1):
print('User ' + dbUser + ' has no database privileges!')
base.print_info('Setting database privileges for user ' + dbUser + '...')
result = set_dbPrivilegesForUser(dbUser, dbName, postgre_path_to_bin) and result
print('User ' + dbUser + ' has database privileges')
# Database exists - check if tables need to be created
table_count_result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "SELECT count(*) FROM information_schema.tables WHERE table_schema = \'public\';"')
needs_configure = False
if table_count_result['stdout'].find(' 0') != -1:
# No tables - need to configure
needs_configure = True
if needs_configure:
# Grant privileges and configure
base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + dbUser + ';"')
base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-d ' + dbName + ' -c "GRANT ALL ON SCHEMA public TO ' + dbUser + ';"')
configure_result = configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
result = configure_result and result
return result
def create_postgreDb(dbName, postgre_path_to_bin = ''):
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"') != 0):
result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"')
if (result['returncode'] != 0):
print('Database creation failed!')
return False
return True
def set_dbPrivilegesForUser(userName, dbName, postgre_path_to_bin = ''):
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"') != 0):
result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"')
if (result['returncode'] != 0):
print('Grant privileges failed!')
return False
return True
def create_postgreUser(userName, userPass, postgre_path_to_bin = ''):
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"') != 0):
result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"')
if (result['returncode'] != 0):
print('User creation failed!')
return False
return True
def change_userPass(userName, userPass, postgre_path_to_bin = ''):
@ -766,13 +812,24 @@ def change_userPass(userName, userPass, postgre_path_to_bin = ''):
return False
return True
def configureDb(userName, dbName, scriptPath, postgre_path_to_bin = ''):
print('Execution ' + scriptPath)
postgreLoginSrt = get_postgreLoginSrting(userName)
code = base.exec_command_in_dir(postgre_path_to_bin, postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"')
if (code != 0):
print('Execution failed!')
print('Executing ' + scriptPath)
if not base.is_file(scriptPath):
print('ERROR: Script file does not exist!')
return False
postgreLoginSrt = get_postgreLoginSrting(userName)
full_command = postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"'
# Use run_command_in_dir to capture output
result = base.run_command_in_dir(postgre_path_to_bin, full_command)
if (result['returncode'] != 0):
print('Execution failed!')
if result['stderr']:
print('Error: ' + result['stderr'])
return False
print('Execution completed')
return True
def uninstall_postgresql():

View File

@ -131,6 +131,8 @@ def make_tar():
make_args = ["tar"]
if common.platform == "darwin_arm64":
make_args += ["-e", "UNAME_M=arm64"]
if common.platform == "darwin_x86_64":
make_args += ["-e", "UNAME_M=x86_64"]
if common.platform == "linux_aarch64":
make_args += ["-e", "UNAME_M=aarch64"]
if not branding.onlyoffice:
@ -168,7 +170,7 @@ def make_wheel():
utils.delete_dir("python")
utils.copy_dir("../onlyoffice/build_tools/packaging/docbuilder/resources", "python")
utils.copy_dir(builder_dir, "python/docbuilder/lib")
utils.copy_dir(builder_dir, "python/docbuilder/lib", True, True)
desktop_dir = "../desktop-apps/macos/build/ONLYOFFICE.app/Contents/Resources/converter"
if utils.is_macos() and "desktop" in common.targets and utils.is_exist(desktop_dir):
@ -202,7 +204,11 @@ def make_wheel():
utils.delete_file("docbuilder.net.dll")
utils.delete_file("docbuilder.jni.dll")
elif utils.is_macos():
utils.delete_file("libdocbuilder.jni.dylib")
if (utils.is_file("libdocbuilder.jni.dylib")):
utils.delete_file("libdocbuilder.jni.dylib")
if (utils.is_dir("docbuilder.jni.framework")):
utils.delete_file("docbuilder.jni.framework")
utils.remove_all_symlinks(".")
elif utils.is_linux():
utils.delete_file("libdocbuilder.jni.so")

View File

@ -3,14 +3,14 @@
platformPrefixes = {
"windows_x64": "win_64",
"windows_x86": "win_32",
"windows_arm64": "win_arm64",
"windows_x64_xp": "win_64_xp",
"windows_x86_xp": "win_32_xp",
"darwin_x86_64": "mac_64",
"darwin_arm64": "mac_arm64",
"darwin_x86_64": "mac_64",
"darwin_x86_64_v8": "mac_64",
"linux_x86_64": "linux_64",
"linux_aarch64": "linux_arm64",
"linux_x86_64_cef": "linux_64",
}
out_dir = "build_tools/out"

View File

@ -44,7 +44,8 @@ def make_windows():
"windows_x64": "x64",
"windows_x64_xp": "x64",
"windows_x86": "x86",
"windows_x86_xp": "x86"
"windows_x86_xp": "x86",
"windows_arm64": "arm64"
}[common.platform]
xp = common.platform.endswith("_xp")
@ -61,16 +62,17 @@ def make_windows():
if not xp:
make_prepare()
make_zip()
make_inno()
if branding.onlyoffice:
make_inno()
make_inno("standalone")
make_inno("update")
make_advinst()
if arch != "arm64":
make_inno("update")
make_advinst()
make_prepare("commercial")
make_zip("commercial")
make_inno("commercial")
make_advinst("commercial")
make_prepare("commercial")
make_zip("commercial")
make_inno("commercial")
make_advinst("commercial")
else:
make_prepare("xp")
make_zip("xp")
@ -83,7 +85,8 @@ def make_prepare(edition = "opensource"):
args = [
"-Version", package_version,
"-Arch", arch,
"-Target", edition
"-Target", edition,
"-CompanyName", branding.company_name
]
if common.sign:
args += ["-Sign"]
@ -101,7 +104,8 @@ def make_zip(edition = "opensource"):
args = [
"-Version", package_version,
"-Arch", arch,
"-Target", edition
"-Target", edition,
"-CompanyName", branding.company_name
]
# if common.sign:
# args += ["-Sign"]
@ -329,7 +333,12 @@ def make_linux():
if common.deploy:
for t in branding.desktop_make_targets:
utils.log_h2("desktop " + edition + " " + t["make"] + " deploy")
ret = s3_upload(utils.glob_path(t["src"]), t["dst"])
uploads = []
for f in utils.glob_path(t["src"]):
if "help" in f and not \
("x86_64" in common.platform and edition == "opensource"): continue
uploads.append(f)
ret = s3_upload(uploads, t["dst"])
utils.set_summary("desktop " + edition + " " + t["make"] + " deploy", ret)
utils.set_cwd(common.workspace_dir)

View File

@ -201,12 +201,12 @@ def copy_files(src, dst, override=True, verbose=True):
copy_files(file + "/*", dst + "/" + file_name, override)
return
def copy_dir(src, dst, verbose=True):
def copy_dir(src, dst, verbose=True, symlinks=False):
if verbose:
log("- copy_dir:")
log(" src: " + src)
log(" dst: " + dst)
shutil.copytree(src, dst)
shutil.copytree(src, dst, symlinks=symlinks)
return
def copy_dir_content(src, dst, filter_include = "", filter_exclude = "", verbose=True):
@ -262,6 +262,20 @@ def delete_files(src, verbose=True):
shutil.rmtree(path, ignore_errors=True)
return
def remove_all_symlinks(dir):
for root, dirs, files in os.walk(dir, topdown=True, followlinks=False):
for name in files:
path = os.path.join(root, name)
if os.path.islink(path):
os.unlink(path)
for name in list(dirs):
path = os.path.join(root, name)
if os.path.islink(path):
os.unlink(path)
dirs.remove(name)
return
def set_summary(target, status):
common.summary.append({target: status})
return

View File

@ -100,11 +100,18 @@ def make(platform, project, qmake_config_addon="", is_no_errors=False):
if "1" == config.option("use-clang"):
build_params.append("-spec")
build_params.append("linux-clang-libc++")
if "" != config.option("sysroot"):
base.set_sysroot_env()
base.cmd_exe(qmake_app, build_params) # calls cmd_exe to pass os.env
else:
base.cmd(qmake_app, build_params)
sysroot_path = config.option("sysroot_" + platform)
os.environ['QMAKE_CUSTOM_SYSROOT'] = sysroot_path
os.environ['QMAKE_CUSTOM_SYSROOT_BIN'] = config.get_custom_sysroot_bin(platform)
os.environ['PKG_CONFIG_PATH'] = config.get_custom_sysroot_lib(platform, True) + "/pkgconfig"
os.environ['PKG_CONFIG_SYSROOT_DIR'] = sysroot_path
base.cmd_exe(qmake_app, build_params)
if "" != config.option("sysroot"):
base.set_sysroot_env(platform)
base.correct_makefile_after_qmake(platform, makefile)
if ("1" == config.option("clean")):
@ -113,6 +120,9 @@ def make(platform, project, qmake_config_addon="", is_no_errors=False):
base.cmd(qmake_app, build_params)
base.correct_makefile_after_qmake(platform, makefile)
base.cmd_and_return_cwd("make", ["-f", makefile] + get_j_num(), is_no_errors)
if "" != config.option("sysroot"):
base.restore_sysroot_env()
else:
config_params_array = base.qt_config_as_param(config_param)
config_params_string = ""

View File

@ -5,7 +5,8 @@ import argparse
import re
import platform
root = '../../../../..'
script_path = os.path.abspath(__file__)
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
# Configuration files
configs = [
@ -23,6 +24,8 @@ editors_maps = {
}
def generate(output_dir, md=False):
os.chdir(os.path.dirname(script_path))
if not os.path.exists(output_dir):
os.makedirs(output_dir)

View File

@ -13,6 +13,10 @@ editors = {
"forms": "form-api"
}
script_path = os.path.abspath(__file__)
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
missing_examples = []
used_enumerations = set()
@ -550,6 +554,8 @@ def process_doclets(data, output_dir, editor_name):
missing_examples.append(os.path.relpath(enum_file_path, output_dir))
def generate(output_dir):
os.chdir(os.path.dirname(script_path))
print('Generating Markdown documentation...')
generate_docs_json.generate(output_dir + 'tmp_json', md=True)
@ -576,7 +582,7 @@ if __name__ == "__main__":
type=str,
help="Destination directory for the generated documentation",
nargs='?', # Indicates the argument is optional
default="../../../../../api.onlyoffice.com/site/docs/office-api/usage-api/" # Default value
default=f"{root}/api.onlyoffice.com/site/docs/office-api/usage-api/" # Default value
)
args = parser.parse_args()
generate(args.destination)

View File

@ -21,7 +21,9 @@ editors_names = {
"forms": "Forms"
}
root = '../../../../..'
script_path = os.path.abspath(__file__)
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
missing_examples = []
def load_json(file_path):
@ -199,6 +201,8 @@ def process_doclets(doclets, output_entries, editor_name, model):
output_entries.append(create_entry(system_message, comment, assistant_message, model))
def generate(output_dir, model):
os.chdir(os.path.dirname(script_path))
print('Generating documentation JSONL dataset...')
shutil.rmtree(output_dir, ignore_errors=True)
@ -228,7 +232,7 @@ if __name__ == "__main__":
type=str,
help="Destination directory for the generated documentation",
nargs='?', # Indicates the argument is optional
default="../../../../../office-js-api/dataset" # Default value
default=f"{root}/office-js-api/dataset" # Default value
)
parser.add_argument(
"model",

View File

@ -13,9 +13,12 @@ configs = [
"./config/events/forms.json"
]
root = '../../../../..'
script_path = os.path.abspath(__file__)
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
def generate(output_dir, md=False):
os.chdir(os.path.dirname(script_path))
if not os.path.exists(output_dir):
os.makedirs(output_dir)

View File

@ -14,6 +14,9 @@ editors = {
"forms": "form-api"
}
script_path = os.path.abspath(__file__)
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
missing_examples = []
used_enumerations = set()
@ -372,6 +375,8 @@ def process_events(data, editor_dir):
write_markdown_file(os.path.join(events_dir, "Events.md"), generate_events_summary(events))
def generate_events(output_dir):
os.chdir(os.path.dirname(script_path))
if output_dir.endswith('/'):
output_dir = output_dir[:-1]
tmp = os.path.join(output_dir, 'tmp_json')
@ -391,7 +396,7 @@ if __name__ == "__main__":
parser.add_argument(
"destination",
nargs="?",
default="../../../../../api.onlyoffice.com/site/docs/plugin-and-macros/interacting-with-editors/",
default=f"{root}/api.onlyoffice.com/site/docs/plugin-and-macros/interacting-with-editors/",
help="Output directory"
)
args = parser.parse_args()

View File

@ -13,9 +13,12 @@ configs = [
"./config/methods/forms.json"
]
root = '../../../../..'
script_path = os.path.abspath(__file__)
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
def generate(output_dir, md=False):
os.chdir(os.path.dirname(script_path))
if not os.path.exists(output_dir):
os.makedirs(output_dir)

View File

@ -13,6 +13,9 @@ editors = {
"forms": "form-api"
}
script_path = os.path.abspath(__file__)
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
missing_examples = []
used_enumerations = set()
@ -614,6 +617,8 @@ def process_doclets(data, output_dir, editor_name):
missing_examples.append(os.path.relpath(enum_file_path, output_dir))
def generate(output_dir):
os.chdir(os.path.dirname(script_path))
print('Generating Markdown documentation...')
if output_dir[-1] == '/':
@ -637,7 +642,7 @@ if __name__ == "__main__":
type=str,
help="Destination directory for the generated documentation",
nargs='?', # Indicates the argument is optional
default="../../../../../api.onlyoffice.com/site/docs/plugin-and-macros/interacting-with-editors/" # Default value
default=f"{root}/api.onlyoffice.com/site/docs/plugin-and-macros/interacting-with-editors/" # Default value
)
args = parser.parse_args()
generate(args.destination)

View File

@ -13,9 +13,11 @@
"core/UnicodeConverter/UnicodeConverter.pro",
"core/Common/kernel.pro",
"core/Common/Network/network.pro",
"core/OdfFile/Reader/Converter/StarMath2OOXML/StarMath2OOXML.pro",
"core/DesktopEditor/graphics/pro/graphics.pro",
"core/PdfFile/PdfFile.pro",
"core/DjVuFile/DjVuFile.pro",
"core/XpsFile/XpsFile.pro",
@ -27,7 +29,7 @@
"core/Apple/IWork.pro",
"core/DocxRenderer/DocxRenderer.pro",
"core/DocxRenderer/DocxRenderer.pro",
"core/DesktopEditor/doctrenderer/doctrenderer.pro",
@ -79,11 +81,11 @@
"multimedia" : [
"[win,linux]desktop-sdk/ChromiumBasedEditors/videoplayerlib/videoplayerlib.pro"
],
"desktop" : [
"core",
"multimedia",
"core/DesktopEditor/xmlsec/src/ooxmlsignature.pro",
"desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore.pro",
@ -91,7 +93,7 @@
"[win,linux]desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/qtascdocumentscore.pro",
"[win,linux]desktop-apps/win-linux/ASCDocumentEditor.pro",
"[win]desktop-apps/win-linux/extras/projicons/ProjIcons.pro",
"[win,!win_xp]desktop-apps/win-linux/extras/update-daemon/UpdateDaemon.pro"
],

5
tools/linux/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
qt_build
packages_complete
python3
python3.tar.gz
extract.sh

View File

@ -6,6 +6,7 @@ import base
import os
import subprocess
import deps
import qt_binary_build
def get_branch_name(directory):
cur_dir = os.getcwd()
@ -57,12 +58,7 @@ def install_qt():
return
def install_qt_prebuild():
url_amd64 = "https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/qt/qt_binary_linux_amd64.7z"
base.download(url_amd64, "./qt_amd64.7z")
base.extract("./qt_amd64.7z", "./qt_build")
base.create_dir("./qt_build/Qt-5.9.9")
base.cmd("mv", ["./qt_build/qt_amd64", "./qt_build/Qt-5.9.9/gcc_64"])
base.setup_local_qmake("./qt_build/Qt-5.9.9/gcc_64/bin")
base.cmd("python3", ["qt_binary_fetch.py", "all"])
return
if not base.is_file("./node_js_setup_14.x"):
@ -72,7 +68,7 @@ if not base.is_file("./node_js_setup_14.x"):
if not base.is_dir("./qt_build"):
print("install qt...")
if base.get_env("DO_NOT_USE_PREBUILD_QT") == "1":
install_qt()
qt_binary_build.install_qt()
else:
install_qt_prebuild()

5
tools/linux/cmake.sh Executable file
View File

@ -0,0 +1,5 @@
wget https://github.com/Kitware/CMake/releases/download/v3.30.0/cmake-3.30.0-linux-x86_64.tar.gz
tar -xzf cmake-3.30.0-linux-x86_64.tar.gz -C /opt
ln -s /opt/cmake-3.30.0-linux-x86_64/bin/cmake /usr/local/bin/cmake
ln -s /opt/cmake-3.30.0-linux-x86_64/bin/ctest /usr/local/bin/ctest
rm cmake-3.30.0-linux-x86_64.tar.gz

View File

@ -43,7 +43,8 @@ def install_deps():
"libncurses6",
"curl",
"libxkbcommon-dev",
"libxkbcommon-x11-dev"]
"libxkbcommon-x11-dev",
"libnotify-dev"]
for package in packages:
base.cmd("sudo", ["apt-get", "install", "-y", package], True)
@ -67,7 +68,7 @@ def install_deps():
print("OK")
base.cmd("sudo", ["apt-get", "-y", "install", "npm", "yarn"], True)
base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"])
base.cmd("sudo", ["npm", "install", "-g", "@yao-pkg/pkg"])
base.cmd("sudo", ["npm", "install", "-g", "@yao-pkg/pkg@6.11.0"])
# java
java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-11-jdk"], True)

16
tools/linux/python.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
wget https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/python/python3.tar.gz
wget https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/python/extract.sh
chmod +x ./extract.sh
./extract.sh
cd ./python3/bin
ln -s python3 python
cd ../../
rm ./extract.sh
rm ./python3.tar.gz

47
tools/linux/qt_binary_build.py Executable file
View File

@ -0,0 +1,47 @@
#!/usr/bin/env python
import sys
sys.path.append('../../scripts')
import base
import os
import subprocess
import deps
def install_qt():
# qt
if not base.is_file("./qt_source_5.9.9.tar.xz"):
base.download("https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/qt/qt-everywhere-opensource-src-5.9.9.tar.xz", "./qt_source_5.9.9.tar.xz")
if not base.is_dir("./qt-everywhere-opensource-src-5.9.9"):
base.cmd("tar", ["-xf", "./qt_source_5.9.9.tar.xz"])
qt_params = ["-opensource",
"-confirm-license",
"-release",
"-shared",
"-accessibility",
"-prefix",
"./../qt_build/Qt-5.9.9/gcc_64",
"-qt-zlib",
"-qt-libpng",
"-qt-libjpeg",
"-qt-xcb",
"-qt-pcre",
"-no-sql-sqlite",
"-no-qml-debug",
"-gstreamer", "1.0",
"-nomake", "examples",
"-nomake", "tests",
"-skip", "qtenginio",
"-skip", "qtlocation",
"-skip", "qtserialport",
"-skip", "qtsensors",
"-skip", "qtxmlpatterns",
"-skip", "qt3d",
"-skip", "qtwebview",
"-skip", "qtwebengine"]
base.cmd_in_dir("./qt-everywhere-opensource-src-5.9.9", "./configure", qt_params)
base.cmd_in_dir("./qt-everywhere-opensource-src-5.9.9", "make", ["-j", "4"])
base.cmd_in_dir("./qt-everywhere-opensource-src-5.9.9", "make", ["install"])
return

67
tools/linux/qt_binary_fetch.py Executable file
View File

@ -0,0 +1,67 @@
#!/usr/bin/env python3
import sys
import os
sys.path.append('../../scripts')
import base
URL = "https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/qt/"
SYSROOTS = {
"amd64": "qt_binary_5.9.9_gcc_64.7z",
"arm64": "qt_binary_5.9.9_gcc_arm64.7z",
}
COMPILERS = {
"amd64": "gcc_64",
"arm64": "gcc_arm64",
}
def download_and_extract(name):
cur_dir = os.getcwd()
os.chdir("./qt_build/Qt-5.9.9")
archive = SYSROOTS[name]
folder = "./" + COMPILERS[name]
if (base.is_dir(folder)):
base.delete_dir(folder)
archive_file = "./" + archive
base.download(URL + archive, archive_file)
base.extract(archive_file, "./")
os.chdir(cur_dir)
base.setup_local_qmake("./qt_build/Qt-5.9.9/" + COMPILERS[name] + "/bin")
def main():
if len(sys.argv) != 2:
print("Usage: fetch.py [amd64|arm64|all]")
sys.exit(1)
target = sys.argv[1]
if not base.is_dir("./qt_build/Qt-5.9.9"):
base.create_dir("./qt_build/Qt-5.9.9")
targets = []
if ("all" == target):
targets.append("amd64")
targets.append("arm64")
elif ("arm64" == target) and not base.is_os_arm():
targets.append("amd64")
targets.append(target)
else:
targets.append(target)
if (0 == len(targets)):
print(f"Unknown target: {target}")
print("Valid values: amd64, arm64, all")
sys.exit(1)
for name in targets:
download_and_extract(name)
if "arm64" in targets and not base.is_os_arm():
base.move_dir("./qt_build/Qt-5.9.9/gcc_arm64/bin", "./qt_build/Qt-5.9.9/gcc_arm64/_bin")
base.copy_dir("./qt_build/Qt-5.9.9/gcc_64/bin", "./qt_build/Qt-5.9.9/gcc_arm64/bin")
if __name__ == "__main__":
main()

2
tools/linux/sysroot/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*sysroot*

View File

@ -1,82 +0,0 @@
#!/usr/bin/env python
import sys
sys.path.append('../../../scripts')
import base
import os
import shutil
import fix_symlinks
def bash_chroot(command, sysroot):
base.cmd2('sudo -S chroot', [sysroot, '/bin/bash -c', '\"' + command + ' \"'])
def download_sysroot():
curr_dir = base.get_script_dir(__file__)
tmp_sysroot_ubuntu_dir = curr_dir + '/sysroot_ubuntu_1604'
if os.path.isdir(tmp_sysroot_ubuntu_dir):
shutil.rmtree(tmp_sysroot_ubuntu_dir)
# debootstrap for downloading sysroot
base.cmd2('sudo -S apt-get', ['install', 'debootstrap'])
archive_ubuntu_url = 'http://archive.ubuntu.com/ubuntu/'
base.cmd2('sudo -S debootstrap', ['--arch=amd64', 'xenial', tmp_sysroot_ubuntu_dir, archive_ubuntu_url])
# setup a new sources
base.cmd2('sudo -S cp', [curr_dir + '/sources.list', tmp_sysroot_ubuntu_dir + '/etc/apt/sources.list'])
bash_chroot('apt update -y', tmp_sysroot_ubuntu_dir)
bash_chroot('apt upgrade -y', tmp_sysroot_ubuntu_dir)
apt_libs = ["build-essential"]
apt_libs += ["libpthread-stubs0-dev"]
apt_libs += ["zlib1g-dev"]
apt_libs += ["curl"]
apt_libs += ["libc6-dev"]
apt_libs += ["glib-2.0-dev"]
apt_libs += ["libglu1-mesa-dev"]
apt_libs += ["libgtk-3-dev"]
apt_libs += ["libpulse-dev"]
apt_libs += ["libasound2-dev"]
apt_libs += ["libatspi2.0-dev"]
apt_libs += ["libcups2-dev"]
apt_libs += ["libdbus-1-dev"]
apt_libs += ["libicu-dev"]
apt_libs += ["libgstreamer1.0-dev"]
apt_libs += ["libgstreamer-plugins-base1.0-dev"]
apt_libs += ["libx11-xcb-dev"]
apt_libs += ["libxcb*"]
apt_libs += ["libxi-dev"]
apt_libs += ["libxrender-dev"]
apt_libs += ["libxss-dev"]
apt_libs += ["libxkbcommon-dev"]
apt_libs += ["libxkbcommon-x11-dev"]
apt_libs += ["libnotify-dev"]
apt_libs += ["gtk+-3.0-dev"]
apt_libs_str = ""
for apt_lib in apt_libs:
apt_libs_str += apt_lib + " "
bash_chroot('apt install -y ' + apt_libs_str, tmp_sysroot_ubuntu_dir)
# # downloading arm toolchain
arm_toolchain_url = 'https://releases.linaro.org/components/toolchain/binaries/5.4-2017.05/aarch64-linux-gnu/'
arm_toolchain_tar_filename = 'gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz'
arm_toolchain_output_dir = 'gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu'
base.cmd2('wget', [arm_toolchain_url + arm_toolchain_tar_filename])
base.cmd2('tar', ['-xf', arm_toolchain_tar_filename])
base.cmd2('sudo -S rsync', ['-avh', '--progress', curr_dir + '/' + arm_toolchain_output_dir + '/', tmp_sysroot_ubuntu_dir + '/usr/'])
shutil.rmtree(arm_toolchain_output_dir)
os.remove(arm_toolchain_tar_filename)
base.cmd2('sudo -S chmod', ['-R', 'o+rwx', tmp_sysroot_ubuntu_dir])
# fix symlinks
fix_symlinks.fix_symlinks(tmp_sysroot_ubuntu_dir)
return
if __name__ == '__main__':
download_sysroot()

View File

@ -1,4 +1,19 @@
set(CMAKE_C_FLAGS $ENV{CFLAGS})
set(CMAKE_CXX_FLAGS $ENV{CXXFLAGS})
set(CMAKE_C_LINKER_FLAGS $ENV{LDFLAGS})
set(CMAKE_CXX_LINKER_FLAGS $ENV{LDFLAGS})
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_MAKE_PROGRAM "/usr/bin/make" CACHE FILEPATH "" FORCE)
set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX})
set(CMAKE_AR $ENV{AR})
set(CMAKE_RANLIB $ENV{RANLIB})
set(CMAKE_C_FLAGS "$ENV{CFLAGS}" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "$ENV{LDFLAGS}" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "$ENV{LDFLAGS}" CACHE STRING "" FORCE)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

214
tools/linux/sysroot/fetch.py Executable file
View File

@ -0,0 +1,214 @@
#!/usr/bin/env python3
import sys
import os
sys.path.append('../../../scripts')
import base
URL = "https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/sysroot/"
SYSROOTS = {
"amd64": "ubuntu16-amd64-sysroot.tar.gz",
"arm64": "ubuntu16-arm64-sysroot.tar.gz",
}
def patch_linker_scripts(sysroot_path, arch):
"""Fix absolute paths in linker scripts to use sysroot-relative paths"""
# Determine directories to patch
lib_dirs = []
if arch == "arm64":
lib_dirs = [
os.path.join(sysroot_path, "usr/lib/aarch64-linux-gnu")
]
elif arch == "amd64":
lib_dirs = [
os.path.join(sysroot_path, "usr/lib/x86_64-linux-gnu"),
os.path.join(sysroot_path, "usr/aarch64-linux-gnu/lib")
]
else:
return
total_patched = 0
for lib_dir in lib_dirs:
if not os.path.exists(lib_dir):
print(f"Warning: {lib_dir} not found, skipping")
continue
print(f"Patching linker scripts in {lib_dir}...")
patched_count = 0
for filename in os.listdir(lib_dir):
if not filename.endswith(".so"):
continue
filepath = os.path.join(lib_dir, filename)
if not os.path.isfile(filepath):
continue
# Check if it's a text file (linker script)
try:
with open(filepath, 'r') as f:
content = f.read()
# Skip if not a linker script
if "GROUP" not in content and "INPUT" not in content:
continue
original_content = content
# STEP 1: Normalize all /usr/lib paths to /lib
# ORDER MATTERS - do longest paths first to avoid partial matches
# For aarch64
content = content.replace("/usr/aarch64-linux-gnu/lib/", "/lib/aarch64-linux-gnu/")
content = content.replace("/usr/lib/aarch64-linux-gnu/", "/lib/aarch64-linux-gnu/")
# For x86_64
content = content.replace("/usr/x86_64-linux-gnu/lib/", "/lib/x86_64-linux-gnu/")
content = content.replace("/usr/lib/x86_64-linux-gnu/", "/lib/x86_64-linux-gnu/")
# STEP 2: Add = prefix for sysroot-relative paths
content = content.replace("/lib/aarch64-linux-gnu/", "=/lib/aarch64-linux-gnu/")
content = content.replace("/lib/x86_64-linux-gnu/", "=/lib/x86_64-linux-gnu/")
# Write back only if changed
if content != original_content:
with open(filepath, 'w') as f:
f.write(content)
print(f" Patched: {filename}")
patched_count += 1
except Exception as e:
# Not a text file or other error, skip
pass
total_patched += patched_count
print(f"Patched {patched_count} linker scripts in {lib_dir}")
print(f"Total patched: {total_patched} linker scripts")
# Create symlinks from /lib to /usr/lib for library resolution
create_lib_symlinks(sysroot_path, arch)
# Fix absolute symlinks to relative ones
fix_absolute_symlinks(sysroot_path, arch)
def create_lib_symlinks(sysroot_path, arch):
"""Create symlinks from /lib to /usr/lib for library resolution"""
print(f"Creating library symlinks in {sysroot_path}...")
if arch == "arm64":
lib_symlink_dir = os.path.join(sysroot_path, "lib/aarch64-linux-gnu")
lib_target_dir = os.path.join(sysroot_path, "usr/lib/aarch64-linux-gnu")
elif arch == "amd64":
lib_symlink_dir = os.path.join(sysroot_path, "lib/x86_64-linux-gnu")
lib_target_dir = os.path.join(sysroot_path, "usr/lib/x86_64-linux-gnu")
else:
return
# Create /lib/{arch} directory
os.makedirs(lib_symlink_dir, exist_ok=True)
if not os.path.exists(lib_target_dir):
print(f" Warning: Target directory {lib_target_dir} does not exist")
return
symlink_count = 0
# Create symlinks for all files in /usr/lib/{arch}
for filename in os.listdir(lib_target_dir):
target = os.path.join(lib_target_dir, filename)
link = os.path.join(lib_symlink_dir, filename)
# Skip if symlink already exists
if os.path.exists(link) or os.path.islink(link):
continue
# Create relative symlink
rel_target = os.path.relpath(target, lib_symlink_dir)
try:
os.symlink(rel_target, link)
symlink_count += 1
except OSError as e:
print(f" Warning: Could not create symlink {link}: {e}")
print(f"Created {symlink_count} symlinks in {lib_symlink_dir}")
def fix_absolute_symlinks(sysroot_path, arch):
"""Fix absolute symlinks in /usr/lib to use relative paths"""
print(f"Fixing absolute symlinks in {sysroot_path}...")
if arch == "arm64":
lib_dir = os.path.join(sysroot_path, "usr/lib/aarch64-linux-gnu")
elif arch == "amd64":
lib_dir = os.path.join(sysroot_path, "usr/lib/x86_64-linux-gnu")
else:
return
if not os.path.exists(lib_dir):
print(f" Warning: {lib_dir} not found")
return
fixed_count = 0
# Find all .so symlinks pointing to /lib/
for filename in os.listdir(lib_dir):
if not filename.endswith(".so"):
continue
filepath = os.path.join(lib_dir, filename)
# Check if it's a symlink
if not os.path.islink(filepath):
continue
# Get symlink target
target = os.readlink(filepath)
# Check if it's an absolute path starting with /lib/
if target.startswith("/lib/"):
# Convert to relative path: /lib/... -> ../../../lib/...
relative_target = os.path.join("../../..", target[1:]) # Remove leading /
# Remove old symlink and create new one
os.unlink(filepath)
os.symlink(relative_target, filepath)
print(f" Fixed: {filename} -> {relative_target}")
fixed_count += 1
print(f"Fixed {fixed_count} absolute symlinks")
def download_and_extract(name):
archive = SYSROOTS[name]
base.download(URL + archive, "./" + archive)
base.cmd("tar", ["-xzf", "./" + archive])
sysroot_name = archive.replace(".tar.gz", "")
patch_linker_scripts(sysroot_name, name)
def main():
if len(sys.argv) != 2:
print("Usage: fetch.py [amd64|arm64|all]")
sys.exit(1)
target = sys.argv[1]
if target == "all":
for name in SYSROOTS:
download_and_extract(name)
elif target in SYSROOTS:
download_and_extract(target)
else:
print(f"Unknown target: {target}")
print("Valid values: amd64, arm64, all")
sys.exit(1)
if __name__ == "__main__":
main()

View File

@ -1,45 +0,0 @@
import os
import sys
import uuid
# change symbolic link to relative paths
def fix_symlinks(top_dir='./sysroot_ubuntu_1604'):
for root, dirs, files in os.walk(top_dir):
for name in files:
path = os.path.join(root, name)
if not os.path.islink(path):
continue
try:
target = os.readlink(path)
except OSError as e:
print(f"Error reading link '{path}': {e}", file=sys.stderr)
continue
if not target.startswith('/'):
continue
new_target = top_dir + target
new_target_rel = os.path.relpath(new_target, os.path.dirname(path))
temp_name = f".tmp.{uuid.uuid4().hex}"
temp_path = os.path.join(root, temp_name)
try:
os.symlink(new_target_rel, temp_path)
except OSError as e:
print(f"Failed to create temporary symlink for '{path}': {e}", file=sys.stderr)
continue
try:
os.replace(temp_path, path)
print(f"Updated: {path} -> {new_target_rel}")
except OSError as e:
print(f"Failed to replace symlink '{path}': {e}", file=sys.stderr)
try:
os.unlink(temp_path)
except OSError:
pass
if __name__ == "__main__":
if len(sys.argv) > 1:
directory = sys.argv[1]
else:
directory = './sysroot_ubuntu_1604'
fix_symlinks(directory)

View File

@ -1,51 +0,0 @@
#deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

View File

@ -0,0 +1,17 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
set(CMAKE_C_LINKER aarch64-linux-gnu-ld)
set(CMAKE_CXX_LINKER aarch64-linux-gnu-ld)
set(CMAKE_AR aarch64-linux-gnu-ar)
set(CMAKE_RANLIB aarch64-linux-gnu-ranlib)
set(CMAKE_STRIP aarch64-linux-gnu-strip)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

5
tools/win/qemu/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
*
!.gitignore
!README.md
!automate.bat
!start.bat

102
tools/win/qemu/README.md Normal file
View File

@ -0,0 +1,102 @@
# **Setting up QEMU Windows 11**
## **0. Preparing for Installation**
1) Install [**MSYS2**](https://www.msys2.org/). The following commands assume that the installation directory remains the default.
2) ```pacman -S mingw-w64-x86_64-qemu```
3) Verify installation: ```C:\msys64\mingw64\bin\qemu-system-aarch64.exe --version```
4) Create an image: ```C:\msys64\mingw64\bin\qemu-img create win11-arm64.img 40G```
5) Download the Windows 11 ARM64 ISO (a VPN may be required): https://www.microsoft.com/en-us/software-download/windows11arm64
6) Download the drivers: https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md
7) Download the bootloader: https://packages.debian.org/sid/qemu-efi-aarch64
```ar x qemu-efi-aarch64*.deb```
```tar xvf data.tar.xz```
```mv ./usr/share/qemu-efi-aarch64/QEMU_EFI.fd .```
8) Run _start.bat_
**Note:** If you plan to install the VM elsewhere, copy _start.bat_ to that same location.
---
## **1. Installing and Configuring QEMU**
1. To install QEMU and run a Windows ARM64 virtual machine, follow this tutorial:
[Windows ARM64 VM using qemu-system](https://linaro.atlassian.net/wiki/spaces/WOAR/pages/28914909194/windows-arm64+VM+using+qemu-system).
During installation, there may be no “Back” button (as was my case); if so, you need to set the required registry variables beforehand.
It is strongly recommended to select the **Pro** version — functionality is not guaranteed on the Home edition.
2. Installing connection drivers is essential; details are provided at the end of the tutorial. Other drivers are optional.
---
## **2. Creating a Shared Folder**
To share files between the host Windows and the guest OS, create a folder, for example **D:\shared**.
The _shared_ folder can also be a working repository folder; in that case, replace _shared_ with your folder name later on.
1. Right-click the folder → **Properties**.
2. Go to **Sharing** → **Share**.
3. In the list, select **Everyone** (or a specific user), click **Add**, grant **Read/Write** permissions, and then click **Share**.
You may also need to allow guest connections both on the host and in the guest OS. Instructions are available [here](https://learn.microsoft.com/en-us/windows-server/storage/file-server/enable-insecure-guest-logons-smb2-and-smb3?tabs=powershell).
Now the folder is accessible from the guest machine.
---
## **3. Verification**
After starting the virtual machine, open **Command Prompt** or **PowerShell** **without** administrator rights and run:
```
net use Z: \\10.0.2.2\shared /user:guest ""
dir Z:
```
These commands should complete without errors and display a list of directories and files in the shared folder.
---
## **4. Installing VC_redist**
Additional packages are required for running software. You can download them inside the guest machine, but that may take a long time, so its recommended to download them on the host, place them in the shared folder, and install them from there.
Download from:
https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 (choose ARM64 version).
To install from the command line after connecting the shared folder:
```
.\Z:\VC_redist.arm64.exe
```
---
## **5. Setting Up Automatic Script Execution via Task Scheduler**
Before creating a task, remove the password from your user account so that the system logs in automatically when the VM starts.
### **Creating the Task**
1. Open **Task Scheduler** → **Create Task...**
2. **General** tab:
- Name: Automate
- Run only when user is logged on
- Run with highest privileges
3. **Triggers** tab:
- New → **At log on**
4. **Actions** tab:
- Action: **Start a program**
- Program/script:
`\\10.0.2.2\shared\build_tools\tools\win\qemu\automate.bat`
---
## **6. Config Setup**
Finally, specify the path to the folder containing the VM and the _start.bat_ script in the configuration under
```qemu-win-arm64-dir```.
You can do this either through `configure.py` or by editing the configuration file directly.

View File

@ -0,0 +1,52 @@
setlocal enabledelayedexpansion
set "script_dir=%~dp0"
set "config_file=%script_dir%..\..\..\config"
set "git_dir=%script_dir%..\..\..\..\
set "module_list="
set "branding_value="
set "themesparams="
for /f "delims=" %%a in ('type "%config_file%"') do (
set "line=%%a"
if "!line:~0,7!"=="module=" (
set "module_list=!line:~7!"
set "module_list=!module_list:"=!"
)
if "!line:~0,14!"=="branding-name=" (
set "branding_value=!line:~14!"
set "branding_value=!branding_value:"=!"
)
if "!line:~0,13!"=="themesparams=" (
set "themesparams=!line:~13!"
set "themesparams=!branding_value:"=!"
)
)
if "!branding_value!"=="" (
set "branding_value=onlyoffice"
)
set "base_out_dir=%script_dir%..\..\..\out\win_arm64\%branding_value%"
for %%m in (!module_list!) do (
if "%%m"=="desktop" (
call %base_out_dir%\DesktopEditors\converter\x2t.exe -create-js-snapshots
call %base_out_dir%\DesktopEditors\converter\allfontsgen.exe --use-system="1" --input="%base_out_dir%\DesktopEditors\fonts" --input="%git_dir%\core-fonts" --allfonts="%base_out_dir%\DesktopEditors\converter\AllFonts.js" --selection="%base_out_dir%\DesktopEditors\converter\font_selection.bin"
call %base_out_dir%\DesktopEditors\converter\allthemesgen.exe --converter-dir="%base_out_dir%\DesktopEditors\converter" --src="%base_out_dir%\DesktopEditors\editors\sdkjs\slide\themes" --allfonts="AllFonts.js" --output="%base_out_dir%\DesktopEditors\editors\sdkjs\common\Images" --params="%themesparams%"
del %base_out_dir%\DesktopEditors\converter\allfontsgen.exe
del %base_out_dir%\DesktopEditors\converter\allthemesgen.exe
)
if "%%m"=="server" (
call %base_out_dir%\documentserver\server\FileConverter\bin\x2t -create-js-snapshots
)
if "%%m"=="builder" (
call %base_out_dir%\DocumentBuilder\x2t -create-js-snapshots
)
if "%%m"=="core" (
call %base_out_dir%\core\x2t -create-js-snapshots
)
)
shutdown /s /f /t 10

17
tools/win/qemu/start.bat Normal file
View File

@ -0,0 +1,17 @@
@echo off
REM ========================================================
REM INSTALL Windows ARM64 VM (QEMU on Windows x64)
REM ========================================================
C:\msys64\mingw64\bin\qemu-system-aarch64 ^
-M virt -m 8G -cpu max,pauth-impdef=on -smp 8 ^
-bios ./QEMU_EFI.fd ^
-accel tcg,thread=multi ^
-device ramfb ^
-device qemu-xhci -device usb-kbd -device usb-tablet ^
-nic user,model=virtio-net-pci ^
-device usb-storage,drive=install ^
-drive if=none,id=install,format=raw,media=cdrom,file=./Win11_24H2_English_Arm64.iso ^
-device usb-storage,drive=virtio-drivers ^
-drive if=none,id=virtio-drivers,format=raw,media=cdrom,file=./virtio-win-0.1.271.iso ^
-drive if=virtio,id=system,format=raw,file=./win11-arm64.img

View File

@ -1 +1 @@
9.0.4
9.2.1