mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
Compare commits
12 Commits
v99.99.99.
...
feature/li
| Author | SHA1 | Date | |
|---|---|---|---|
| 9df7f6e290 | |||
| 88c57a8b80 | |||
| 435c878e9c | |||
| d1d3d18ff7 | |||
| 63499a9023 | |||
| 73abede467 | |||
| c7adedec3a | |||
| 6d95071a76 | |||
| 089bba3b84 | |||
| a69ca88a5a | |||
| 2a6ff76fb4 | |||
| a155a9ae8d |
11
Dockerfile
11
Dockerfile
@ -1,24 +1,13 @@
|
||||
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
|
||||
|
||||
|
||||
@ -43,7 +43,6 @@ 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)
|
||||
|
||||
@ -37,7 +37,7 @@ def is_os_64bit():
|
||||
return platform.machine().endswith('64')
|
||||
|
||||
def is_os_arm():
|
||||
if -1 == platform.machine().lower().find('arm'):
|
||||
if -1 == platform.machine().find('arm'):
|
||||
return False
|
||||
return True
|
||||
|
||||
@ -1894,6 +1894,8 @@ def set_sysroot_env():
|
||||
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")
|
||||
@ -1970,43 +1972,13 @@ 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
|
||||
|
||||
@ -26,6 +26,7 @@ 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"):
|
||||
@ -55,6 +56,7 @@ def make():
|
||||
googletest.make()
|
||||
oo_brotli.make()
|
||||
heif.make()
|
||||
webp.make()
|
||||
|
||||
if config.check_option("build-libvlc", "1"):
|
||||
libvlc.make()
|
||||
|
||||
@ -8,11 +8,6 @@ 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:]):
|
||||
@ -30,12 +25,6 @@ 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"])
|
||||
@ -48,7 +37,6 @@ 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"
|
||||
|
||||
@ -235,7 +235,8 @@ def make_xp():
|
||||
base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64")
|
||||
|
||||
# old variant
|
||||
path_to_python2 = "/depot_tools/bootstrap-2@3_11_8_chromium_35_bin/python/bin"
|
||||
#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"
|
||||
os.environ["PATH"] = os.pathsep.join([base_dir + "/depot_tools",
|
||||
base_dir + path_to_python2,
|
||||
config.option("vs-path") + "/../Common7/IDE",
|
||||
|
||||
@ -7,25 +7,6 @@ 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"
|
||||
@ -35,11 +16,7 @@ def change_bootstrap():
|
||||
content += "infra/3pp/tools/cpython/${platform} version:2@2.7.18.chromium.39\n\n"
|
||||
|
||||
content += "@Subdir python3\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 += "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"
|
||||
@ -97,9 +74,6 @@ 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")
|
||||
|
||||
@ -168,8 +142,6 @@ def make():
|
||||
if not base.is_dir(base_dir):
|
||||
base.create_dir(base_dir)
|
||||
|
||||
base.common_check_version("v8", "1", clean)
|
||||
|
||||
if ("mac" == base.host_platform()):
|
||||
base.cmd("git", ["config", "--global", "http.postBuffer", "157286400"], True)
|
||||
|
||||
|
||||
208
scripts/core_common/modules/webp.py
Normal file
208
scripts/core_common/modules/webp.py
Normal file
@ -0,0 +1,208 @@
|
||||
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
|
||||
@ -22,6 +22,4 @@ 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
|
||||
|
||||
@ -245,8 +245,6 @@ 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"
|
||||
@ -288,12 +286,12 @@ def make():
|
||||
|
||||
is_host_not_arm = False
|
||||
host_platform = ""
|
||||
|
||||
# TODO: fix this on mac_arm64 (qemu)
|
||||
# on windows we are using qemu
|
||||
if (platform == "mac_arm64") and not base.is_os_arm():
|
||||
if (platform == "mac_arm64" or platform == "win_arm64") and not base.is_os_arm():
|
||||
is_host_not_arm = True
|
||||
host_platform = "mac_64"
|
||||
if platform == "mac_arm64":
|
||||
host_platform = "mac_64"
|
||||
elif platform == "win_arm64":
|
||||
host_platform = "win_64"
|
||||
|
||||
# all themes generate ----
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "allfontsgen")
|
||||
@ -306,11 +304,10 @@ def make():
|
||||
|
||||
if is_host_not_arm:
|
||||
sdkjs_dir = root_dir + "/editors/sdkjs"
|
||||
str1 = "/" + platform + "/"
|
||||
str2 = "/" + host_platform + "/"
|
||||
sdkjs_dir_host = sdkjs_dir.replace(str1, str2)
|
||||
end_find_platform = sdkjs_dir.rfind("/" + platform + "/")
|
||||
sdkjs_dir_64 = sdkjs_dir[0:end_find_platform] + "/" + host_platform + "/" + sdkjs_dir[end_find_platform+11:]
|
||||
base.delete_dir(sdkjs_dir)
|
||||
base.copy_dir(sdkjs_dir_host, sdkjs_dir)
|
||||
base.copy_dir(sdkjs_dir_64, sdkjs_dir)
|
||||
else:
|
||||
themes_params = []
|
||||
if ("" != config.option("themesparams")):
|
||||
@ -321,11 +318,10 @@ def make():
|
||||
base.delete_file(root_dir + "/converter/font_selection.bin")
|
||||
base.delete_file(root_dir + "/converter/fonts.log")
|
||||
|
||||
if not base.is_use_create_artifacts_qemu(platform):
|
||||
base.delete_exe(root_dir + "/converter/allfontsgen")
|
||||
base.delete_exe(root_dir + "/converter/allthemesgen")
|
||||
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,8 +111,7 @@ def check_dependencies():
|
||||
if (host_platform == 'windows'):
|
||||
checksResult.append(check_nodejs())
|
||||
|
||||
sql_type = config.option("sql-type")
|
||||
if (sql_type == 'mysql' and host_platform == 'windows'):
|
||||
if (config.option("sql-type") == 'mysql' and host_platform == 'windows'):
|
||||
checksResult.append(check_mysqlServer())
|
||||
else:
|
||||
checksResult.append(check_postgreSQL())
|
||||
@ -301,21 +300,9 @@ def check_rabbitmq():
|
||||
print('RabbitMQ is installed')
|
||||
return dependence
|
||||
elif (host_platform == 'linux'):
|
||||
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')
|
||||
result = base.run_command('service rabbitmq-server status')['stdout']
|
||||
if (result != ''):
|
||||
print('Installed RabbitMQ is valid')
|
||||
return dependence
|
||||
|
||||
print('RabbitMQ not found')
|
||||
@ -530,9 +517,8 @@ def check_mysqlServer():
|
||||
if (host_platform != 'windows'):
|
||||
result = os.system(mysqlLoginSrt + ' -e "exit"')
|
||||
if (result == 0):
|
||||
connectionResult = base.run_command(connectionString)
|
||||
expected_port = config.option("db-port")
|
||||
if (connectionResult['stdout'].find('port') != -1 and connectionResult['stdout'].find(expected_port) != -1):
|
||||
connectionResult = base.run_command(connectionString)['stdout']
|
||||
if (connectionResult.find('port') != -1 and connectionResult.find(config.option("db-port")) != -1):
|
||||
print('MySQL configuration is valid')
|
||||
dependence.sqlPath = 'mysql'
|
||||
return dependence
|
||||
@ -547,15 +533,13 @@ def check_mysqlServer():
|
||||
continue
|
||||
|
||||
mysql_full_name = 'MySQL Server ' + info['Version'] + ' '
|
||||
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):
|
||||
|
||||
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):
|
||||
print(mysql_full_name + 'configuration is valid')
|
||||
dependence.sqlPath = info['Location']
|
||||
return dependence
|
||||
print(mysql_full_name + 'configuration is not valid')
|
||||
print(mysql_full_name + 'configuration is not valid:' + connectionResult)
|
||||
# if path exists, then further removal and installation fails(according to startup statistics). it is better to fix issue manually.
|
||||
return dependence
|
||||
|
||||
@ -648,8 +632,8 @@ def get_postrgre_path_to_bin(postgrePath = ''):
|
||||
return postgrePath
|
||||
def get_postgreLoginSrting(userName):
|
||||
if (host_platform == 'windows'):
|
||||
return 'psql -U ' + userName + ' -h localhost '
|
||||
return 'PGPASSWORD="' + config.option("db-pass") + '" psql -U ' + userName + ' -h localhost '
|
||||
return 'psql -U' + userName + ' '
|
||||
return 'PGPASSWORD="' + config.option("db-pass") + '" psql -U' + userName + ' -hlocalhost '
|
||||
def get_postgreSQLInfoByFlag(flag):
|
||||
arrInfo = []
|
||||
|
||||
@ -683,10 +667,9 @@ def check_postgreSQL():
|
||||
|
||||
if (host_platform == 'linux'):
|
||||
result = os.system(postgreLoginSrt + ' -c "\q"')
|
||||
connectionResult = base.run_command(connectionString)
|
||||
expected_port = config.option("db-port")
|
||||
connectionResult = base.run_command(connectionString)['stdout']
|
||||
|
||||
if (result != 0 or connectionResult['stdout'].find(expected_port) == -1):
|
||||
if (result != 0 or connectionResult.find(config.option("db-port")) == -1):
|
||||
print('Valid PostgreSQL not found!')
|
||||
dependence.append_install('PostgreSQL')
|
||||
dependence.append_uninstall('PostgreSQL')
|
||||
@ -697,20 +680,18 @@ 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] + ' '
|
||||
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):
|
||||
connectionResult = base.run_command_in_dir(get_postrgre_path_to_bin(info['Location']), connectionString)['stdout']
|
||||
|
||||
if (connectionResult.find(config.option("db-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')
|
||||
|
||||
@ -723,8 +704,6 @@ 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"))
|
||||
|
||||
@ -732,78 +711,53 @@ 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"
|
||||
|
||||
# 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 (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('Invalid user password, changing...')
|
||||
print('Invalid user password!')
|
||||
base.print_info('Changing password...')
|
||||
result = change_userPass(dbUser, dbPass, postgre_path_to_bin) and result
|
||||
else:
|
||||
print('Creating user ' + dbUser + '...')
|
||||
print('User ' + dbUser + ' not exist!')
|
||||
base.print_info('Creating ' + dbName + ' user...')
|
||||
result = create_postgreUser(dbUser, dbPass, postgre_path_to_bin) and result
|
||||
|
||||
# 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
|
||||
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)
|
||||
else:
|
||||
# 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
|
||||
|
||||
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')
|
||||
|
||||
return result
|
||||
def create_postgreDb(dbName, postgre_path_to_bin = ''):
|
||||
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"')
|
||||
if (result['returncode'] != 0):
|
||||
print('Database creation failed!')
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"') != 0):
|
||||
return False
|
||||
return True
|
||||
def set_dbPrivilegesForUser(userName, dbName, postgre_path_to_bin = ''):
|
||||
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
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!')
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"') != 0):
|
||||
return False
|
||||
return True
|
||||
def create_postgreUser(userName, userPass, postgre_path_to_bin = ''):
|
||||
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
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!')
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"') != 0):
|
||||
return False
|
||||
return True
|
||||
def change_userPass(userName, userPass, postgre_path_to_bin = ''):
|
||||
@ -812,24 +766,13 @@ def change_userPass(userName, userPass, postgre_path_to_bin = ''):
|
||||
return False
|
||||
return True
|
||||
def configureDb(userName, dbName, scriptPath, postgre_path_to_bin = ''):
|
||||
print('Executing ' + scriptPath)
|
||||
|
||||
if not base.is_file(scriptPath):
|
||||
print('ERROR: Script file does not exist!')
|
||||
return False
|
||||
|
||||
print('Execution ' + scriptPath)
|
||||
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):
|
||||
|
||||
code = base.exec_command_in_dir(postgre_path_to_bin, postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"')
|
||||
if (code != 0):
|
||||
print('Execution failed!')
|
||||
if result['stderr']:
|
||||
print('Error: ' + result['stderr'])
|
||||
return False
|
||||
|
||||
print('Execution completed')
|
||||
return True
|
||||
def uninstall_postgresql():
|
||||
|
||||
@ -131,8 +131,6 @@ 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:
|
||||
|
||||
@ -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_arm64": "mac_arm64",
|
||||
"darwin_x86_64": "mac_64",
|
||||
"darwin_arm64": "mac_arm64",
|
||||
"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"
|
||||
|
||||
@ -44,8 +44,7 @@ def make_windows():
|
||||
"windows_x64": "x64",
|
||||
"windows_x64_xp": "x64",
|
||||
"windows_x86": "x86",
|
||||
"windows_x86_xp": "x86",
|
||||
"windows_arm64": "arm64"
|
||||
"windows_x86_xp": "x86"
|
||||
}[common.platform]
|
||||
xp = common.platform.endswith("_xp")
|
||||
|
||||
@ -62,17 +61,16 @@ def make_windows():
|
||||
if not xp:
|
||||
make_prepare()
|
||||
make_zip()
|
||||
make_inno()
|
||||
if branding.onlyoffice:
|
||||
make_inno()
|
||||
make_inno("standalone")
|
||||
if arch != "arm64":
|
||||
make_inno("update")
|
||||
make_advinst()
|
||||
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")
|
||||
@ -85,8 +83,7 @@ def make_prepare(edition = "opensource"):
|
||||
args = [
|
||||
"-Version", package_version,
|
||||
"-Arch", arch,
|
||||
"-Target", edition,
|
||||
"-CompanyName", branding.company_name
|
||||
"-Target", edition
|
||||
]
|
||||
if common.sign:
|
||||
args += ["-Sign"]
|
||||
@ -104,8 +101,7 @@ def make_zip(edition = "opensource"):
|
||||
args = [
|
||||
"-Version", package_version,
|
||||
"-Arch", arch,
|
||||
"-Target", edition,
|
||||
"-CompanyName", branding.company_name
|
||||
"-Target", edition
|
||||
]
|
||||
# if common.sign:
|
||||
# args += ["-Sign"]
|
||||
@ -333,9 +329,7 @@ def make_linux():
|
||||
if common.deploy:
|
||||
for t in branding.desktop_make_targets:
|
||||
utils.log_h2("desktop " + edition + " " + t["make"] + " deploy")
|
||||
ret = s3_upload(
|
||||
[i for i in utils.glob_path(t["src"]) if "enterprise-help" not in i],
|
||||
t["dst"])
|
||||
ret = s3_upload(utils.glob_path(t["src"]), t["dst"])
|
||||
utils.set_summary("desktop " + edition + " " + t["make"] + " deploy", ret)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
|
||||
@ -100,15 +100,11 @@ 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"):
|
||||
os.environ['QMAKE_CUSTOM_SYSROOT'] = config.option("sysroot")
|
||||
os.environ['PKG_CONFIG_PATH'] = config.get_custom_sysroot_lib() + "/pkgconfig"
|
||||
|
||||
base.cmd_exe(qmake_app, build_params)
|
||||
|
||||
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)
|
||||
|
||||
base.correct_makefile_after_qmake(platform, makefile)
|
||||
if ("1" == config.option("clean")):
|
||||
|
||||
@ -5,8 +5,7 @@ import argparse
|
||||
import re
|
||||
import platform
|
||||
|
||||
script_path = os.path.abspath(__file__)
|
||||
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
|
||||
root = '../../../../..'
|
||||
|
||||
# Configuration files
|
||||
configs = [
|
||||
@ -24,8 +23,6 @@ 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,10 +13,6 @@ 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()
|
||||
|
||||
@ -554,8 +550,6 @@ 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)
|
||||
@ -582,7 +576,7 @@ if __name__ == "__main__":
|
||||
type=str,
|
||||
help="Destination directory for the generated documentation",
|
||||
nargs='?', # Indicates the argument is optional
|
||||
default=f"{root}/api.onlyoffice.com/site/docs/office-api/usage-api/" # Default value
|
||||
default="../../../../../api.onlyoffice.com/site/docs/office-api/usage-api/" # Default value
|
||||
)
|
||||
args = parser.parse_args()
|
||||
generate(args.destination)
|
||||
|
||||
@ -21,9 +21,7 @@ editors_names = {
|
||||
"forms": "Forms"
|
||||
}
|
||||
|
||||
script_path = os.path.abspath(__file__)
|
||||
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
|
||||
|
||||
root = '../../../../..'
|
||||
missing_examples = []
|
||||
|
||||
def load_json(file_path):
|
||||
@ -201,8 +199,6 @@ 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)
|
||||
@ -232,7 +228,7 @@ if __name__ == "__main__":
|
||||
type=str,
|
||||
help="Destination directory for the generated documentation",
|
||||
nargs='?', # Indicates the argument is optional
|
||||
default=f"{root}/office-js-api/dataset" # Default value
|
||||
default="../../../../../office-js-api/dataset" # Default value
|
||||
)
|
||||
parser.add_argument(
|
||||
"model",
|
||||
|
||||
@ -13,12 +13,9 @@ configs = [
|
||||
"./config/events/forms.json"
|
||||
]
|
||||
|
||||
script_path = os.path.abspath(__file__)
|
||||
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
|
||||
root = '../../../../..'
|
||||
|
||||
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,9 +14,6 @@ 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()
|
||||
|
||||
@ -375,8 +372,6 @@ 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')
|
||||
@ -396,7 +391,7 @@ if __name__ == "__main__":
|
||||
parser.add_argument(
|
||||
"destination",
|
||||
nargs="?",
|
||||
default=f"{root}/api.onlyoffice.com/site/docs/plugin-and-macros/interacting-with-editors/",
|
||||
default="../../../../../api.onlyoffice.com/site/docs/plugin-and-macros/interacting-with-editors/",
|
||||
help="Output directory"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
@ -13,12 +13,9 @@ configs = [
|
||||
"./config/methods/forms.json"
|
||||
]
|
||||
|
||||
script_path = os.path.abspath(__file__)
|
||||
root = os.path.abspath(os.path.join(os.path.dirname(script_path), '../../../../..'))
|
||||
root = '../../../../..'
|
||||
|
||||
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,9 +13,6 @@ 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()
|
||||
|
||||
@ -617,8 +614,6 @@ 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] == '/':
|
||||
@ -642,7 +637,7 @@ if __name__ == "__main__":
|
||||
type=str,
|
||||
help="Destination directory for the generated documentation",
|
||||
nargs='?', # Indicates the argument is optional
|
||||
default=f"{root}/api.onlyoffice.com/site/docs/plugin-and-macros/interacting-with-editors/" # Default value
|
||||
default="../../../../../api.onlyoffice.com/site/docs/plugin-and-macros/interacting-with-editors/" # Default value
|
||||
)
|
||||
args = parser.parse_args()
|
||||
generate(args.destination)
|
||||
|
||||
@ -43,8 +43,7 @@ def install_deps():
|
||||
"libncurses6",
|
||||
"curl",
|
||||
"libxkbcommon-dev",
|
||||
"libxkbcommon-x11-dev",
|
||||
"libnotify-dev"]
|
||||
"libxkbcommon-x11-dev"]
|
||||
|
||||
for package in packages:
|
||||
base.cmd("sudo", ["apt-get", "install", "-y", package], True)
|
||||
|
||||
5
tools/win/qemu/.gitignore
vendored
5
tools/win/qemu/.gitignore
vendored
@ -1,5 +0,0 @@
|
||||
*
|
||||
!.gitignore
|
||||
!README.md
|
||||
!automate.bat
|
||||
!start.bat
|
||||
@ -1,102 +0,0 @@
|
||||
# **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.
|
||||
@ -1,52 +0,0 @@
|
||||
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
|
||||
@ -1,17 +0,0 @@
|
||||
@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