mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
Compare commits
59 Commits
v9.1.0.136
...
feature/lo
| Author | SHA1 | Date | |
|---|---|---|---|
| bbac3683f8 | |||
| e11a0374ba | |||
| 4c5d86bba0 | |||
| 764c2a84f8 | |||
| eef1d728b5 | |||
| 0dbf009c6b | |||
| 133192df35 | |||
| c45cf77747 | |||
| 9f898d6873 | |||
| 61bf2d9413 | |||
| 0c8b3e5919 | |||
| 6fd500e55d | |||
| 10f7dcee17 | |||
| 2fcdef2e00 | |||
| 2ec27065f8 | |||
| 4f804ba0e6 | |||
| 7fb05a51f9 | |||
| 30e3202fd5 | |||
| b6b09d17f4 | |||
| 8a70f3d14a | |||
| aaa5096526 | |||
| 668aa88c6e | |||
| ec544ca9ab | |||
| 17ee00a04c | |||
| bc4daa9546 | |||
| 099003b250 | |||
| ee4469885e | |||
| 1350955f67 | |||
| de36280085 | |||
| 0399ea1cb1 | |||
| 41ed9824ab | |||
| 842df5ffd0 | |||
| d0e3f36313 | |||
| 2378bb91fd | |||
| 18605dc68f | |||
| 5004a30908 | |||
| 33e41ed704 | |||
| 1f4c88a489 | |||
| 283977f014 | |||
| e71e0bee74 | |||
| fe9847f246 | |||
| f79bfd099b | |||
| 3ec9b4dba5 | |||
| 0c7348fc89 | |||
| 97b615c36a | |||
| 59f95f52ce | |||
| ba04810793 | |||
| aea03d8554 | |||
| 09247281ef | |||
| 7b31d85c7c | |||
| 3ad5b9d05d | |||
| 894f23b292 | |||
| b46d6075e4 | |||
| e349f3dba2 | |||
| 559837ee13 | |||
| e700a98963 | |||
| 9635b8c08f | |||
| 878057972b | |||
| 1f7a7fc452 |
17
Dockerfile
17
Dockerfile
@ -1,17 +1,30 @@
|
||||
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
|
||||
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
|
||||
|
||||
RUN mkdir -p /opt/python3 && \
|
||||
tar -xzf /build_tools/tools/linux/python3.tar.gz -C /opt/python3 --strip-components=1
|
||||
wget -P /opt/python3/ https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/python/python3.tar.gz && \
|
||||
tar -xzf /opt/python3/python3.tar.gz -C /opt/python3 --strip-components=1
|
||||
|
||||
ENV PATH="/opt/python3/bin:${PATH}"
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
5
make.py
5
make.py
@ -19,8 +19,6 @@ import make_common
|
||||
import develop
|
||||
import argparse
|
||||
|
||||
base.check_python()
|
||||
|
||||
parser = argparse.ArgumentParser(description="options")
|
||||
parser.add_argument("--build-only-branding", action="store_true")
|
||||
args = parser.parse_args()
|
||||
@ -30,6 +28,7 @@ if (args.build_only_branding):
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
base.check_python()
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
@ -92,8 +91,6 @@ if config.check_option("module", "desktop"):
|
||||
config.extend_option("config", "updmodule")
|
||||
base.set_env("DESKTOP_URL_UPDATES_MAIN_CHANNEL", "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.json")
|
||||
base.set_env("DESKTOP_URL_UPDATES_DEV_CHANNEL", "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcastdev.json")
|
||||
base.set_env("DESKTOP_URL_INSTALL_CHANNEL", "https://download.onlyoffice.com/install/desktop/editors/windows/distrib/onlyoffice/<file>")
|
||||
base.set_env("DESKTOP_URL_INSTALL_DEV_CHANNEL", "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/onlineinstallerdev/<file>")
|
||||
|
||||
# build
|
||||
build_sln.make()
|
||||
|
||||
@ -917,8 +917,9 @@ def qt_copy_icu(out):
|
||||
prefix = config.option("sysroot")
|
||||
else:
|
||||
prefix = ""
|
||||
postfixes += ["/x86_64-linux-gnu"]
|
||||
postfixes += ["/i386-linux-gnu"]
|
||||
|
||||
postfixes += ["/x86_64-linux-gnu"]
|
||||
postfixes += ["/i386-linux-gnu"]
|
||||
|
||||
for postfix in postfixes:
|
||||
tests += [prefix + "/lib" + postfix]
|
||||
@ -1349,25 +1350,24 @@ def mac_correct_rpath_x2t(dir):
|
||||
mac_correct_rpath_library("DocxRenderer", ["UnicodeConverter", "kernel", "graphics"])
|
||||
mac_correct_rpath_library("IWorkFile", ["UnicodeConverter", "kernel"])
|
||||
mac_correct_rpath_library("HWPFile", ["UnicodeConverter", "kernel", "graphics"])
|
||||
cmd("chmod", ["-v", "+x", "./x2t"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./x2t"], True)
|
||||
mac_correct_rpath_binary("./x2t", mac_icu_libs + ["UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer", "DocxRenderer", "IWorkFile", "HWPFile"])
|
||||
|
||||
def correct_core_executable(name, libs):
|
||||
cmd("chmod", ["-v", "+x", name])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", name], True)
|
||||
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"])
|
||||
if is_file("./allfontsgen"):
|
||||
cmd("chmod", ["-v", "+x", "./allfontsgen"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./allfontsgen"], True)
|
||||
mac_correct_rpath_binary("./allfontsgen", mac_icu_libs + ["UnicodeConverter", "kernel", "graphics"])
|
||||
correct_core_executable("allfontsgen", ["UnicodeConverter", "kernel", "graphics"])
|
||||
if is_file("./allthemesgen"):
|
||||
cmd("chmod", ["-v", "+x", "./allthemesgen"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./allthemesgen"], True)
|
||||
mac_correct_rpath_binary("./allthemesgen", mac_icu_libs + ["UnicodeConverter", "kernel", "graphics", "kernel_network", "doctrenderer", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "DocxRenderer"])
|
||||
correct_core_executable("allthemesgen", ["UnicodeConverter", "kernel", "graphics", "kernel_network", "doctrenderer", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "DocxRenderer"])
|
||||
if is_file("./pluginsmanager"):
|
||||
cmd("chmod", ["-v", "+x", "./pluginsmanager"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./pluginsmanager"], True)
|
||||
mac_correct_rpath_binary("./pluginsmanager", mac_icu_libs + ["UnicodeConverter", "kernel", "kernel_network"])
|
||||
correct_core_executable("pluginsmanager", ["UnicodeConverter", "kernel", "kernel_network"])
|
||||
if is_file("./vboxtester"):
|
||||
cmd("chmod", ["-v", "+x", "./vboxtester"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./vboxtester"], True)
|
||||
mac_correct_rpath_binary("./vboxtester", mac_icu_libs + ["UnicodeConverter", "kernel", "kernel_network"])
|
||||
correct_core_executable("vboxtester", ["UnicodeConverter", "kernel", "kernel_network"])
|
||||
if is_file("./x2ttester"):
|
||||
correct_core_executable("x2ttester", ["UnicodeConverter", "kernel", "graphics"])
|
||||
os.chdir(cur_dir)
|
||||
return
|
||||
|
||||
@ -1887,6 +1887,25 @@ def check_module_version(actual_version, clear_func):
|
||||
clear_func()
|
||||
return
|
||||
|
||||
|
||||
def set_sysroot_env():
|
||||
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()
|
||||
|
||||
def restore_sysroot_env():
|
||||
os.environ.clear()
|
||||
os.environ.update(ENV_BEFORE_SYSROOT)
|
||||
|
||||
def check_python():
|
||||
if ("linux" != host_platform()):
|
||||
return
|
||||
@ -1953,13 +1972,43 @@ 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"):
|
||||
doctrenderer_lib = "libdoctrenderer.dylib" if is_file(dir + "/libdoctrenderer.dylib") else "doctrenderer.framework/doctrenderer"
|
||||
if os.path.getsize(dir + "/" + doctrenderer_lib) < 5*1024*1024:
|
||||
return
|
||||
|
||||
|
||||
if ((platform == "linux_arm64") and not is_os_arm()):
|
||||
cmd_in_dir_qemu(platform, dir, "./x2t", ["-create-js-snapshots"], True)
|
||||
return
|
||||
|
||||
@ -9,11 +9,24 @@ import qmake
|
||||
|
||||
def make(src_dir, modules, build_platform="android", qmake_addon=""):
|
||||
old_cur = os.getcwd()
|
||||
old_env = dict(os.environ)
|
||||
b2_addon = ""
|
||||
|
||||
print("boost-headers...")
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=system"])
|
||||
base.cmd("./b2", ["--prefix=./../build/" + build_platform, "headers", "install"])
|
||||
|
||||
|
||||
# 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()
|
||||
|
||||
for module in modules:
|
||||
print("boost-module: " + module + " ...")
|
||||
module_dir = src_dir + "/libs/" + module
|
||||
@ -40,6 +53,8 @@ def make(src_dir, modules, build_platform="android", qmake_addon=""):
|
||||
base.save_as_script(module_dir + "/" + module + ".pro", pro_file_content)
|
||||
os.chdir(module_dir)
|
||||
qmake.make_all_platforms(module_dir + "/" + module + ".pro", qmake_addon)
|
||||
|
||||
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
@ -31,6 +31,7 @@ OLD_ENV = dict()
|
||||
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\""]
|
||||
@ -38,13 +39,13 @@ def setup_custom_sysroot_env() -> str:
|
||||
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":
|
||||
@ -124,13 +125,13 @@ def build_with_cmake(platform, cmake_args, build_type):
|
||||
cmake_args_ext += get_cmake_args_android("x86", "16")
|
||||
elif platform == "android_x86_64":
|
||||
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 ""
|
||||
|
||||
# run cmake
|
||||
base.cmd(env_str + "cmake", cmake_args + cmake_args_ext)
|
||||
|
||||
|
||||
# build
|
||||
if "Unix Makefiles" in cmake_args_ext:
|
||||
base.cmd(env_str + "make", ["-j4"])
|
||||
@ -213,6 +214,7 @@ def make_x265(base_dir, build_type):
|
||||
"-DENABLE_CLI=OFF", # do not build standalone CLI app
|
||||
"-DENABLE_SHARED=OFF", # do not build shared libs
|
||||
"-DENABLE_ASSEMBLY=OFF", # disable assembly optimizations
|
||||
"-DENABLE_LIBNUMA=OFF", # disable libnuma usage (affects Linux only)
|
||||
]
|
||||
|
||||
# lib build function
|
||||
|
||||
@ -129,7 +129,6 @@ def make():
|
||||
os.chdir("icu/cross_build")
|
||||
command_configure = "./../source/runConfigureICU"
|
||||
command_compile_addon = "-static-libstdc++ -static-libgcc"
|
||||
ld_library_path_copy = ''
|
||||
if "1" == config.option("use-clang"):
|
||||
command_configure = "CXXFLAGS=-stdlib=libc++ " + command_configure
|
||||
command_compile_addon = "-stdlib=libc++"
|
||||
@ -137,9 +136,7 @@ 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:
|
||||
if 'LD_LIBRARY_PATH' in os.environ:
|
||||
ld_library_path_copy = os.environ['LD_LIBRARY_PATH']
|
||||
os.environ['LD_LIBRARY_PATH'] = config.get_custom_sysroot_lib()
|
||||
base.set_sysroot_env()
|
||||
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",
|
||||
@ -153,7 +150,7 @@ def make():
|
||||
else:
|
||||
base.cmd_exe("make", ["-j4"])
|
||||
base.cmd_exe("make", ["install"], True)
|
||||
os.environ['LD_LIBRARY_PATH'] = ld_library_path_copy
|
||||
base.restore_sysroot_env()
|
||||
|
||||
base.create_dir(base_dir + "/linux_64")
|
||||
base.create_dir(base_dir + "/linux_64/build")
|
||||
|
||||
@ -87,9 +87,7 @@ def make():
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
return
|
||||
|
||||
if (-1 != config.option("platform").find("linux")) and not base.is_dir("../build/linux_64"):
|
||||
ld_library_path_copy = ''
|
||||
|
||||
if (-1 != config.option("platform").find("linux")) and not base.is_dir("../build/linux_64"):
|
||||
base.cmd("./config", ["enable-md2", "no-shared", "no-asm", "--prefix=" + old_cur_dir + "/build/linux_64", "--openssldir=" + old_cur_dir + "/build/linux_64"])
|
||||
if "1" == config.option("use-clang"):
|
||||
base.replaceInFile("./Makefile", "CC=$(CROSS_COMPILE)gcc", "CC=$(CROSS_COMPILE)clang")
|
||||
@ -101,9 +99,6 @@ 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:
|
||||
if 'LD_LIBRARY_PATH' in os.environ:
|
||||
ld_library_path_copy = os.environ['LD_LIBRARY_PATH']
|
||||
os.environ['LD_LIBRARY_PATH'] = config.get_custom_sysroot_lib()
|
||||
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"))
|
||||
@ -113,11 +108,11 @@ def make():
|
||||
base.cmd("make", ["install"])
|
||||
base.cmd("make", ["clean"], True)
|
||||
else:
|
||||
base.set_sysroot_env()
|
||||
base.cmd_exe("make", [])
|
||||
base.cmd_exe("make", ["install"])
|
||||
base.cmd_exe("make", ["clean"], True)
|
||||
os.environ['LD_LIBRARY_PATH'] = ld_library_path_copy
|
||||
# TODO: support x86
|
||||
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()):
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -16,7 +16,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 +78,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")
|
||||
|
||||
@ -206,12 +213,7 @@ def make():
|
||||
"treat_warnings_as_errors=false"]
|
||||
|
||||
if config.check_option("platform", "linux_64"):
|
||||
ld_library_path_copy = ''
|
||||
if config.option("sysroot") != "":
|
||||
if 'LD_LIBRARY_PATH' in os.environ:
|
||||
ld_library_path_copy = os.environ['LD_LIBRARY_PATH']
|
||||
os.environ['LD_LIBRARY_PATH'] = config.get_custom_sysroot_lib()
|
||||
|
||||
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") + "\"]"
|
||||
base.replaceInFile("build/config/compiler/BUILD.gn", src_replace, dst_replace)
|
||||
@ -219,10 +221,16 @@ def make():
|
||||
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++\""
|
||||
base.replaceInFile("build/toolchain/linux/BUILD.gn", src_replace, dst_replace)
|
||||
|
||||
old_env = dict(os.environ)
|
||||
base.set_sysroot_env()
|
||||
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()
|
||||
else:
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_64", make_args(gn_args, "linux")], False)
|
||||
base.cmd2("ninja", ["-C", "out.gn/linux_64"], False)
|
||||
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_64", make_args(gn_args, "linux")], False)
|
||||
base.cmd2("ninja", ["-C", "out.gn/linux_64"], False)
|
||||
os.environ['LD_LIBRARY_PATH'] = ld_library_path_copy
|
||||
|
||||
if config.check_option("platform", "linux_32"):
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_32", make_args(gn_args, "linux", False)])
|
||||
|
||||
@ -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
|
||||
|
||||
@ -186,8 +186,6 @@ def make():
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/extras/projicons/" + apps_postfix + "/projicons.exe", root_dir + "/DesktopEditors.exe")
|
||||
if not isWindowsXP:
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/extras/update-daemon/" + apps_postfix + "/updatesvc.exe", root_dir + "/updatesvc.exe")
|
||||
else:
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/extras/online-installer/" + apps_postfix + "/online-installer.exe", root_dir + "/online-installer.exe")
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors.exe", root_dir + "/editors.exe")
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/res/icons/desktopeditors.ico", root_dir + "/app.ico")
|
||||
elif (0 == platform.find("linux")):
|
||||
@ -244,7 +242,7 @@ def make():
|
||||
#base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt/ui/engine/database/{9AB4BBA8-A7E5-48D5-B683-ECE76A020BB1}", root_dir + "/editors/sdkjs-plugins/{9AB4BBA8-A7E5-48D5-B683-ECE76A020BB1}")
|
||||
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "sendto", True)
|
||||
|
||||
isUseAgent = True
|
||||
isUseAgent = False
|
||||
if isWindowsXP:
|
||||
isUseAgent = False
|
||||
|
||||
@ -267,11 +265,6 @@ def make():
|
||||
else:
|
||||
base.copy_dir(git_dir + "/desktop-apps/common/loginpage/providers", root_dir + "/providers")
|
||||
|
||||
# license
|
||||
if (0 == platform.find("mac")):
|
||||
base.create_dir(root_dir + "/license")
|
||||
base.copy_file(git_dir + "/desktop-apps/common/package/license/opensource/EULA.html", root_dir + "/license/EULA.html")
|
||||
|
||||
isUseJSC = False
|
||||
if (0 == platform.find("mac")):
|
||||
doctrenderer_lib = "libdoctrenderer.dylib"
|
||||
@ -293,12 +286,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")
|
||||
@ -311,10 +304,11 @@ 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")):
|
||||
@ -325,10 +319,11 @@ def make():
|
||||
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")
|
||||
|
||||
return
|
||||
return
|
||||
@ -111,9 +111,20 @@ def check_dependencies():
|
||||
if (host_platform == 'windows'):
|
||||
checksResult.append(check_nodejs())
|
||||
|
||||
if (config.option("sql-type") == 'mysql' and host_platform == 'windows'):
|
||||
print('\n=== Database Check ===')
|
||||
sql_type = config.option("sql-type")
|
||||
print('SQL type: ' + sql_type)
|
||||
print('Host platform: ' + host_platform)
|
||||
print('DB host: ' + config.option("db-host"))
|
||||
print('DB port: ' + config.option("db-port"))
|
||||
print('DB name: ' + config.option("db-name"))
|
||||
print('DB user: ' + config.option("db-user"))
|
||||
|
||||
if (sql_type == 'mysql' and host_platform == 'windows'):
|
||||
print('\nCalling check_mysqlServer()...')
|
||||
checksResult.append(check_mysqlServer())
|
||||
else:
|
||||
print('\nCalling check_postgreSQL()...')
|
||||
checksResult.append(check_postgreSQL())
|
||||
|
||||
server_addons = []
|
||||
@ -300,9 +311,88 @@ def check_rabbitmq():
|
||||
print('RabbitMQ is installed')
|
||||
return dependence
|
||||
elif (host_platform == 'linux'):
|
||||
result = base.run_command('service rabbitmq-server status')['stdout']
|
||||
# Try service command first
|
||||
command_result = base.run_command('service rabbitmq-server status')
|
||||
result = command_result['stdout']
|
||||
|
||||
# Log command results
|
||||
print('Checking RabbitMQ with service command...')
|
||||
print('Command: service rabbitmq-server status')
|
||||
print('stdout: ' + (result if result else '[EMPTY]'))
|
||||
if command_result['stderr']:
|
||||
print('stderr: ' + command_result['stderr'])
|
||||
print('Return code: ' + str(command_result['returncode']))
|
||||
|
||||
# If service command failed or returned empty, try systemctl
|
||||
if (result == '' or command_result['returncode'] != 0):
|
||||
print('\nTrying systemctl command...')
|
||||
systemctl_result = base.run_command('systemctl status rabbitmq-server')
|
||||
print('Command: systemctl status rabbitmq-server')
|
||||
print('stdout: ' + (systemctl_result['stdout'] if systemctl_result['stdout'] else '[EMPTY]'))
|
||||
if systemctl_result['stderr']:
|
||||
print('stderr: ' + systemctl_result['stderr'])
|
||||
print('Return code: ' + str(systemctl_result['returncode']))
|
||||
|
||||
# Update result if systemctl worked
|
||||
if systemctl_result['stdout']:
|
||||
result = systemctl_result['stdout']
|
||||
command_result = systemctl_result
|
||||
|
||||
# If still no result, try direct process check
|
||||
if (result == ''):
|
||||
print('\nTrying direct process check...')
|
||||
ps_result = base.run_command('ps aux | grep -i rabbitmq | grep -v grep')
|
||||
print('Command: ps aux | grep -i rabbitmq | grep -v grep')
|
||||
print('stdout: ' + (ps_result['stdout'] if ps_result['stdout'] else '[EMPTY]'))
|
||||
print('Return code: ' + str(ps_result['returncode']))
|
||||
|
||||
# Check if rabbitmq process is running
|
||||
if ps_result['stdout']:
|
||||
result = ps_result['stdout']
|
||||
print('RabbitMQ process found: ' + result[:100] + '...' if len(result) > 100 else result)
|
||||
|
||||
# Additional diagnostic checks
|
||||
if (result == ''):
|
||||
print('\nPerforming additional diagnostic checks...')
|
||||
|
||||
# Check current user
|
||||
whoami_result = base.run_command('whoami')
|
||||
print('Current user: ' + whoami_result['stdout'])
|
||||
|
||||
# Check for RabbitMQ binaries
|
||||
which_result = base.run_command('which rabbitmqctl')
|
||||
if which_result['stdout']:
|
||||
print('RabbitMQ binary found at: ' + which_result['stdout'])
|
||||
|
||||
# Try rabbitmqctl status
|
||||
rabbitmqctl_result = base.run_command('rabbitmqctl status')
|
||||
print('\nTrying rabbitmqctl status...')
|
||||
print('stdout: ' + (rabbitmqctl_result['stdout'][:200] + '...' if len(rabbitmqctl_result['stdout']) > 200 else rabbitmqctl_result['stdout']))
|
||||
if rabbitmqctl_result['stderr']:
|
||||
print('stderr: ' + rabbitmqctl_result['stderr'])
|
||||
else:
|
||||
print('RabbitMQ binary (rabbitmqctl) not found in PATH')
|
||||
|
||||
# Check for permission issues
|
||||
if (command_result['returncode'] == 126):
|
||||
print('\nPermission denied error (code 126).')
|
||||
print('You may need to run this script with elevated privileges (sudo).')
|
||||
elif (command_result['returncode'] == 127):
|
||||
print('\nCommand not found error (code 127).')
|
||||
print('The service command may not be available or RabbitMQ may not be installed.')
|
||||
elif (command_result['returncode'] == 1):
|
||||
print('\nService command failed (code 1).')
|
||||
print('This could mean RabbitMQ service is not installed or not running.')
|
||||
|
||||
# Check common RabbitMQ installation paths
|
||||
print('\nChecking common RabbitMQ paths...')
|
||||
common_paths = ['/usr/lib/rabbitmq', '/opt/rabbitmq', '/etc/rabbitmq', '/var/lib/rabbitmq']
|
||||
for path in common_paths:
|
||||
if base.is_dir(path):
|
||||
print('Found RabbitMQ directory: ' + path)
|
||||
|
||||
if (result != ''):
|
||||
print('Installed RabbitMQ is valid')
|
||||
print('\nInstalled RabbitMQ is valid')
|
||||
return dependence
|
||||
|
||||
print('RabbitMQ not found')
|
||||
@ -512,34 +602,61 @@ def check_mysqlServer():
|
||||
base.print_info('Check MySQL Server')
|
||||
dependence = CDependencies()
|
||||
mysqlLoginSrt = get_mysqlLoginString()
|
||||
print('MySQL login string: ' + mysqlLoginSrt)
|
||||
connectionString = mysqlLoginSrt + ' -e "SHOW GLOBAL VARIABLES LIKE ' + r"'PORT';" + '"'
|
||||
print('Connection string: ' + connectionString)
|
||||
|
||||
if (host_platform != 'windows'):
|
||||
print('\nTesting MySQL connection...')
|
||||
result = os.system(mysqlLoginSrt + ' -e "exit"')
|
||||
print('Connection test result code: ' + str(result))
|
||||
|
||||
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)
|
||||
print('Port check stdout: ' + connectionResult['stdout'])
|
||||
if connectionResult['stderr']:
|
||||
print('Port check stderr: ' + connectionResult['stderr'])
|
||||
|
||||
expected_port = config.option("db-port")
|
||||
print('Expected port: ' + expected_port)
|
||||
|
||||
if (connectionResult['stdout'].find('port') != -1 and connectionResult['stdout'].find(expected_port) != -1):
|
||||
print('MySQL configuration is valid')
|
||||
dependence.sqlPath = 'mysql'
|
||||
return dependence
|
||||
else:
|
||||
print('Port not found or does not match. Found: ' + connectionResult['stdout'])
|
||||
else:
|
||||
print('MySQL connection failed with code: ' + str(result))
|
||||
print('Valid MySQL Server not found')
|
||||
dependence.append_install('MySQLServer')
|
||||
dependence.append_uninstall('mysql-server')
|
||||
return dependence
|
||||
|
||||
arrInfo = get_mysqlServersInfo()
|
||||
print('\nFound MySQL installations: ' + str(len(arrInfo)))
|
||||
for info in arrInfo:
|
||||
print('\nChecking MySQL at: ' + info['Location'])
|
||||
if (base.is_dir(info['Location']) == False):
|
||||
print('Directory does not exist, skipping...')
|
||||
continue
|
||||
|
||||
mysql_full_name = 'MySQL Server ' + info['Version'] + ' '
|
||||
mysql_bin_path = get_mysql_path_to_bin(info['Location'])
|
||||
print('MySQL bin path: ' + mysql_bin_path)
|
||||
|
||||
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):
|
||||
connectionResult = base.run_command_in_dir(mysql_bin_path, connectionString)
|
||||
print('Connection result stdout: ' + connectionResult['stdout'])
|
||||
if connectionResult['stderr']:
|
||||
print('Connection result stderr: ' + connectionResult['stderr'])
|
||||
print('Return code: ' + str(connectionResult['returncode']))
|
||||
|
||||
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. Expected port: ' + expected_port)
|
||||
# if path exists, then further removal and installation fails(according to startup statistics). it is better to fix issue manually.
|
||||
return dependence
|
||||
|
||||
@ -632,8 +749,9 @@ 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 '
|
||||
# Note: PGPASSWORD should be set as environment variable on Windows
|
||||
return 'psql -U ' + userName + ' -h localhost '
|
||||
return 'PGPASSWORD="' + config.option("db-pass") + '" psql -U ' + userName + ' -h localhost '
|
||||
def get_postgreSQLInfoByFlag(flag):
|
||||
arrInfo = []
|
||||
|
||||
@ -663,13 +781,25 @@ def check_postgreSQL():
|
||||
dependence = CDependencies()
|
||||
|
||||
postgreLoginSrt = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
print('PostgreSQL login string: ' + postgreLoginSrt)
|
||||
connectionString = postgreLoginSrt + ' -c "SELECT setting FROM pg_settings WHERE name = ' + "'port'" + ';"'
|
||||
print('Connection string: ' + connectionString)
|
||||
|
||||
if (host_platform == 'linux'):
|
||||
print('\nTesting PostgreSQL connection...')
|
||||
result = os.system(postgreLoginSrt + ' -c "\q"')
|
||||
connectionResult = base.run_command(connectionString)['stdout']
|
||||
print('Connection test result code: ' + str(result))
|
||||
|
||||
connectionResult = base.run_command(connectionString)
|
||||
print('Port check stdout: ' + connectionResult['stdout'])
|
||||
if connectionResult['stderr']:
|
||||
print('Port check stderr: ' + connectionResult['stderr'])
|
||||
print('Port check return code: ' + str(connectionResult['returncode']))
|
||||
|
||||
expected_port = config.option("db-port")
|
||||
print('Expected port: ' + expected_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')
|
||||
@ -679,19 +809,33 @@ def check_postgreSQL():
|
||||
return dependence
|
||||
|
||||
arrInfo = get_postgreSQLInfo()
|
||||
base.set_env('PGPASSWORD', config.option("db-pass"))
|
||||
print('\nFound PostgreSQL installations: ' + str(len(arrInfo)))
|
||||
db_pass = config.option("db-pass")
|
||||
print('Setting PGPASSWORD environment variable')
|
||||
base.set_env('PGPASSWORD', db_pass)
|
||||
|
||||
for info in arrInfo:
|
||||
print('\nChecking PostgreSQL at: ' + info['Location'])
|
||||
if (base.is_dir(info['Location']) == False):
|
||||
print('Directory does not exist, skipping...')
|
||||
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'])
|
||||
print('PostgreSQL bin path: ' + postgre_bin_path)
|
||||
|
||||
connectionResult = base.run_command_in_dir(postgre_bin_path, connectionString)
|
||||
print('Connection result stdout: ' + connectionResult['stdout'])
|
||||
if connectionResult['stderr']:
|
||||
print('Connection result stderr: ' + connectionResult['stderr'])
|
||||
print('Return code: ' + str(connectionResult['returncode']))
|
||||
|
||||
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(postgre_full_name + 'configuration is not valid. Expected port: ' + expected_port)
|
||||
|
||||
print('Valid PostgreSQL not found')
|
||||
|
||||
@ -704,61 +848,196 @@ def check_postgreSQL():
|
||||
return dependence
|
||||
def check_postgreConfig(postgrePath = ''):
|
||||
result = True
|
||||
base.print_info('Checking PostgreSQL configuration')
|
||||
|
||||
if (host_platform == 'windows'):
|
||||
print('Setting PGPASSWORD for Windows')
|
||||
base.set_env('PGPASSWORD', config.option("db-pass"))
|
||||
|
||||
rootUser = install_params['PostgreSQL']['root']
|
||||
dbUser = config.option("db-user")
|
||||
dbName = config.option("db-name")
|
||||
dbPass = config.option("db-pass")
|
||||
|
||||
print('Configuration:')
|
||||
print(' Root user: ' + rootUser)
|
||||
print(' DB user: ' + dbUser)
|
||||
print(' DB name: ' + dbName)
|
||||
print(' PostgreSQL path: ' + postgrePath)
|
||||
|
||||
postgre_path_to_bin = get_postrgre_path_to_bin(postgrePath)
|
||||
print(' Bin path: ' + postgre_path_to_bin)
|
||||
|
||||
postgreLoginRoot = get_postgreLoginSrting(rootUser)
|
||||
postgreLoginDbUser = get_postgreLoginSrting(dbUser)
|
||||
print(' Root login string: ' + postgreLoginRoot)
|
||||
print(' User login string: ' + postgreLoginDbUser)
|
||||
|
||||
creatdb_path = base.get_script_dir() + "/../../server/schema/postgresql/createdb.sql"
|
||||
print(' CreateDB script path: ' + creatdb_path)
|
||||
if base.is_file(creatdb_path):
|
||||
print(' CreateDB script exists: YES')
|
||||
else:
|
||||
print(' CreateDB script exists: NO - THIS IS A PROBLEM!')
|
||||
|
||||
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + ' -c "\du ' + dbUser + '"')['stdout'].find(dbUser) != -1):
|
||||
print('User ' + dbUser + ' is exist')
|
||||
if (os.system(postgreLoginDbUser + '-c "\q"') != 0):
|
||||
print('\nChecking if user exists...')
|
||||
check_user_cmd = postgreLoginRoot + ' -c "\du ' + dbUser + '"'
|
||||
user_check_result = base.run_command_in_dir(postgre_path_to_bin, check_user_cmd)
|
||||
print('User check command: ' + check_user_cmd)
|
||||
print('User check stdout: ' + user_check_result['stdout'])
|
||||
if user_check_result['stderr']:
|
||||
print('User check stderr: ' + user_check_result['stderr'])
|
||||
|
||||
if (user_check_result['stdout'].find(dbUser) != -1):
|
||||
print('User ' + dbUser + ' exists')
|
||||
print('\nTesting user password...')
|
||||
password_test_result = os.system(postgreLoginDbUser + '-c "\q"')
|
||||
print('Password test result code: ' + str(password_test_result))
|
||||
|
||||
if (password_test_result != 0):
|
||||
print('Invalid user password!')
|
||||
base.print_info('Changing password...')
|
||||
result = change_userPass(dbUser, dbPass, postgre_path_to_bin) and result
|
||||
print('Password change result: ' + str(result))
|
||||
else:
|
||||
print('User ' + dbUser + ' not exist!')
|
||||
base.print_info('Creating ' + dbName + ' user...')
|
||||
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('\nChecking if database exists...')
|
||||
db_check_cmd = postgreLoginRoot + ' -c "SELECT datname FROM pg_database;"'
|
||||
db_check_result = base.run_command_in_dir(postgre_path_to_bin, db_check_cmd)
|
||||
print('Database check command: ' + db_check_cmd)
|
||||
print('Database check stdout: ' + db_check_result['stdout'])
|
||||
if db_check_result['stderr']:
|
||||
print('Database check stderr: ' + db_check_result['stderr'])
|
||||
|
||||
if (db_check_result['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)
|
||||
create_result = create_postgreDb(dbName, postgre_path_to_bin)
|
||||
print('Database creation result: ' + str(create_result))
|
||||
|
||||
if create_result:
|
||||
# Give user rights to database and schema
|
||||
print('\nGranting database privileges to user ' + dbUser + '...')
|
||||
db_grant_cmd = postgreLoginRoot + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + dbUser + ';"'
|
||||
db_grant_result = base.run_command_in_dir(postgre_path_to_bin, db_grant_cmd)
|
||||
print('Database grant result: ' + str(db_grant_result['returncode']))
|
||||
|
||||
print('Granting schema privileges to user ' + dbUser + '...')
|
||||
schema_cmd = postgreLoginRoot + '-d ' + dbName + ' -c "GRANT ALL ON SCHEMA public TO ' + dbUser + ';"'
|
||||
schema_result = base.run_command_in_dir(postgre_path_to_bin, schema_cmd)
|
||||
print('Schema grant result: ' + str(schema_result['returncode']))
|
||||
|
||||
print('\nConfiguring database with createdb.sql...')
|
||||
configure_result = configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
|
||||
print('Database configuration result: ' + str(configure_result))
|
||||
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')
|
||||
print('Database ' + dbName + ' exists')
|
||||
# Simple check: if 0 tables, configure database
|
||||
print('Checking tables in database...')
|
||||
table_count_result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "SELECT count(*) FROM information_schema.tables WHERE table_schema = \'public\';"')
|
||||
print('Table count result: ' + table_count_result['stdout'].strip())
|
||||
|
||||
if table_count_result['stdout'].find(' 0') != -1:
|
||||
print('Database ' + dbName + ' has no tables - configuring...')
|
||||
else:
|
||||
print('Database ' + dbName + ' has tables - checking ownership...')
|
||||
# Check if tables belong to postgres instead of onlyoffice user
|
||||
owner_check = base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-d ' + dbName + ' -c "\dt"')
|
||||
if owner_check['stdout'].find('postgres') != -1 and owner_check['stdout'].find(dbUser) == -1:
|
||||
print('Tables belong to postgres, not ' + dbUser + ' - need to recreate')
|
||||
print('Dropping existing tables...')
|
||||
drop_result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-d ' + dbName + ' -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"')
|
||||
print('Schema recreation result: ' + str(drop_result['returncode']))
|
||||
print('Will proceed to recreate tables with correct owner...')
|
||||
else:
|
||||
print('Database ' + dbUser + ' already has correct tables - skipping configuration')
|
||||
return result
|
||||
|
||||
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')
|
||||
# Configure database (either empty or after recreation)
|
||||
print('Granting database privileges to user ' + dbUser + '...')
|
||||
db_grant_cmd = postgreLoginRoot + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + dbUser + ';"'
|
||||
db_grant_result = base.run_command_in_dir(postgre_path_to_bin, db_grant_cmd)
|
||||
print('Database grant result: ' + str(db_grant_result['returncode']))
|
||||
|
||||
print('Granting schema privileges to user ' + dbUser + '...')
|
||||
schema_cmd = postgreLoginRoot + '-d ' + dbName + ' -c "GRANT ALL ON SCHEMA public TO ' + dbUser + ';"'
|
||||
schema_result = base.run_command_in_dir(postgre_path_to_bin, schema_cmd)
|
||||
print('Schema grant result: ' + str(schema_result['returncode']))
|
||||
|
||||
base.print_info('Configuring ' + dbName + ' database...')
|
||||
configure_result = configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
|
||||
print('Configuration completed: ' + ('SUCCESS' if configure_result else 'FAILED'))
|
||||
result = configure_result and result
|
||||
|
||||
# User privileges are set above when configuring database
|
||||
|
||||
print('\n=== PostgreSQL Configuration Summary ===')
|
||||
print('Database: ' + dbName + ' - ' + ('READY' if result else 'FAILED'))
|
||||
print('User: ' + dbUser + ' - configured')
|
||||
|
||||
return result
|
||||
def create_postgreDb(dbName, postgre_path_to_bin = ''):
|
||||
print('\nCreating database: ' + dbName)
|
||||
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"') != 0):
|
||||
create_cmd = postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"'
|
||||
print('Create database command: ' + create_cmd)
|
||||
|
||||
result = base.run_command_in_dir(postgre_path_to_bin, create_cmd)
|
||||
print('Create database return code: ' + str(result['returncode']))
|
||||
if result['stdout']:
|
||||
print('Create database stdout: ' + result['stdout'])
|
||||
if result['stderr']:
|
||||
print('Create database stderr: ' + result['stderr'])
|
||||
|
||||
if (result['returncode'] != 0):
|
||||
print('Database creation FAILED!')
|
||||
return False
|
||||
|
||||
print('Database created successfully')
|
||||
return True
|
||||
def set_dbPrivilegesForUser(userName, dbName, postgre_path_to_bin = ''):
|
||||
print('\nSetting database privileges for user: ' + userName)
|
||||
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):
|
||||
grant_cmd = postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"'
|
||||
print('Grant command: ' + grant_cmd)
|
||||
|
||||
result = base.run_command_in_dir(postgre_path_to_bin, grant_cmd)
|
||||
print('Grant return code: ' + str(result['returncode']))
|
||||
if result['stdout']:
|
||||
print('Grant stdout: ' + result['stdout'])
|
||||
if result['stderr']:
|
||||
print('Grant stderr: ' + result['stderr'])
|
||||
|
||||
if (result['returncode'] != 0):
|
||||
print('Grant privileges FAILED!')
|
||||
return False
|
||||
|
||||
print('Privileges granted successfully')
|
||||
return True
|
||||
def create_postgreUser(userName, userPass, postgre_path_to_bin = ''):
|
||||
print('\nCreating user: ' + userName)
|
||||
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):
|
||||
create_cmd = postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"'
|
||||
print('Create user command: ' + create_cmd[:50] + '... [password hidden]')
|
||||
|
||||
result = base.run_command_in_dir(postgre_path_to_bin, create_cmd)
|
||||
print('Create user return code: ' + str(result['returncode']))
|
||||
if result['stdout']:
|
||||
print('Create user stdout: ' + result['stdout'])
|
||||
if result['stderr']:
|
||||
print('Create user stderr: ' + result['stderr'])
|
||||
|
||||
if (result['returncode'] != 0):
|
||||
print('User creation FAILED!')
|
||||
return False
|
||||
|
||||
print('User created successfully')
|
||||
return True
|
||||
def change_userPass(userName, userPass, postgre_path_to_bin = ''):
|
||||
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
@ -766,14 +1045,68 @@ 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('\n=== Configuring Database ===')
|
||||
print('Script path: ' + scriptPath)
|
||||
print('User: ' + userName)
|
||||
print('Database: ' + dbName)
|
||||
print('Bin path: ' + postgre_path_to_bin)
|
||||
|
||||
# Check if script exists
|
||||
if not base.is_file(scriptPath):
|
||||
print('ERROR: Script file does not exist: ' + scriptPath)
|
||||
return False
|
||||
print('Execution completed')
|
||||
|
||||
print('Script file size: ' + str(os.path.getsize(scriptPath)) + ' bytes')
|
||||
|
||||
postgreLoginSrt = get_postgreLoginSrting(userName)
|
||||
print('Login string: ' + postgreLoginSrt)
|
||||
|
||||
full_command = postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"'
|
||||
print('Full command: ' + full_command)
|
||||
|
||||
print('\nExecuting createdb.sql script...')
|
||||
|
||||
# Use run_command_in_dir instead of exec_command_in_dir to capture output
|
||||
result = base.run_command_in_dir(postgre_path_to_bin, full_command)
|
||||
code = result['returncode']
|
||||
|
||||
print('Execution return code: ' + str(code))
|
||||
if result['stdout']:
|
||||
print('Script output:\n' + result['stdout'])
|
||||
if result['stderr']:
|
||||
print('Script errors:\n' + result['stderr'])
|
||||
|
||||
if (code != 0):
|
||||
print('Execution FAILED! Return code: ' + str(code))
|
||||
|
||||
# Try to get more info about the failure
|
||||
print('\nTrying to connect and check database...')
|
||||
test_cmd = postgreLoginSrt + ' -d ' + dbName + ' -c "SELECT version();"'
|
||||
test_result = base.run_command_in_dir(postgre_path_to_bin, test_cmd)
|
||||
print('Connection test stdout: ' + test_result['stdout'])
|
||||
if test_result['stderr']:
|
||||
print('Connection test stderr: ' + test_result['stderr'])
|
||||
|
||||
return False
|
||||
|
||||
print('Execution completed successfully!')
|
||||
|
||||
# Verify tables were created
|
||||
print('\nVerifying table creation...')
|
||||
verify_cmd = postgreLoginSrt + ' -d ' + dbName + ' -c "\dt;"'
|
||||
verify_result = base.run_command_in_dir(postgre_path_to_bin, verify_cmd)
|
||||
|
||||
# Count lines with table names (skip header)
|
||||
table_lines = [line for line in verify_result['stdout'].split('\n') if '|' in line and 'table' in line.lower()]
|
||||
table_count = len(table_lines)
|
||||
|
||||
if table_count > 0:
|
||||
print('SUCCESS: Created ' + str(table_count) + ' tables')
|
||||
print('Database is ready for use!')
|
||||
else:
|
||||
print('WARNING: No tables found after script execution')
|
||||
print(verify_result['stdout'])
|
||||
|
||||
return True
|
||||
def uninstall_postgresql():
|
||||
code = os.system('sudo DEBIAN_FRONTEND=noninteractive apt-get purge --auto-remove postgresql* -y')
|
||||
|
||||
@ -75,9 +75,6 @@ def make_windows():
|
||||
make_prepare("xp")
|
||||
make_zip("xp")
|
||||
make_inno("xp")
|
||||
# Disable build online installer
|
||||
# if common.platform == "windows_x86_xp":
|
||||
# make_online()
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
@ -169,18 +166,6 @@ def make_advinst(edition = "opensource"):
|
||||
utils.set_summary("desktop advinst " + edition + " deploy", ret)
|
||||
return
|
||||
|
||||
def make_online():
|
||||
online_file = utils.glob_file("OnlineInstaller-" + package_version + "*.exe")
|
||||
utils.log_h2("desktop online installer build")
|
||||
ret = utils.is_file(online_file)
|
||||
utils.set_summary("desktop online installer build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("desktop online installer deploy")
|
||||
ret = s3_upload([online_file], "desktop/win/online/")
|
||||
utils.set_summary("desktop online installer deploy", ret)
|
||||
return
|
||||
|
||||
#
|
||||
# macOS
|
||||
#
|
||||
|
||||
@ -101,9 +101,7 @@ def make(platform, project, qmake_config_addon="", is_no_errors=False):
|
||||
build_params.append("-spec")
|
||||
build_params.append("linux-clang-libc++")
|
||||
if "" != config.option("sysroot"):
|
||||
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"
|
||||
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)
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -54,6 +54,7 @@ def download_sysroot():
|
||||
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:
|
||||
|
||||
5
tools/win/qemu/.gitignore
vendored
Normal file
5
tools/win/qemu/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
*
|
||||
!.gitignore
|
||||
!README.md
|
||||
!automate.bat
|
||||
!start.bat
|
||||
102
tools/win/qemu/README.md
Normal file
102
tools/win/qemu/README.md
Normal 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 it’s 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.
|
||||
52
tools/win/qemu/automate.bat
Normal file
52
tools/win/qemu/automate.bat
Normal 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
17
tools/win/qemu/start.bat
Normal 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
|
||||
Reference in New Issue
Block a user