mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-02-10 20:45:38 +08:00
Merge branch 'release/v9.1.0' into develop
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -7,6 +7,7 @@ config
|
||||
*.*~
|
||||
**~
|
||||
*.DS_Store
|
||||
.idea
|
||||
scripts/license_checker/reports
|
||||
tests/puppeteer/node_modules
|
||||
tests/puppeteer/work_directory
|
||||
@ -14,3 +15,6 @@ tests/puppeteer/package.json
|
||||
tests/puppeteer/package-lock.json
|
||||
scripts/sdkjs_common/jsdoc/node_modules
|
||||
scripts/sdkjs_common/jsdoc/package-lock.json
|
||||
tools/linux/python3/
|
||||
tools/linux/python3.tar.gz
|
||||
tools/linux/sysroot/sysroot_ubuntu_1604
|
||||
|
||||
@ -5,13 +5,15 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN apt-get -y update && \
|
||||
apt-get -y install tar \
|
||||
sudo
|
||||
sudo \
|
||||
wget
|
||||
|
||||
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}"
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ parser.add_option("--clean", action="store", type="string", dest="clean", defaul
|
||||
parser.add_option("--module", action="store", type="string", dest="module", default="builder", help="defines what modules to build. You can specify several of them, e.g. --module 'core desktop builder server mobile'")
|
||||
parser.add_option("--develop", action="store", type="string", dest="develop", default="0", help="defines develop mode")
|
||||
parser.add_option("--beta", action="store", type="string", dest="beta", default="0", help="defines beta mode")
|
||||
parser.add_option("--platform", action="store", type="string", dest="platform", default="native", help="defines the destination platform for your build ['win_64', 'win_32', 'win_64_xp', 'win_32_xp', 'linux_64', 'linux_32', 'mac_64', 'ios', 'android_arm64_v8a', 'android_armv7', 'android_x86', 'android_x86_64'; combinations: 'native': your current system (windows/linux/mac only); 'all': all available systems; 'windows': win_64 win_32 win_64_xp win_32_xp; 'linux': linux_64 linux_32; 'mac': mac_64; 'android': android_arm64_v8a android_armv7 android_x86 android_x86_64]")
|
||||
parser.add_option("--platform", action="store", type="string", dest="platform", default="native", help="defines the destination platform for your build ['win_64', 'win_32', 'win_64_xp', 'win_32_xp', 'win_arm64', 'linux_64', 'linux_32', 'mac_64', 'ios', 'android_arm64_v8a', 'android_armv7', 'android_x86', 'android_x86_64'; combinations: 'native': your current system (windows/linux/mac only); 'all': all available systems; 'windows': win_64 win_32 win_64_xp win_32_xp; 'linux': linux_64 linux_32; 'mac': mac_64; 'android': android_arm64_v8a android_armv7 android_x86 android_x86_64]")
|
||||
parser.add_option("--config", action="store", type="string", dest="config", default="", help="provides ability to specify additional parameters for qmake")
|
||||
parser.add_option("--qt-dir", action="store", type="string", dest="qt-dir", default="", help="defines qmake directory path. qmake can be found in qt-dir/compiler/bin directory")
|
||||
parser.add_option("--qt-dir-xp", action="store", type="string", dest="qt-dir-xp", default="", help="defines qmake directory path for Windows XP. qmake can be found in 'qt-dir/compiler/bin directory")
|
||||
@ -42,6 +42,7 @@ parser.add_option("--vs-version", action="store", type="string", dest="vs-versio
|
||||
parser.add_option("--vs-path", action="store", type="string", dest="vs-path", default="", help="path to vcvarsall")
|
||||
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")
|
||||
|
||||
(options, args) = parser.parse_args(arguments)
|
||||
configOptions = vars(options)
|
||||
|
||||
3
make.py
3
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__)
|
||||
|
||||
|
||||
303
scripts/base.py
303
scripts/base.py
@ -15,6 +15,8 @@ import stat
|
||||
import json
|
||||
|
||||
__file__script__path__ = os.path.dirname( os.path.realpath(__file__))
|
||||
icu_ver = "74"
|
||||
icu_ver_old = "58" # for win_xp support
|
||||
|
||||
# common functions --------------------------------------
|
||||
def get_script_dir(file=""):
|
||||
@ -72,7 +74,7 @@ def check_build_version(dir):
|
||||
version_number = version_number.replace("\n", "")
|
||||
set_env("PRODUCT_VERSION", version_number)
|
||||
if ("" == get_env("BUILD_NUMBER")):
|
||||
set_env("BUILD_NUMBER", "0")
|
||||
set_env("BUILD_NUMBER", "0")
|
||||
return
|
||||
|
||||
def print_info(info=""):
|
||||
@ -196,11 +198,11 @@ def move_dir(src, dst):
|
||||
delete_dir(src)
|
||||
return
|
||||
|
||||
def copy_dir(src, dst):
|
||||
def copy_dir(src, dst, symlinks=False):
|
||||
if is_dir(dst):
|
||||
delete_dir(dst)
|
||||
try:
|
||||
shutil.copytree(get_path(src), get_path(dst))
|
||||
shutil.copytree(get_path(src), get_path(dst), symlinks=symlinks)
|
||||
except:
|
||||
if ("windows" == host_platform()) and copy_dir_windows(src, dst):
|
||||
return
|
||||
@ -254,7 +256,7 @@ def delete_dir(path):
|
||||
|
||||
def copy_lib(src, dst, name):
|
||||
if (config.check_option("config", "bundle_dylibs")) and is_dir(src + "/" + name + ".framework"):
|
||||
copy_dir(src + "/" + name + ".framework", dst + "/" + name + ".framework")
|
||||
copy_dir(src + "/" + name + ".framework", dst + "/" + name + ".framework", symlinks=True)
|
||||
|
||||
if (config.check_option("config", "bundle_xcframeworks")) and is_dir(src + "/simulator/" + name + ".framework"):
|
||||
create_dir(dst + "/simulator")
|
||||
@ -263,9 +265,9 @@ def copy_lib(src, dst, name):
|
||||
if is_dir(dst + "/" + name + ".xcframework"):
|
||||
delete_dir(dst + "/" + name + ".xcframework")
|
||||
|
||||
cmd("xcodebuild", ["-create-xcframework",
|
||||
"-framework", dst + "/" + name + ".framework",
|
||||
"-framework", dst + "/simulator/" + name + ".framework",
|
||||
cmd("xcodebuild", ["-create-xcframework",
|
||||
"-framework", dst + "/" + name + ".framework",
|
||||
"-framework", dst + "/simulator/" + name + ".framework",
|
||||
"-output", dst + "/" + name + ".xcframework"])
|
||||
|
||||
delete_dir(dst + "/" + name + ".framework")
|
||||
@ -368,7 +370,7 @@ def writeFile(path, data):
|
||||
return
|
||||
|
||||
# system cmd methods ------------------------------------
|
||||
def cmd(prog, args=[], is_no_errors=False):
|
||||
def cmd(prog, args=[], is_no_errors=False):
|
||||
ret = 0
|
||||
if ("windows" == host_platform()):
|
||||
sub_args = args[:]
|
||||
@ -383,7 +385,7 @@ def cmd(prog, args=[], is_no_errors=False):
|
||||
sys.exit("Error (" + prog + "): " + str(ret))
|
||||
return ret
|
||||
|
||||
def cmd2(prog, args=[], is_no_errors=False):
|
||||
def cmd2(prog, args=[], is_no_errors=False):
|
||||
ret = 0
|
||||
command = prog if ("windows" != host_platform()) else get_path(prog)
|
||||
for arg in args:
|
||||
@ -453,7 +455,7 @@ def run_command(sCommand):
|
||||
finally:
|
||||
popen.stdout.close()
|
||||
popen.stderr.close()
|
||||
|
||||
|
||||
return result
|
||||
|
||||
def run_command_in_dir(directory, sCommand):
|
||||
@ -468,7 +470,7 @@ def run_command_in_dir(directory, sCommand):
|
||||
if (host == 'windows'):
|
||||
os.chdir(cur_dir)
|
||||
return ret
|
||||
|
||||
|
||||
def exec_command_in_dir(directory, sCommand):
|
||||
host = host_platform()
|
||||
if (host == 'windows'):
|
||||
@ -538,7 +540,7 @@ def git_get_base_url():
|
||||
if at_pos != -1 and colon_pos != -1:
|
||||
host = origin[at_pos+1:colon_pos]
|
||||
return f"https://{host}/"
|
||||
|
||||
|
||||
# Fallback to GitHub
|
||||
return "https://github.com/"
|
||||
|
||||
@ -662,7 +664,7 @@ def create_pull_request(branches_to, repo, is_no_errors=False, is_current_dir=Fa
|
||||
cmd("git", ["merge", "--abort"], is_no_errors)
|
||||
else:
|
||||
cmd("git", ["push"], is_no_errors)
|
||||
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
@ -696,9 +698,12 @@ def get_prefix_cross_compiler_arm64():
|
||||
return ""
|
||||
|
||||
def get_gcc_version():
|
||||
gcc_path = "gcc"
|
||||
if config.option("sysroot") != "":
|
||||
gcc_path = config.option("sysroot") + "/usr/bin/gcc"
|
||||
gcc_version_major = 4
|
||||
gcc_version_minor = 0
|
||||
gcc_version_str = run_command("gcc -dumpfullversion -dumpversion")['stdout']
|
||||
gcc_version_str = run_command(gcc_path + " -dumpfullversion -dumpversion")['stdout']
|
||||
if (gcc_version_str != ""):
|
||||
try:
|
||||
gcc_ver = gcc_version_str.split(".")
|
||||
@ -736,6 +741,14 @@ def qt_setup(platform):
|
||||
if ("gcc_arm" == compiler_platform):
|
||||
qt_dir = config.option("qt-dir") + "/gcc"
|
||||
|
||||
# OVERRIDE IF NEEDED
|
||||
set_env("QT_QMAKE_ADDON", "")
|
||||
if platform == "win_arm64" and not is_dir(qt_dir):
|
||||
override_qt_directory = os.path.abspath(os.path.dirname(__file__) + "/../tools/win/arm64/qt_build/Qt-5.15.2/win_arm64")
|
||||
if is_dir(override_qt_directory):
|
||||
qt_dir = os.path.abspath(override_qt_directory).replace("\\", "/")
|
||||
set_env("QT_QMAKE_ADDON", "-spec win32-arm64-msvc2017")
|
||||
|
||||
set_env("QT_DEPLOY", qt_dir + "/bin")
|
||||
|
||||
if ("linux_arm64" == platform):
|
||||
@ -744,7 +757,7 @@ def qt_setup(platform):
|
||||
set_env("ARM64_TOOLCHAIN_BIN", cross_compiler_arm64)
|
||||
set_env("ARM64_TOOLCHAIN_BIN_PREFIX", get_prefix_cross_compiler_arm64())
|
||||
|
||||
return qt_dir
|
||||
return qt_dir
|
||||
|
||||
def qt_version():
|
||||
qt_dir = get_env("QT_DEPLOY")
|
||||
@ -830,6 +843,9 @@ def qt_config(platform):
|
||||
if ("linux_arm64" == platform):
|
||||
config_param += " linux_arm64"
|
||||
|
||||
if ("win_arm64" == platform):
|
||||
config_param += " win_arm64"
|
||||
|
||||
config_param += qt_config_platform_addon(platform)
|
||||
return config_param
|
||||
|
||||
@ -854,6 +870,12 @@ def qt_config_as_param(value):
|
||||
|
||||
def qt_copy_lib(lib, dir):
|
||||
qt_dir = get_env("QT_DEPLOY")
|
||||
|
||||
# TODO: remove version from library name
|
||||
qt_major = qt_major_version()
|
||||
if ("5" != qt_major):
|
||||
lib = lib.replace("Qt5", "Qt" + qt_major)
|
||||
|
||||
if ("windows" == host_platform()):
|
||||
if ("" == qt_dst_postfix()):
|
||||
copy_lib(qt_dir, dir, lib)
|
||||
@ -862,7 +884,7 @@ def qt_copy_lib(lib, dir):
|
||||
else:
|
||||
src_file = qt_dir + "/../lib/lib" + lib + ".so." + qt_version()
|
||||
if (is_file(src_file)):
|
||||
copy_file(src_file, dir + "/lib" + lib + ".so." + qt_major_version())
|
||||
copy_file(src_file, dir + "/lib" + lib + ".so." + qt_major)
|
||||
else:
|
||||
libFramework = lib
|
||||
libFramework = libFramework.replace("Qt5", "Qt")
|
||||
@ -886,9 +908,24 @@ def _check_icu_common(dir, out):
|
||||
return isExist
|
||||
|
||||
def qt_copy_icu(out):
|
||||
tests = [get_env("QT_DEPLOY") + "/../lib", "/lib", "/lib/x86_64-linux-gnu", "/lib64", "/lib64/x86_64-linux-gnu"]
|
||||
tests += ["/usr/lib", "/usr/lib/x86_64-linux-gnu", "/usr/lib64", "/usr/lib64/x86_64-linux-gnu"]
|
||||
tests += ["/lib/i386-linux-gnu", "/usr/lib/i386-linux-gnu"]
|
||||
tests = [get_env("QT_DEPLOY") + "/../lib"]
|
||||
prefix = ""
|
||||
postfixes = [""]
|
||||
|
||||
# TODO add for linux arm desktop build
|
||||
if config.option("sysroot") != "":
|
||||
prefix = config.option("sysroot")
|
||||
else:
|
||||
prefix = ""
|
||||
|
||||
postfixes += ["/x86_64-linux-gnu"]
|
||||
postfixes += ["/i386-linux-gnu"]
|
||||
|
||||
for postfix in postfixes:
|
||||
tests += [prefix + "/lib" + postfix]
|
||||
tests += [prefix + "/lib64" + postfix]
|
||||
tests += [prefix + "/usr/lib" + postfix]
|
||||
tests += [prefix + "/usr/lib64" + postfix]
|
||||
|
||||
for test in tests:
|
||||
if (_check_icu_common(test, out)):
|
||||
@ -900,7 +937,7 @@ def qt_copy_plugin(name, out):
|
||||
src = get_env("QT_DEPLOY") + "/../plugins/" + name
|
||||
if not is_dir(src):
|
||||
return
|
||||
|
||||
|
||||
copy_dir(src, out + "/" + name)
|
||||
|
||||
if ("windows" == host_platform()):
|
||||
@ -912,7 +949,7 @@ def qt_copy_plugin(name, out):
|
||||
else:
|
||||
delete_file(fileCheck)
|
||||
for file in glob.glob(out + "/" + name + "/*.pdb"):
|
||||
delete_file(file)
|
||||
delete_file(file)
|
||||
return
|
||||
|
||||
def qt_dst_postfix():
|
||||
@ -977,14 +1014,14 @@ def generate_doctrenderer_config(path, root, product, vendor = "", dictionaries
|
||||
file.close()
|
||||
return
|
||||
|
||||
def generate_plist_framework_folder(file):
|
||||
def generate_plist(file, platform):
|
||||
bundle_id_url = "com.onlyoffice."
|
||||
if ("" != get_env("PUBLISHER_BUNDLE_ID")):
|
||||
bundle_id_url = get_env("PUBLISHER_BUNDLE_ID")
|
||||
bundle_creator = "Ascensio System SIA"
|
||||
if ("" != get_env("PUBLISHER_NAME")):
|
||||
bundle_creator = get_env("PUBLISHER_NAME")
|
||||
|
||||
|
||||
bundle_version_natural = readFile(get_script_dir() + "/../../core/Common/version.txt").split(".")
|
||||
bundle_version = []
|
||||
for n in bundle_version_natural:
|
||||
@ -1011,11 +1048,14 @@ def generate_plist_framework_folder(file):
|
||||
content += "\t<string>????</string>\n"
|
||||
content += "\t<key>CFBundleVersion</key>\n"
|
||||
content += "\t<string>" + bundle_version[0] + "." + bundle_version[1] + "." + bundle_version[2] + "</string>\n"
|
||||
content += "\t<key>MinimumOSVersion</key>\n"
|
||||
content += "\t<string>13.0</string>\n"
|
||||
if platform.find("ios") == 0:
|
||||
content += "\t<key>MinimumOSVersion</key>\n"
|
||||
content += "\t<string>13.0</string>\n"
|
||||
content += "</dict>\n"
|
||||
content += "</plist>"
|
||||
|
||||
if platform.find("mac") == 0:
|
||||
file += "/Resources"
|
||||
fileDst = file + "/Info.plist"
|
||||
if is_file(fileDst):
|
||||
delete_file(fileDst)
|
||||
@ -1025,7 +1065,33 @@ def generate_plist_framework_folder(file):
|
||||
fileInfo.close()
|
||||
return
|
||||
|
||||
def generate_plist(path):
|
||||
def generate_xcprivacy(file, platform):
|
||||
content = \
|
||||
"""<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
\t<key>NSPrivacyTracking</key>
|
||||
\t<false/>
|
||||
\t<key>NSPrivacyCollectedDataTypes</key>
|
||||
\t<array/>
|
||||
\t<key>NSPrivacyTrackingDomains</key>
|
||||
\t<array/>
|
||||
\t<key>NSPrivacyAccessedAPITypes</key>
|
||||
\t<array/>
|
||||
</dict>
|
||||
</plist>"""
|
||||
fileDst = os.path.join(file, "PrivacyInfo.xcprivacy")
|
||||
fileInfo = codecs.open(fileDst, "w", "utf-8")
|
||||
fileInfo.write(content)
|
||||
fileInfo.close()
|
||||
return
|
||||
|
||||
def for_each_framework(path, platform, callbacks, max_depth=512):
|
||||
if not config.check_option("config", "bundle_dylibs"):
|
||||
return
|
||||
if max_depth == 0:
|
||||
return
|
||||
src_folder = path
|
||||
if ("/" != path[-1:]):
|
||||
src_folder += "/"
|
||||
@ -1033,9 +1099,10 @@ def generate_plist(path):
|
||||
for file in glob.glob(src_folder):
|
||||
if (is_dir(file)):
|
||||
if file.endswith(".framework"):
|
||||
generate_plist_framework_folder(file)
|
||||
for callback in callbacks:
|
||||
callback(file, platform)
|
||||
else:
|
||||
generate_plist(file)
|
||||
for_each_framework(file, platform, callbacks, max_depth - 1)
|
||||
return
|
||||
|
||||
def correct_bundle_identifier(bundle_identifier):
|
||||
@ -1234,23 +1301,41 @@ def get_file_last_modified_url(url):
|
||||
key = key.upper()
|
||||
if key == "LAST-MODIFIED":
|
||||
retvalue = value
|
||||
|
||||
|
||||
return retvalue
|
||||
|
||||
def mac_change_rpath_binary(bin, old, new):
|
||||
cmd("install_name_tool", ["-change", old, new, bin], True)
|
||||
|
||||
def mac_change_rpath_library(lib_name, old, new):
|
||||
# converts library name to actual library file name (dylib or binary file in framework)
|
||||
def lib_name_to_file_name(lib_name):
|
||||
if config.check_option("config", "bundle_dylibs"):
|
||||
lib = lib_name + ".framework/" + lib_name
|
||||
else:
|
||||
lib = "lib" + lib_name + ".dylib"
|
||||
return lib
|
||||
mac_change_rpath_binary(lib_name_to_file_name(lib_name), old, new)
|
||||
|
||||
def mac_correct_rpath_binary(path, libs):
|
||||
# if framework are built, instead of correcting lib paths add `@loader_path` to rpaths with `mac_add_loader_path_to_rpath()`
|
||||
if config.check_option("config", "bundle_dylibs"):
|
||||
return
|
||||
|
||||
for lib in libs:
|
||||
cmd("install_name_tool", ["-change", "lib" + lib + ".dylib", "@rpath/lib" + lib + ".dylib", path], True)
|
||||
mac_change_rpath_binary(path, "lib" + lib + ".dylib", "@rpath/lib" + lib + ".dylib")
|
||||
return
|
||||
|
||||
def mac_correct_rpath_library(name, libs):
|
||||
return mac_correct_rpath_binary("./lib" + name + ".dylib", libs)
|
||||
|
||||
mac_icu_libs = ["icudata." + icu_ver, "icuuc." + icu_ver]
|
||||
def mac_correct_rpath_x2t(dir):
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(dir)
|
||||
mac_correct_rpath_library("icudata.58", [])
|
||||
mac_correct_rpath_library("icuuc.58", ["icudata.58"])
|
||||
mac_correct_rpath_library("UnicodeConverter", ["icuuc.58", "icudata.58"])
|
||||
mac_correct_rpath_library("icudata." + icu_ver, [])
|
||||
mac_correct_rpath_library("icuuc." + icu_ver, ["icudata." + icu_ver])
|
||||
mac_correct_rpath_library("UnicodeConverter", mac_icu_libs)
|
||||
mac_correct_rpath_library("kernel", ["UnicodeConverter"])
|
||||
mac_correct_rpath_library("kernel_network", ["UnicodeConverter", "kernel"])
|
||||
mac_correct_rpath_library("graphics", ["UnicodeConverter", "kernel"])
|
||||
@ -1265,41 +1350,46 @@ 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", ["icudata.58", "icuuc.58", "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", ["icudata.58", "icuuc.58", "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", ["icudata.58", "icuuc.58", "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", ["icudata.58", "icuuc.58", "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", ["icudata.58", "icuuc.58", "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
|
||||
|
||||
def mac_add_loader_path_to_rpath(libs):
|
||||
for lib in libs:
|
||||
if config.check_option("config", "bundle_dylibs"):
|
||||
# icu libs are linked statically for frameworks
|
||||
if lib in mac_icu_libs:
|
||||
continue
|
||||
cmd("install_name_tool", ["-add_rpath", "@loader_path/../../..", lib + ".framework/" + lib], True)
|
||||
else:
|
||||
cmd("install_name_tool", ["-add_rpath", "@loader_path", "lib" + lib + ".dylib"], True)
|
||||
|
||||
def mac_correct_rpath_docbuilder(dir):
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(dir)
|
||||
cmd("chmod", ["-v", "+x", "./docbuilder"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./docbuilder"], True)
|
||||
mac_correct_rpath_binary("./docbuilder", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "IWorkFile", "HWPFile", "doctrenderer", "DocxRenderer"])
|
||||
mac_correct_rpath_library("docbuilder.c", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "doctrenderer", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "DocxRenderer"])
|
||||
mac_correct_rpath_binary("./docbuilder", mac_icu_libs + ["UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "IWorkFile", "HWPFile", "doctrenderer", "DocxRenderer"])
|
||||
mac_correct_rpath_library("docbuilder.c", mac_icu_libs + ["UnicodeConverter", "kernel", "kernel_network", "graphics", "doctrenderer", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "DocxRenderer"])
|
||||
|
||||
def add_loader_path_to_rpath(libs):
|
||||
for lib in libs:
|
||||
cmd("install_name_tool", ["-add_rpath", "@loader_path", "lib" + lib + ".dylib"], True)
|
||||
|
||||
add_loader_path_to_rpath(["icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "doctrenderer", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "DocxRenderer", "docbuilder.c"])
|
||||
mac_add_loader_path_to_rpath(["icuuc." + icu_ver, "UnicodeConverter", "kernel", "kernel_network", "graphics", "doctrenderer", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "DocxRenderer", "docbuilder.c"])
|
||||
os.chdir(cur_dir)
|
||||
return
|
||||
|
||||
@ -1310,7 +1400,7 @@ def mac_correct_rpath_desktop(dir):
|
||||
mac_correct_rpath_library("hunspell", [])
|
||||
mac_correct_rpath_library("ooxmlsignature", ["kernel"])
|
||||
mac_correct_rpath_library("ascdocumentscore", ["UnicodeConverter", "kernel", "graphics", "kernel_network", "PdfFile", "XpsFile", "DjVuFile", "hunspell", "ooxmlsignature", "doctrenderer"])
|
||||
cmd("install_name_tool", ["-change", "@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework", "@rpath/Chromium Embedded Framework.framework/Chromium Embedded Framework", "libascdocumentscore.dylib"])
|
||||
mac_change_rpath_library("ascdocumentscore", "@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework", "@rpath/Chromium Embedded Framework.framework/Chromium Embedded Framework")
|
||||
mac_correct_rpath_binary("./editors_helper.app/Contents/MacOS/editors_helper", ["ascdocumentscore", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "XpsFile", "OFDFile", "DjVuFile", "hunspell", "ooxmlsignature", "doctrenderer"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path/../../../../Frameworks", "./editors_helper.app/Contents/MacOS/editors_helper"], True)
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path/../../../../Resources/converter", "./editors_helper.app/Contents/MacOS/editors_helper"], True)
|
||||
@ -1345,7 +1435,7 @@ def linux_set_origin_rpath_libraries(dir, libs):
|
||||
return
|
||||
|
||||
def linux_correct_rpath_docbuilder(dir):
|
||||
linux_set_origin_rpath_libraries(dir, ["docbuilder.jni.so", "docbuilder.c.so", "icuuc.so.58", "doctrenderer.so", "graphics.so", "kernel.so", "kernel_network.so", "UnicodeConverter.so", "PdfFile.so", "XpsFile.so", "OFDFile.so", "DjVuFile.so", "DocxRenderer.so"])
|
||||
linux_set_origin_rpath_libraries(dir, ["docbuilder.jni.so", "docbuilder.c.so", "icuuc.so." + icu_ver, "doctrenderer.so", "graphics.so", "kernel.so", "kernel_network.so", "UnicodeConverter.so", "PdfFile.so", "XpsFile.so", "OFDFile.so", "DjVuFile.so", "DocxRenderer.so"])
|
||||
return
|
||||
|
||||
def common_check_version(name, good_version, clean_func):
|
||||
@ -1433,7 +1523,7 @@ def copy_sdkjs_plugins(dst_dir, is_name_as_guid=False, is_desktop_local=False, i
|
||||
return
|
||||
plugins_list = plugins_list_config.rsplit(", ")
|
||||
for name in plugins_list:
|
||||
copy_sdkjs_plugin(plugins_dir, dst_dir, name, is_name_as_guid, is_desktop_local)
|
||||
copy_sdkjs_plugin(plugins_dir, dst_dir, name, is_name_as_guid, is_desktop_local)
|
||||
return
|
||||
|
||||
def copy_sdkjs_plugins_server(dst_dir, is_name_as_guid=False, is_desktop_local=False):
|
||||
@ -1443,7 +1533,7 @@ def copy_sdkjs_plugins_server(dst_dir, is_name_as_guid=False, is_desktop_local=F
|
||||
return
|
||||
plugins_list = plugins_list_config.rsplit(", ")
|
||||
for name in plugins_list:
|
||||
copy_sdkjs_plugin(plugins_dir, dst_dir, name, is_name_as_guid, is_desktop_local)
|
||||
copy_sdkjs_plugin(plugins_dir, dst_dir, name, is_name_as_guid, is_desktop_local)
|
||||
return
|
||||
|
||||
def support_old_versions_plugins(out_dir):
|
||||
@ -1457,11 +1547,11 @@ def support_old_versions_plugins(out_dir):
|
||||
content_plugin_base += file.read()
|
||||
content_plugin_base += "\n\n"
|
||||
with open(get_path(out_dir + "/plugins-ui.js"), "r") as file:
|
||||
content_plugin_base += file.read()
|
||||
content_plugin_base += file.read()
|
||||
with open(get_path(out_dir + "/pluginBase.js"), "w") as file:
|
||||
file.write(content_plugin_base)
|
||||
delete_file(out_dir + "/plugins.js")
|
||||
delete_file(out_dir + "/plugins-ui.js")
|
||||
delete_file(out_dir + "/plugins-ui.js")
|
||||
return
|
||||
|
||||
def generate_sdkjs_plugin_list(dst):
|
||||
@ -1494,7 +1584,7 @@ def hack_xcode_ios():
|
||||
filedata += "\n"
|
||||
filedata += content_hack
|
||||
filedata += "\n\n"
|
||||
|
||||
|
||||
delete_file(qmake_spec_file)
|
||||
with open(get_path(qmake_spec_file), "w") as file:
|
||||
file.write(filedata)
|
||||
@ -1575,12 +1665,12 @@ def copy_v8_files(core_dir, deploy_dir, platform, is_xp=False):
|
||||
if (-1 != config.option("config").find("use_javascript_core")):
|
||||
return
|
||||
directory_v8 = core_dir + "/Common/3dParty"
|
||||
|
||||
|
||||
if is_xp:
|
||||
directory_v8 += "/v8/v8_xp"
|
||||
copy_files(directory_v8 + platform + "/release/icudt*.dll", deploy_dir + "/")
|
||||
return
|
||||
|
||||
|
||||
if config.check_option("config", "v8_version_60"):
|
||||
directory_v8 += "/v8/v8/out.gn/"
|
||||
else:
|
||||
@ -1592,7 +1682,7 @@ def copy_v8_files(core_dir, deploy_dir, platform, is_xp=False):
|
||||
copy_files(directory_v8 + platform + "/icudt*.dat", deploy_dir + "/")
|
||||
return
|
||||
|
||||
def clone_marketplace_plugin(out_dir, is_name_as_guid=False, is_replace_paths=False, is_delete_git_dir=True, git_owner=""):
|
||||
def clone_marketplace_plugin(out_dir, is_name_as_guid=False, is_replace_paths=False, is_delete_git_dir=True, git_owner=""):
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(out_dir)
|
||||
git_update("onlyoffice.github.io", False, True, git_owner)
|
||||
@ -1613,11 +1703,11 @@ def clone_marketplace_plugin(out_dir, is_name_as_guid=False, is_replace_paths=Fa
|
||||
if is_dir(dst_dir_path):
|
||||
delete_dir(dst_dir_path)
|
||||
copy_dir(out_dir + "/onlyoffice.github.io/store/plugin", dst_dir_path)
|
||||
|
||||
|
||||
if is_replace_paths:
|
||||
for file in glob.glob(dst_dir_path + "/*.html"):
|
||||
replaceInFile(file, "https://onlyoffice.github.io/sdkjs-plugins/", "../")
|
||||
|
||||
|
||||
if is_delete_git_dir:
|
||||
delete_dir_with_access_error(out_dir + "/onlyoffice.github.io")
|
||||
return
|
||||
@ -1654,20 +1744,20 @@ def generate_check_linux_system(build_tools_dir, out_dir):
|
||||
def convert_ios_framework_to_xcframework(folder, lib):
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(folder)
|
||||
|
||||
|
||||
create_dir(lib + "_xc_tmp")
|
||||
create_dir(lib + "_xc_tmp/iphoneos")
|
||||
create_dir(lib + "_xc_tmp/iphonesimulator")
|
||||
copy_dir(lib + ".framework", lib + "_xc_tmp/iphoneos/" + lib + ".framework")
|
||||
copy_dir(lib + ".framework", lib + "_xc_tmp/iphonesimulator/" + lib + ".framework")
|
||||
|
||||
cmd("xcrun", ["lipo", "-remove", "x86_64", "./" + lib + "_xc_tmp/iphoneos/" + lib + ".framework/" + lib,
|
||||
cmd("xcrun", ["lipo", "-remove", "x86_64", "./" + lib + "_xc_tmp/iphoneos/" + lib + ".framework/" + lib,
|
||||
"-o", "./" + lib + "_xc_tmp/iphoneos/" + lib + ".framework/" + lib])
|
||||
cmd("xcrun", ["lipo", "-remove", "arm64", "./" + lib + "_xc_tmp/iphonesimulator/" + lib + ".framework/" + lib,
|
||||
cmd("xcrun", ["lipo", "-remove", "arm64", "./" + lib + "_xc_tmp/iphonesimulator/" + lib + ".framework/" + lib,
|
||||
"-o", "./" + lib + "_xc_tmp/iphonesimulator/" + lib + ".framework/" + lib])
|
||||
|
||||
cmd("xcodebuild", ["-create-xcframework",
|
||||
"-framework", "./" + lib + "_xc_tmp/iphoneos/" + lib + ".framework/",
|
||||
cmd("xcodebuild", ["-create-xcframework",
|
||||
"-framework", "./" + lib + "_xc_tmp/iphoneos/" + lib + ".framework/",
|
||||
"-framework", "./" + lib + "_xc_tmp/iphonesimulator/" + lib + ".framework/",
|
||||
"-output", lib + ".xcframework"])
|
||||
|
||||
@ -1683,7 +1773,7 @@ def convert_ios_framework_to_xcframework_folder(folder, libs):
|
||||
|
||||
def change_elf_rpath(path, origin):
|
||||
# excludes ---
|
||||
if (-1 != path.find("libicudata.so.58")):
|
||||
if (-1 != path.find("libicudata.so." + icu_ver)):
|
||||
return
|
||||
# ------------
|
||||
tools_dir = get_script_dir() + "/../tools/linux/elf/"
|
||||
@ -1715,7 +1805,7 @@ def change_elf_rpath(path, origin):
|
||||
cmd(tools_dir + "patchelf", ["--set-rpath", new_path, path], True)
|
||||
#print("[" + os.path.basename(path) + "] old: " + old_path + "; new: " + new_path)
|
||||
return
|
||||
|
||||
|
||||
def correct_elf_rpath_directory(directory, origin, is_recursion = True):
|
||||
for file in glob.glob(directory + "/*"):
|
||||
if is_file(file):
|
||||
@ -1768,14 +1858,14 @@ def copy_dictionaries(src, dst, is_hyphen = True, is_spell = True):
|
||||
|
||||
if is_hyphen and is_hyphen_present:
|
||||
copy_dir_content(file, lang_folder, "hyph_", "")
|
||||
|
||||
|
||||
if is_spell and is_spell_present:
|
||||
copy_dir_content(file, lang_folder, "", "hyph_")
|
||||
|
||||
if is_file(dst + "/en_US/en_US_thes.dat"):
|
||||
delete_file(dst + "/en_US/en_US_thes.dat")
|
||||
delete_file(dst + "/en_US/en_US_thes.idx")
|
||||
|
||||
|
||||
if is_file(dst + "/ru_RU/ru_RU_oo3.dic"):
|
||||
delete_file(dst + "/ru_RU/ru_RU_oo3.dic")
|
||||
delete_file(dst + "/ru_RU/ru_RU_oo3.aff")
|
||||
@ -1797,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
|
||||
@ -1804,6 +1913,7 @@ def check_python():
|
||||
directory_bin = __file__script__path__ + "/../tools/linux/python3/bin"
|
||||
|
||||
if not is_dir(directory + "/python3"):
|
||||
download('https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/python/python3.tar.gz', directory + "/python3.tar.gz")
|
||||
cmd("tar", ["xfz", directory + "/python3.tar.gz", "-C", directory])
|
||||
cmd("ln", ["-s", directory_bin + "/python3", directory_bin + "/python"])
|
||||
directory_bin = directory_bin.replace(" ", "\\ ")
|
||||
@ -1838,7 +1948,7 @@ def get_autobuild_version(product, platform="", branch="", build=""):
|
||||
isArm = False
|
||||
if (-1 != osType.find("arm")) or (-1 != osType.find("aarch64")):
|
||||
isArm = True
|
||||
|
||||
|
||||
if ("windows" == host_platform()):
|
||||
download_platform = "win-"
|
||||
elif ("linux" == host_platform()):
|
||||
@ -1863,8 +1973,11 @@ def get_autobuild_version(product, platform="", branch="", build=""):
|
||||
return "http://repo-doc-onlyoffice-com.s3.amazonaws.com/archive/" + download_addon
|
||||
|
||||
def create_x2t_js_cache(dir, product, platform):
|
||||
if is_file(dir + "/libdoctrenderer.dylib") and (os.path.getsize(dir + "/libdoctrenderer.dylib") < 5*1024*1024):
|
||||
return
|
||||
# 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)
|
||||
@ -1875,5 +1988,35 @@ def create_x2t_js_cache(dir, product, platform):
|
||||
|
||||
def setup_local_qmake(dir_qmake):
|
||||
dir_base = os.path.dirname(dir_qmake)
|
||||
writeFile(dir_base + "/onlyoffice_qt.conf", "Prefix = " + dir_base)
|
||||
writeFile(dir_base + "/onlyoffice_qt.conf", "Prefix = " + dir_base)
|
||||
return
|
||||
|
||||
def deploy_icu(core_dir, dst_dir, platform):
|
||||
if (0 == platform.find("android")):
|
||||
src_dir = core_dir + "/Common/3dParty/icu/android/build/" + platform[8:]
|
||||
copy_file(src_dir + "/icudt" + icu_ver + "l.dat", dst_dir + "/icudt" + icu_ver + "l.dat")
|
||||
return
|
||||
|
||||
isXp = False
|
||||
if platform.endswith("xp"):
|
||||
isXp = True
|
||||
platform = platform[0:-3]
|
||||
src_dir = core_dir + "/Common/3dParty/icu/" + platform + "/build"
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
icu_ver_win = icu_ver
|
||||
if isXp:
|
||||
icu_ver_win = icu_ver_old
|
||||
src_dir += "/xp"
|
||||
copy_file(src_dir + "/icudt" + icu_ver_win + ".dll", dst_dir + "/icudt" + icu_ver_win + ".dll")
|
||||
copy_file(src_dir + "/icuuc" + icu_ver_win + ".dll", dst_dir + "/icuuc" + icu_ver_win + ".dll")
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
copy_file(src_dir + "/libicudata.so." + icu_ver, dst_dir + "/libicudata.so." + icu_ver)
|
||||
copy_file(src_dir + "/libicuuc.so." + icu_ver, dst_dir + "/libicuuc.so." + icu_ver)
|
||||
|
||||
if (0 == platform.find("mac") and not config.check_option("config", "bundle_dylibs")):
|
||||
copy_file(src_dir + "/libicudata." + icu_ver + ".dylib", dst_dir + "/libicudata." + icu_ver + ".dylib")
|
||||
copy_file(src_dir + "/libicuuc." + icu_ver + ".dylib", dst_dir + "/libicuuc." + icu_ver + ".dylib")
|
||||
|
||||
return
|
||||
|
||||
@ -65,10 +65,6 @@ def make():
|
||||
deldirs = ['ie', 'mobile', 'embed']
|
||||
[base.delete_dir(root + "/" + d) for root, dirs, f in os.walk(out_dir + "/desktop/web-apps/apps") for d in dirs if d in deldirs]
|
||||
|
||||
# for bug 62528. remove empty folders
|
||||
walklist = list(os.walk(out_dir + "/desktop/sdkjs"))
|
||||
[os.remove(p) for p, _, _ in walklist[::-1] if len(os.listdir(p)) == 0]
|
||||
|
||||
base.copy_file(base_dir + "/../web-apps/apps/api/documents/index.html.desktop", out_dir + "/desktop/web-apps/apps/api/documents/index.html")
|
||||
|
||||
build_interface(base_dir + "/../desktop-apps/common/loginpage/build")
|
||||
|
||||
@ -52,6 +52,7 @@ def make():
|
||||
base.cmd_in_dir(server_dir + "/DocService", "pkg", [".", "-t", pkg_target, "--options", "max_old_space_size=4096", "-o", "docservice"])
|
||||
base.cmd_in_dir(server_dir + "/FileConverter", "pkg", [".", "-t", pkg_target, "-o", "converter"])
|
||||
base.cmd_in_dir(server_dir + "/Metrics", "pkg", [".", "-t", pkg_target, "-o", "metrics"])
|
||||
base.cmd_in_dir(server_dir + "/AdminPanel/server", "pkg", [".", "-t", pkg_target, "-o", "adminpanel"])
|
||||
|
||||
example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs"
|
||||
base.delete_dir(example_dir + "/node_modules")
|
||||
|
||||
@ -24,7 +24,7 @@ def parse():
|
||||
|
||||
# all platforms
|
||||
global platforms
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp",
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "win_arm64",
|
||||
"linux_64", "linux_32", "linux_arm64",
|
||||
"mac_64", "mac_arm64",
|
||||
"ios",
|
||||
@ -57,6 +57,12 @@ def parse():
|
||||
if not check_option("platform", "mac_64"):
|
||||
options["platform"] = "mac_64 " + options["platform"]
|
||||
|
||||
if (False):
|
||||
# use qemu on deploy for emulation
|
||||
if ("windows" == host_platform) and check_option("platform", "win_arm64") and not base.is_os_arm():
|
||||
if not check_option("platform", "win_64"):
|
||||
options["platform"] = "win_64 " + options["platform"]
|
||||
|
||||
if ("linux" == host_platform) and check_option("platform", "linux_arm64") and not base.is_os_arm():
|
||||
if not check_option("platform", "linux_64"):
|
||||
# linux_64 binaries need only for desktop
|
||||
@ -77,6 +83,27 @@ def parse():
|
||||
|
||||
if ("windows" == host_platform) and ("2019" == option("vs-version")):
|
||||
extend_option("config", "vs2019")
|
||||
|
||||
# sysroot setup
|
||||
if "linux" != host_platform and "sysroot" in options:
|
||||
options["sysroot"] = ""
|
||||
|
||||
if "linux" == host_platform and "sysroot" in options:
|
||||
if options["sysroot"] == "0":
|
||||
options["sysroot"] = ""
|
||||
elif options["sysroot"] == "1":
|
||||
dst_dir = os.path.abspath(base.get_script_dir(__file__) + '/../tools/linux/sysroot')
|
||||
custom_sysroot = dst_dir + '/sysroot_ubuntu_1604'
|
||||
options["sysroot"] = custom_sysroot
|
||||
if not os.path.isdir(custom_sysroot):
|
||||
print("Sysroot is not found, downloading...")
|
||||
sysroot_url = 'https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/sysroot/sysroot_ubuntu_1604.tar.xz'
|
||||
base.download(sysroot_url, dst_dir + '/sysroot_ubuntu_1604.tar.xz')
|
||||
os.mkdir(custom_sysroot)
|
||||
print("Unpacking...")
|
||||
base.cmd2('tar', ['-xf', dst_dir + '/sysroot_ubuntu_1604.tar.xz', '-C', dst_dir])
|
||||
if os.path.exists(dst_dir + '/sysroot_ubuntu_1604.tar.xz'):
|
||||
os.remove(dst_dir + '/sysroot_ubuntu_1604.tar.xz')
|
||||
|
||||
if is_cef_107():
|
||||
extend_option("config", "cef_version_107")
|
||||
@ -105,7 +132,10 @@ def parse():
|
||||
options["sdkjs-plugin-server"] = "default"
|
||||
|
||||
if not "arm64-toolchain-bin" in options:
|
||||
options["arm64-toolchain-bin"] = "/usr/bin"
|
||||
if not "sysroot" in options:
|
||||
options["arm64-toolchain-bin"] = "/usr/bin"
|
||||
else:
|
||||
options["arm64-toolchain-bin"] = get_custom_sysroot_bin()
|
||||
|
||||
if check_option("platform", "ios"):
|
||||
if not check_option("config", "no_bundle_xcframeworks"):
|
||||
@ -116,6 +146,10 @@ def parse():
|
||||
if not check_option("config", "bundle_dylibs"):
|
||||
extend_option("config", "bundle_dylibs")
|
||||
|
||||
if ("mac" == host_platform) and check_option("module", "desktop"):
|
||||
if not check_option("config", "bundle_dylibs"):
|
||||
extend_option("config", "bundle_dylibs")
|
||||
|
||||
if check_option("use-system-qt", "1"):
|
||||
base.cmd_in_dir(base.get_script_dir() + "/../tools/linux", "python", ["use_system_qt.py"])
|
||||
options["qt-dir"] = base.get_script_dir() + "/../tools/linux/system_qt"
|
||||
@ -139,6 +173,9 @@ def check_compiler(platform):
|
||||
if (0 == platform.find("win")):
|
||||
compiler["compiler"] = "msvc" + options["vs-version"]
|
||||
compiler["compiler_64"] = "msvc" + options["vs-version"] + "_64"
|
||||
if (0 == platform.find("win_arm")):
|
||||
compiler["compiler"] = "msvc" + options["vs-version"] + "_arm"
|
||||
compiler["compiler_64"] = "msvc" + options["vs-version"] + "_arm64"
|
||||
elif (0 == platform.find("linux")):
|
||||
compiler["compiler"] = "gcc"
|
||||
compiler["compiler_64"] = "gcc_64"
|
||||
@ -199,6 +236,14 @@ def is_mobile_platform():
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_custom_sysroot_bin():
|
||||
return option("sysroot") + "/usr/bin"
|
||||
|
||||
# todo 32bit support?
|
||||
def get_custom_sysroot_lib():
|
||||
if base.is_os_64bit():
|
||||
return option("sysroot") + "/usr/lib/x86_64-linux-gnu"
|
||||
|
||||
def parse_defaults():
|
||||
defaults_path = base.get_script_dir() + "/../defaults"
|
||||
if ("" != option("branding")):
|
||||
|
||||
@ -25,6 +25,7 @@ import oo_brotli
|
||||
import hyphen
|
||||
import googletest
|
||||
import libvlc
|
||||
import heif
|
||||
|
||||
def check_android_ndk_macos_arm(dir):
|
||||
if base.is_dir(dir + "/darwin-x86_64") and not base.is_dir(dir + "/darwin-arm64"):
|
||||
@ -53,10 +54,11 @@ def make():
|
||||
hyphen.make()
|
||||
googletest.make()
|
||||
oo_brotli.make()
|
||||
heif.make()
|
||||
|
||||
if config.check_option("build-libvlc", "1"):
|
||||
libvlc.make()
|
||||
|
||||
|
||||
if config.check_option("module", "mobile"):
|
||||
if (config.check_option("platform", "android")):
|
||||
curl.make()
|
||||
|
||||
@ -71,13 +71,6 @@ else:
|
||||
"arch" : "darwin-x86_64"
|
||||
}
|
||||
|
||||
def get_android_ndk_version():
|
||||
#return "26.2.11394342"
|
||||
return "21.1.6352462"
|
||||
|
||||
def get_android_ndk_version_major():
|
||||
return int(get_android_ndk_version().split(".")[0])
|
||||
|
||||
def get_options_dict_as_array(opts):
|
||||
value = []
|
||||
for key in opts:
|
||||
|
||||
@ -11,8 +11,8 @@ current_dir = os.path.abspath(current_dir)
|
||||
if not current_dir.endswith("/"):
|
||||
current_dir += "/"
|
||||
|
||||
icu_major = "58"
|
||||
icu_minor = "3"
|
||||
icu_major = "74"
|
||||
icu_minor = "2"
|
||||
|
||||
options = {
|
||||
"--enable-strict" : "no",
|
||||
@ -41,12 +41,12 @@ cpp_flags_base = [
|
||||
cpp_flags = [
|
||||
"-fno-short-wchar",
|
||||
"-fno-short-enums",
|
||||
|
||||
|
||||
"-DU_USING_ICU_NAMESPACE=0",
|
||||
"-DU_HAVE_NL_LANGINFO_CODESET=0",
|
||||
"-DU_TIMEZONE=0",
|
||||
"-DU_DISABLE_RENAMING=0",
|
||||
|
||||
|
||||
"-DUCONFIG_NO_COLLATION=0",
|
||||
"-DUCONFIG_NO_FORMATTING=0",
|
||||
"-DUCONFIG_NO_REGULAR_EXPRESSIONS=0",
|
||||
@ -55,16 +55,11 @@ cpp_flags = [
|
||||
"-DU_STATIC_IMPLEMENTATION"
|
||||
]
|
||||
|
||||
def fetch_icu():
|
||||
def fetch_icu(major, minor):
|
||||
if not base.is_dir(current_dir + "icu"):
|
||||
base.cmd("git", ["clone", "--depth", "1", "--branch", "maint/maint-" + icu_major, "https://github.com/unicode-org/icu.git", current_dir + "icu2"])
|
||||
base.cmd("git", ["clone", "--depth", "1", "--branch", "release-" + major + "-" + minor, "https://github.com/unicode-org/icu.git", current_dir + "icu2"])
|
||||
base.copy_dir(current_dir + "icu2/icu4c", current_dir + "icu")
|
||||
base.delete_dir_with_access_error(current_dir + "icu2")
|
||||
|
||||
if ("linux" == base.host_platform()):
|
||||
base.replaceInFile(current_dir + "/icu/source/i18n/digitlst.cpp", "xlocale", "locale")
|
||||
if False and ("mac" == base.host_platform()):
|
||||
base.replaceInFile(current_dir + "/icu/source/tools/pkgdata/pkgdata.cpp", "cmd, \"%s %s -o %s%s %s %s%s %s %s\",", "cmd, \"%s %s -o %s%s %s %s %s %s %s\",")
|
||||
return
|
||||
|
||||
def build_host():
|
||||
@ -111,9 +106,9 @@ def build_arch(arch):
|
||||
cross_build_dir = os.path.abspath(current_dir + "icu/cross_build")
|
||||
arch_build_dir = os.path.abspath(current_dir + "build/tmp")
|
||||
base.create_dir(arch_build_dir)
|
||||
|
||||
|
||||
os.chdir(arch_build_dir)
|
||||
base.cmd("./../../icu/source/configure", ["--with-cross-build=" + cross_build_dir] +
|
||||
base.cmd("./../../icu/source/configure", ["--with-cross-build=" + cross_build_dir] +
|
||||
android_ndk.get_options_dict_as_array(options) + ["--host=" + android_ndk.platforms[arch]["target"], "--prefix=" + arch_build_dir])
|
||||
base.cmd("make", ["-j4"])
|
||||
os.chdir(current_dir)
|
||||
@ -132,7 +127,7 @@ def make():
|
||||
|
||||
old_env = dict(os.environ)
|
||||
|
||||
fetch_icu()
|
||||
fetch_icu(icu_major, icu_minor)
|
||||
|
||||
build_host()
|
||||
|
||||
|
||||
@ -85,19 +85,36 @@ def make():
|
||||
base.cmd("b2.exe", ["headers"])
|
||||
base.cmd("b2.exe", ["--clean"])
|
||||
base.cmd("b2.exe", ["--prefix=./../build/win_32", "link=static", "--with-filesystem", "--with-system", "--with-date_time", "--with-regex", "--toolset=" + win_toolset, "address-model=32", "install"])
|
||||
if (-1 != config.option("platform").find("win_arm64") and not base.is_file("../build/win_arm64/lib/libboost_system-" + win_vs_version + "-mt-a64-1_72.lib")):
|
||||
boost_bat = []
|
||||
boost_bat.append("call bootstrap.bat " + win_boot_arg) # first build b2 for win64, so vcvarsall_call with arm64 later
|
||||
vcvarsall_call = ("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + "x64_arm64")
|
||||
boost_bat.append(vcvarsall_call)
|
||||
boost_bat.append("call b2.exe headers")
|
||||
boost_bat.append("call b2.exe --clean")
|
||||
boost_bat.append("call b2.exe --prefix=./../build/win_arm64 architecture=arm link=static --with-filesystem --with-system --with-date_time --with-regex --toolset=" + win_toolset + " address-model=64 install")
|
||||
base.run_as_bat(boost_bat)
|
||||
correct_install_includes_win(base_dir, "win_64")
|
||||
correct_install_includes_win(base_dir, "win_32")
|
||||
correct_install_includes_win(base_dir, "win_32")
|
||||
correct_install_includes_win(base_dir, "win_arm64")
|
||||
|
||||
if config.check_option("platform", "linux_64") and not base.is_dir("../build/linux_64"):
|
||||
addon_config = []
|
||||
addon_compile = []
|
||||
if "1" == config.option("use-clang"):
|
||||
addon_config = ["--with-toolset=clang"]
|
||||
addon_compile = ["cxxflags=-stdlib=libc++", "linkflags=-stdlib=libc++", "define=_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION"]
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex"] + addon_config)
|
||||
base.cmd("./b2", ["headers"])
|
||||
base.cmd("./b2", ["--clean"])
|
||||
base.cmd("./b2", ["--prefix=./../build/linux_64", "link=static", "cxxflags=-fPIC"] + addon_compile + ["install"])
|
||||
if config.option("sysroot") == "":
|
||||
addon_config = []
|
||||
addon_compile = []
|
||||
if "1" == config.option("use-clang"):
|
||||
addon_config = ["--with-toolset=clang"]
|
||||
addon_compile = ["cxxflags=-stdlib=libc++", "linkflags=-stdlib=libc++", "define=_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION"]
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex"] + addon_config)
|
||||
base.cmd("./b2", ["headers"])
|
||||
base.cmd("./b2", ["--clean"])
|
||||
base.cmd("./b2", ["--prefix=./../build/linux_64", "link=static", "cxxflags=-fPIC"] + addon_compile + ["install"])
|
||||
else: # build via qmake when custom sysroot is needed
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "linux_64")
|
||||
directory_build = base_dir + "/build/linux_64/lib"
|
||||
base.delete_file(directory_build + "/libboost_system.a")
|
||||
base.delete_file(directory_build + "/libboost_system.dylib")
|
||||
base.copy_files(directory_build + "/linux_64/*.a", directory_build)
|
||||
# TODO: support x86
|
||||
|
||||
if config.check_option("platform", "linux_arm64") and not base.is_dir("../build/linux_arm64"):
|
||||
|
||||
@ -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
|
||||
|
||||
@ -5,6 +5,13 @@ sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
|
||||
def clear_module():
|
||||
for child in glob.glob("./*"):
|
||||
if base.is_dir(child):
|
||||
base.delete_dir(child)
|
||||
return
|
||||
|
||||
def make():
|
||||
print("[fetch & build]: cef")
|
||||
@ -13,13 +20,14 @@ def make():
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32", "mac_64", "mac_arm64"]
|
||||
base.check_module_version("2", clear_module)
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32", "mac_64", "mac_arm64", "win_arm64"]
|
||||
|
||||
for platform in platforms:
|
||||
if not config.check_option("platform", platform):
|
||||
continue
|
||||
|
||||
url = "http://d2ettrnqo7v976.cloudfront.net/cef/"
|
||||
url = "https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/cef/"
|
||||
archive_name = "./cef_binary.7z"
|
||||
|
||||
if (-1 != platform.find("_xp")):
|
||||
|
||||
@ -26,7 +26,7 @@ def make():
|
||||
base.common_check_version("glew", "1", clean)
|
||||
|
||||
if not base.is_dir("glew-2.1.0"):
|
||||
base.download("https://deac-ams.dl.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0-win32.zip", "./archive.zip")
|
||||
base.download("https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/glew/glew-2.1.0-win32.zip", "./archive.zip")
|
||||
base.extract("./archive.zip", "./")
|
||||
base.delete_file("./archive.zip")
|
||||
|
||||
|
||||
415
scripts/core_common/modules/heif.py
Normal file
415
scripts/core_common/modules/heif.py
Normal file
@ -0,0 +1,415 @@
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
import config
|
||||
|
||||
# NOTE:
|
||||
# - requires CMake >= 3.21, < 4.0.0
|
||||
|
||||
# libs versions
|
||||
X265_VERSION = "4.1"
|
||||
DE265_VERSION = "1.0.16"
|
||||
# 1.18.2 - the latest version of libheif supporting C++11 builds (as for now)
|
||||
HEIF_VERSION = "1.18.2"
|
||||
|
||||
# ios cmake toolchain
|
||||
IOS_CMAKE_VERSION = "4.5.0"
|
||||
IOS_CMAKE_TOOLCHAIN_FILE = base.get_script_dir() + "/../../core/Common/3dParty/heif/ios-cmake/ios.toolchain.cmake"
|
||||
|
||||
# android cmake toolchain
|
||||
ANDROID_CMAKE_TOOLCHAIN_FILE = base.get_env("ANDROID_NDK_ROOT") + "/build/cmake/android.toolchain.cmake"
|
||||
|
||||
# linux arm64 cmake toolchain
|
||||
LINUX_ARM64_CMAKE_TOOLCHAIN_FILE = base.get_script_dir() + "/../tools/linux/arm/cross_arm64/linux-arm64.toolchain.cmake"
|
||||
|
||||
LINUX_CUSTOM_SYSROOT_TOOLCHAIN_FILE = base.get_script_dir() + "/../tools/linux/sysroot/custom-sysroot.toolchain.cmake"
|
||||
|
||||
OLD_ENV = dict()
|
||||
|
||||
# get custom sysroot vars as str
|
||||
def setup_custom_sysroot_env() -> str:
|
||||
env_vars = []
|
||||
env_vars += ['LD_LIBRARY_PATH=\"' + config.get_custom_sysroot_lib() + "\""]
|
||||
env_vars += ['PATH=\"' + config.option("sysroot") + "/usr/bin:" + base.get_env("PATH") + "\""]
|
||||
env_vars += ['CC=\"' + config.get_custom_sysroot_bin() + "/gcc\""]
|
||||
env_vars += ['CXX=\"' + config.get_custom_sysroot_bin() + "/g++\""]
|
||||
env_vars += ['AR=\"' + config.get_custom_sysroot_bin() + "/ar\""]
|
||||
env_vars += ['RABLIB=\"' + config.get_custom_sysroot_bin() + "/ranlib\""]
|
||||
env_vars += ['CFLAGS=\"' + "--sysroot=" + config.option("sysroot") + "\""]
|
||||
env_vars += ['CXXFLAGS=\"' + "--sysroot=" + config.option("sysroot") + "\""]
|
||||
env_vars += ['LDFLAGS=\"' + "--sysroot=" + config.option("sysroot") + "\""]
|
||||
|
||||
env_str = ""
|
||||
for env_var in env_vars:
|
||||
env_str += env_var + " "
|
||||
|
||||
return env_str
|
||||
|
||||
def get_vs_version():
|
||||
vs_version = "14 2015"
|
||||
if config.option("vs-version") == "2019":
|
||||
vs_version = "16 2019"
|
||||
return vs_version
|
||||
|
||||
def get_xcode_sdk(platform):
|
||||
xcode_sdk = "iphoneos"
|
||||
if "simulator" in platform:
|
||||
xcode_sdk = "iphonesimulator"
|
||||
return xcode_sdk
|
||||
|
||||
def fetch_repo(repo_url, branch_or_tag):
|
||||
base.cmd("git", ["clone", "--depth", "1", "--branch", branch_or_tag, repo_url])
|
||||
return
|
||||
|
||||
def get_build_dir(base_dir, repo_dir, platform, build_type):
|
||||
return os.path.join(base_dir, repo_dir, "build", platform, build_type.lower())
|
||||
|
||||
# general build function that builds for ONE platform (supposing we are located in the build directory)
|
||||
def build_with_cmake(platform, cmake_args, build_type):
|
||||
# extend cmake arguments
|
||||
cmake_args_ext = []
|
||||
# WINDOWS
|
||||
if "win" in platform:
|
||||
cmake_args_ext = [
|
||||
"-G", f"Visual Studio {get_vs_version()}"
|
||||
]
|
||||
if platform == "win_64" or platform == "win_64_xp":
|
||||
cmake_args_ext += ["-A", "x64"]
|
||||
elif platform == "win_32" or platform == "win_32_xp":
|
||||
cmake_args_ext += ["-A", "Win32"]
|
||||
elif platform == "win_arm64":
|
||||
cmake_args_ext += ["-A", "ARM64"]
|
||||
# LINUX, MAC
|
||||
elif "linux" in platform or "mac" in platform:
|
||||
cmake_args_ext = [
|
||||
"-G", "Unix Makefiles",
|
||||
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON" # on UNIX we need to compile with fPIC
|
||||
]
|
||||
if platform == "mac_64":
|
||||
cmake_args_ext += ["-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11", "-DCMAKE_OSX_ARCHITECTURES=x86_64"]
|
||||
elif platform == "mac_arm64":
|
||||
cmake_args_ext += ["-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0", "-DCMAKE_OSX_ARCHITECTURES=arm64"]
|
||||
elif platform == "linux_arm64":
|
||||
cmake_args += ["-DCMAKE_TOOLCHAIN_FILE=" + LINUX_ARM64_CMAKE_TOOLCHAIN_FILE]
|
||||
elif config.option("sysroot") != "":
|
||||
cmake_args += ["-DCMAKE_TOOLCHAIN_FILE=" + LINUX_CUSTOM_SYSROOT_TOOLCHAIN_FILE] # force use custom CXXFLAGS with Release/Debug build
|
||||
# IOS
|
||||
elif "ios" in platform:
|
||||
cmake_args_ext = [
|
||||
"-G", "Xcode",
|
||||
"-DCMAKE_TOOLCHAIN_FILE=" + IOS_CMAKE_TOOLCHAIN_FILE,
|
||||
"-DDEPLOYMENT_TARGET=11.0"
|
||||
]
|
||||
if platform == "ios":
|
||||
cmake_args_ext += ["-DPLATFORM=OS64"]
|
||||
elif platform == "ios_simulator":
|
||||
cmake_args_ext += ["-DPLATFORM=SIMULATOR64COMBINED"]
|
||||
# ANDROID
|
||||
elif "android" in platform:
|
||||
cmake_args_ext = [
|
||||
"-G", "Unix Makefiles",
|
||||
"-DCMAKE_TOOLCHAIN_FILE=" + ANDROID_CMAKE_TOOLCHAIN_FILE,
|
||||
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
|
||||
]
|
||||
def get_cmake_args_android(arch, api_level):
|
||||
return [
|
||||
"-DANDROID_ABI=" + arch,
|
||||
"-DANDROID_NATIVE_API_LEVEL=" + api_level
|
||||
]
|
||||
if platform == "android_arm64_v8a":
|
||||
cmake_args_ext += get_cmake_args_android("arm64-v8a", "21")
|
||||
elif platform == "android_armv7":
|
||||
cmake_args_ext += get_cmake_args_android("armeabi-v7a", "16")
|
||||
elif platform == "android_x86":
|
||||
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"])
|
||||
else:
|
||||
base.cmd("cmake", ["--build", ".", "--config", build_type])
|
||||
return
|
||||
|
||||
# general make function that calls `build_func` callback for configured platform(s) with specified cmake arguments
|
||||
def make_common(build_func, cmake_args):
|
||||
# WINDOWS
|
||||
if "windows" == base.host_platform():
|
||||
# win_64
|
||||
if config.check_option("platform", "win_64") or config.check_option("platform", "win_64_xp"):
|
||||
build_func("win_64", cmake_args)
|
||||
# win_32
|
||||
if config.check_option("platform", "win_32") or config.check_option("platform", "win_32_xp"):
|
||||
build_func("win_32", cmake_args)
|
||||
# win_arm64
|
||||
if config.check_option("platform", "win_arm64"):
|
||||
build_func("win_arm64", cmake_args)
|
||||
|
||||
# LINUX
|
||||
elif "linux" == base.host_platform():
|
||||
# linux_64
|
||||
if config.check_option("platform", "linux_64"):
|
||||
build_func("linux_64", cmake_args)
|
||||
# linux_arm64
|
||||
if config.check_option("platform", "linux_arm64"):
|
||||
build_func("linux_arm64", cmake_args)
|
||||
|
||||
# MAC
|
||||
elif "mac" == base.host_platform():
|
||||
# mac_64
|
||||
if config.check_option("platform", "mac_64"):
|
||||
build_func("mac_64", cmake_args)
|
||||
# mac_arm64
|
||||
if config.check_option("platform", "mac_arm64"):
|
||||
build_func("mac_arm64", cmake_args)
|
||||
|
||||
# IOS
|
||||
if -1 != config.option("platform").find("ios"):
|
||||
# ios (arm64)
|
||||
build_func("ios", cmake_args)
|
||||
# ios simulator (x86_64 and arm64 FAT lib)
|
||||
build_func("ios_simulator", cmake_args)
|
||||
|
||||
# ANDROID
|
||||
if -1 != config.option("platform").find("android"):
|
||||
# android_arm64_v8a
|
||||
if config.check_option("platform", "android_arm64_v8a"):
|
||||
build_func("android_arm64_v8a", cmake_args)
|
||||
# android_armv7
|
||||
if config.check_option("platform", "android_armv7"):
|
||||
build_func("android_armv7", cmake_args)
|
||||
# android_x86
|
||||
if config.check_option("platform", "android_x86"):
|
||||
build_func("android_x86", cmake_args)
|
||||
# android_x86_64
|
||||
if config.check_option("platform", "android_x86_64"):
|
||||
build_func("android_x86_64", cmake_args)
|
||||
|
||||
return
|
||||
|
||||
def make_x265(base_dir, build_type):
|
||||
# fetch lib repo
|
||||
if not base.is_dir("x265_git"):
|
||||
fetch_repo("https://bitbucket.org/multicoreware/x265_git.git", f"Release_{X265_VERSION}")
|
||||
# fix x265 version detection so it reads version from x265Version.txt instead of parsing it from .git
|
||||
base.replaceInFile(
|
||||
base_dir + "/x265_git/source/cmake/Version.cmake",
|
||||
"elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt)",
|
||||
"endif()\n if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt)"
|
||||
)
|
||||
|
||||
# prepare cmake args
|
||||
cmake_dir = base_dir + "/x265_git/source"
|
||||
cmake_args = [
|
||||
cmake_dir,
|
||||
"-DCMAKE_BUILD_TYPE=" + 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
|
||||
def build_x265(platform, cmake_args):
|
||||
# check if target lib has already been built
|
||||
build_dir = get_build_dir(base_dir, "x265_git", platform, build_type)
|
||||
if platform.find("win") != -1:
|
||||
target_lib = os.path.join(build_dir, build_type, "x265-static.lib")
|
||||
else:
|
||||
target_lib = os.path.join(build_dir, "libx265.a")
|
||||
if base.is_file(target_lib):
|
||||
return
|
||||
# go to the build directory
|
||||
base.create_dir(build_dir)
|
||||
os.chdir(build_dir)
|
||||
# run build
|
||||
build_with_cmake(platform, cmake_args, build_type)
|
||||
# for iOS there is no target for building libx265.a, so we need to form it ourselves from libcommon.a and libencoder.a
|
||||
if platform.find("ios") != -1:
|
||||
xcode_sdk = get_xcode_sdk(platform)
|
||||
base.cmd("libtool", [
|
||||
"-static",
|
||||
"-o", "libx265.a",
|
||||
f"build/common.build/{build_type}-{xcode_sdk}/libcommon.a",
|
||||
f"build/encoder.build/{build_type}-{xcode_sdk}/libencoder.a"
|
||||
])
|
||||
# copy header
|
||||
base.copy_file(base_dir + "/x265_git/source/x265.h", build_dir)
|
||||
# reset directory
|
||||
os.chdir(base_dir)
|
||||
return
|
||||
|
||||
make_common(build_x265, cmake_args)
|
||||
return
|
||||
|
||||
def make_de265(base_dir, build_type):
|
||||
# fetch lib repo
|
||||
if not base.is_dir("libde265"):
|
||||
fetch_repo("https://github.com/strukturag/libde265.git", f"v{DE265_VERSION}")
|
||||
|
||||
# prepare cmake args
|
||||
cmake_dir = base_dir + "/libde265"
|
||||
cmake_args = [
|
||||
cmake_dir,
|
||||
"-DCMAKE_BUILD_TYPE=" + build_type,
|
||||
"-DBUILD_SHARED_LIBS=OFF", # do not build shared libs
|
||||
"-DENABLE_SDL=OFF", # disable SDL
|
||||
"-DENABLE_DECODER=OFF", # do not build decoder CLI executable
|
||||
"-DENABLE_ENCODER=OFF", # do not build encoder CLI executable
|
||||
]
|
||||
|
||||
# lib build function
|
||||
def build_de265(platform, cmake_args):
|
||||
# check if target lib has already been built
|
||||
build_dir = get_build_dir(base_dir, "libde265", platform, build_type)
|
||||
if platform.find("win") != -1:
|
||||
target_lib = os.path.join(build_dir, "libde265", build_type, "libde265.lib")
|
||||
else:
|
||||
target_lib = os.path.join(build_dir, "libde265/libde265.a")
|
||||
if base.is_file(target_lib):
|
||||
return
|
||||
# go to the build directory
|
||||
base.create_dir(build_dir)
|
||||
os.chdir(build_dir)
|
||||
# run build
|
||||
build_with_cmake(platform, cmake_args, build_type)
|
||||
# for ios copy target library from the default build path
|
||||
if platform.find("ios") != -1:
|
||||
xcode_sdk = get_xcode_sdk(platform)
|
||||
base.copy_file(f"libde265/{build_type}-{xcode_sdk}/libde265.a", "libde265")
|
||||
# copy header
|
||||
base.copy_file(base_dir + "/libde265/libde265/de265.h", "libde265")
|
||||
# reset directory
|
||||
os.chdir(base_dir)
|
||||
return
|
||||
|
||||
make_common(build_de265, cmake_args)
|
||||
return
|
||||
|
||||
def make_heif(base_dir, build_type):
|
||||
# fetch lib repo
|
||||
if not base.is_dir("libheif"):
|
||||
fetch_repo("https://github.com/strukturag/libheif.git", f"v{HEIF_VERSION}")
|
||||
# do not build heifio module
|
||||
base.replaceInFile(
|
||||
base_dir + "/libheif/CMakeLists.txt",
|
||||
"add_subdirectory(heifio)",
|
||||
"# add_subdirectory(heifio)"
|
||||
)
|
||||
base.replaceInFile(
|
||||
base_dir + "/libheif/CMakeLists.txt",
|
||||
"if (DOXYGEN_FOUND)",
|
||||
"if (FALSE)"
|
||||
)
|
||||
|
||||
# prepare cmake args
|
||||
cmake_dir = base_dir + "/libheif"
|
||||
cmake_args = [
|
||||
cmake_dir,
|
||||
"--preset=release-noplugins", # preset to disable plugins system
|
||||
"-DCMAKE_BUILD_TYPE=" + build_type,
|
||||
"-DBUILD_SHARED_LIBS=OFF", # do not build shared libs
|
||||
"-DWITH_LIBSHARPYUV=OFF", # do not build libsharpyuv (for RGB <--> YUV color space conversions)
|
||||
"-DWITH_AOM_DECODER=OFF", # do not build AOM V1 decoder (for AVIF image format)
|
||||
"-DWITH_AOM_ENCODER=OFF", # do not build AOM V1 encoder (for AVIF image format)
|
||||
"-DWITH_GDK_PIXBUF=OFF", # do not build gdk-pixbuf plugin (UNIX only)
|
||||
"-DWITH_GNOME=OFF", # do not build gnome plugin (Linux only)
|
||||
"-DWITH_EXAMPLES=OFF", # do not build examples
|
||||
"-DWITH_EXAMPLE_HEIF_VIEW=OFF", # do not build heif-view CLI tool
|
||||
"-DWITH_X265=ON", # enable x265 codec
|
||||
"-DWITH_LIBDE265=ON", # enable de265 codec
|
||||
"-DCMAKE_CXX_FLAGS=-DLIBDE265_STATIC_BUILD", # add macro definition to properly compile with de265 static library
|
||||
"-DCMAKE_C_FLAGS=-DLIBDE265_STATIC_BUILD", # same ^
|
||||
]
|
||||
|
||||
# lib build function
|
||||
def build_heif(platform, cmake_args):
|
||||
# check if target lib has already been built
|
||||
build_dir = get_build_dir(base_dir, "libheif", platform, build_type)
|
||||
if platform.find("win") != -1:
|
||||
target_lib = os.path.join(build_dir, "libheif", build_type, "heif.lib")
|
||||
else:
|
||||
target_lib = os.path.join(build_dir, "libheif/libheif.a")
|
||||
if base.is_file(target_lib):
|
||||
return
|
||||
# go to the build directory
|
||||
base.create_dir(build_dir)
|
||||
os.chdir(build_dir)
|
||||
# add paths to dependent libraries and includes to cmake args
|
||||
de265_build_dir = get_build_dir(base_dir, "libde265", platform, build_type)
|
||||
x265_build_dir = get_build_dir(base_dir, "x265_git", platform, build_type)
|
||||
cmake_args_ext = [
|
||||
f"-DLIBDE265_INCLUDE_DIR={de265_build_dir}",
|
||||
f"-DX265_INCLUDE_DIR={x265_build_dir}"
|
||||
]
|
||||
if platform.find("win") != -1:
|
||||
cmake_args_ext += [
|
||||
f"-DLIBDE265_LIBRARY={de265_build_dir}/libde265/{build_type}/libde265.lib",
|
||||
f"-DX265_LIBRARY={x265_build_dir}/{build_type}/x265-static.lib"
|
||||
]
|
||||
else:
|
||||
cmake_args_ext += [
|
||||
f"-DLIBDE265_LIBRARY={de265_build_dir}/libde265/libde265.a",
|
||||
f"-DX265_LIBRARY={x265_build_dir}/libx265.a"
|
||||
]
|
||||
# run build
|
||||
build_with_cmake(platform, cmake_args + cmake_args_ext, build_type)
|
||||
# for ios copy target library from the default build path
|
||||
if platform.find("ios") != -1:
|
||||
xcode_sdk = get_xcode_sdk(platform)
|
||||
base.copy_file(f"libheif/{build_type}-{xcode_sdk}/libheif.a", "libheif")
|
||||
# reset directory
|
||||
os.chdir(base_dir)
|
||||
return
|
||||
|
||||
make_common(build_heif, cmake_args)
|
||||
return
|
||||
|
||||
def clear_module():
|
||||
if base.is_dir("libde265"):
|
||||
base.delete_dir_with_access_error("libde265")
|
||||
if base.is_dir("x265_git"):
|
||||
base.delete_dir_with_access_error("x265_git")
|
||||
if base.is_dir("libheif"):
|
||||
base.delete_dir_with_access_error("libheif")
|
||||
return
|
||||
|
||||
def make():
|
||||
print("[fetch & build]: heif")
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/heif"
|
||||
old_dir = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
base.check_module_version("2", clear_module)
|
||||
|
||||
build_type = "Release"
|
||||
if (-1 != config.option("config").lower().find("debug")):
|
||||
build_type = "Debug"
|
||||
|
||||
# fetch custom cmake toolchain for ios
|
||||
if -1 != config.option("platform").find("ios"):
|
||||
if not base.is_file(IOS_CMAKE_TOOLCHAIN_FILE):
|
||||
fetch_repo("https://github.com/leetal/ios-cmake.git", IOS_CMAKE_VERSION)
|
||||
|
||||
# build encoder library
|
||||
make_x265(base_dir, build_type)
|
||||
# build decoder library
|
||||
make_de265(base_dir, build_type)
|
||||
|
||||
# build libheif
|
||||
make_heif(base_dir, build_type)
|
||||
|
||||
os.chdir(old_dir)
|
||||
return
|
||||
|
||||
if __name__ == '__main__':
|
||||
make()
|
||||
@ -9,13 +9,12 @@ import os
|
||||
import glob
|
||||
import icu_android
|
||||
|
||||
def fetch_icu(major, minor):
|
||||
def fetch_icu(major, minor, target_dir="icu"):
|
||||
if (base.is_dir("./icu2")):
|
||||
base.delete_dir_with_access_error("icu2")
|
||||
base.cmd("git", ["clone", "--depth", "1", "--branch", "maint/maint-" + major, "https://github.com/unicode-org/icu.git", "./icu2"])
|
||||
base.copy_dir("./icu2/icu4c", "./icu")
|
||||
base.delete_dir_with_access_error("icu2")
|
||||
base.cmd("git", ["clone", "--depth", "1", "--branch", "release-" + major + "-" + minor, "https://github.com/unicode-org/icu.git", "./icu2"])
|
||||
base.copy_dir("./icu2/icu4c", target_dir)
|
||||
base.delete_dir_with_access_error("icu2")
|
||||
#base.cmd("svn", ["export", "https://github.com/unicode-org/icu/tags/release-" + icu_major + "-" + icu_minor + "/icu4c", "./icu", "--non-interactive", "--trust-server-cert"])
|
||||
return
|
||||
|
||||
def clear_module():
|
||||
@ -36,18 +35,26 @@ def make():
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
base.check_module_version("3", clear_module)
|
||||
base.check_module_version("7", clear_module)
|
||||
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
icu_android.make()
|
||||
|
||||
os.chdir(base_dir)
|
||||
|
||||
icu_major = "58"
|
||||
icu_minor = "3"
|
||||
|
||||
icu_major = "74"
|
||||
icu_minor = "2"
|
||||
|
||||
if not base.is_dir("icu"):
|
||||
fetch_icu(icu_major, icu_minor)
|
||||
fetch_icu(icu_major, icu_minor)
|
||||
|
||||
# old version for win_xp
|
||||
icu_major_old = "58"
|
||||
icu_minor_old = "3"
|
||||
|
||||
if config.check_option("platform", "win_64_xp") or config.check_option("platform", "win_32_xp"):
|
||||
if not base.is_dir("icu58"):
|
||||
fetch_icu(icu_major_old, icu_minor_old, "icu58")
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
platformToolset = "v140"
|
||||
@ -58,36 +65,65 @@ def make():
|
||||
need_platforms.append("win_64")
|
||||
if (-1 != config.option("platform").find("win_32")):
|
||||
need_platforms.append("win_32")
|
||||
if (-1 != config.option("platform").find("win_arm64")):
|
||||
need_platforms.append("win_64") # for exe files
|
||||
need_platforms.append("win_arm64")
|
||||
|
||||
def build_icu_win(source_dir, out_dir, icu_major):
|
||||
if base.is_dir(out_dir):
|
||||
return
|
||||
|
||||
compile_bat = []
|
||||
compile_bat.append("setlocal")
|
||||
|
||||
args = {
|
||||
"win_32" : {
|
||||
"msbuild_platfrom" : "Win32",
|
||||
"vcvarsall_arch" : "x86",
|
||||
"out_bin_dir" : source_dir + "/bin/",
|
||||
"out_lib_dir" : source_dir + "/lib/"
|
||||
},
|
||||
"win_64" : {
|
||||
"msbuild_platfrom" : "X64",
|
||||
"vcvarsall_arch" : "x64",
|
||||
"out_bin_dir" : source_dir + "/bin64/",
|
||||
"out_lib_dir" : source_dir + "/lib64/"
|
||||
},
|
||||
"win_arm64" : {
|
||||
"msbuild_platfrom" : "ARM64",
|
||||
"vcvarsall_arch" : "x64_arm64",
|
||||
"out_bin_dir" : source_dir + "/binARM64/",
|
||||
"out_lib_dir" : source_dir + "/libARM64/"
|
||||
}
|
||||
}
|
||||
|
||||
platform_args = args[platform]
|
||||
|
||||
compile_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + platform_args['vcvarsall_arch'])
|
||||
compile_bat.append("call MSBuild.exe " + source_dir + "/source/allinone/allinone.sln /p:Configuration=Release /p:PlatformToolset=" + platformToolset + " /p:Platform=" + platform_args['msbuild_platfrom'])
|
||||
compile_bat.append("endlocal")
|
||||
base.run_as_bat(compile_bat)
|
||||
|
||||
base.create_dir(out_dir)
|
||||
base.copy_file(platform_args['out_bin_dir'] + "icudt" + icu_major + ".dll", out_dir)
|
||||
base.copy_file(platform_args['out_bin_dir'] + "icuuc" + icu_major + ".dll", out_dir)
|
||||
base.copy_file(platform_args['out_lib_dir'] + "icudt.lib", out_dir)
|
||||
base.copy_file(platform_args['out_lib_dir'] + "icuuc.lib", out_dir)
|
||||
|
||||
for platform in need_platforms:
|
||||
if not config.check_option("platform", platform) and not config.check_option("platform", platform + "_xp"):
|
||||
continue
|
||||
if not base.is_dir(platform + "/build"):
|
||||
base.create_dir(platform)
|
||||
compile_bat = []
|
||||
compile_bat.append("setlocal")
|
||||
compile_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + ("x86" if base.platform_is_32(platform) else "x64"))
|
||||
compile_bat.append("call MSBuild.exe icu/source/allinone/allinone.sln /p:Configuration=Release /p:PlatformToolset=" + platformToolset + " /p:Platform=" + ("Win32" if base.platform_is_32(platform) else "X64"))
|
||||
compile_bat.append("endlocal")
|
||||
base.run_as_bat(compile_bat)
|
||||
bin_dir = "icu/bin64/" if ("win_64" == platform) else "icu/bin/"
|
||||
lib_dir = "icu/lib64/" if ("win_64" == platform) else "icu/lib/"
|
||||
base.create_dir(platform + "/build")
|
||||
base.copy_file(bin_dir + "icudt" + icu_major + ".dll", platform + "/build/")
|
||||
base.copy_file(bin_dir + "icuuc" + icu_major + ".dll", platform + "/build/")
|
||||
base.copy_file(lib_dir + "icudt.lib", platform + "/build/")
|
||||
base.copy_file(lib_dir + "icuuc.lib", platform + "/build/")
|
||||
|
||||
if not (config.check_option("platform", "win_64_xp") or config.check_option("platform", "win_32_xp")):
|
||||
build_icu_win("icu", platform + "/build", icu_major)
|
||||
else:
|
||||
# xp
|
||||
build_icu_win("icu58", platform + "/build/xp", icu_major_old)
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
if ("linux" == base.host_platform()):
|
||||
if not base.is_file("./icu/source/i18n/digitlst.cpp.bak"):
|
||||
base.copy_file("./icu/source/i18n/digitlst.cpp", "./icu/source/i18n/digitlst.cpp.bak")
|
||||
base.replaceInFile("./icu/source/i18n/digitlst.cpp", "xlocale", "locale")
|
||||
if base.is_dir(base_dir + "/linux_64"):
|
||||
base.delete_dir(base_dir + "/linux_64")
|
||||
if base.is_dir(base_dir + "/linux_arm64"):
|
||||
base.delete_dir(base_dir + "/linux_arm64")
|
||||
|
||||
if not base.is_dir(base_dir + "/linux_64"):
|
||||
base.create_dir(base_dir + "/icu/cross_build")
|
||||
os.chdir("icu/cross_build")
|
||||
@ -96,20 +132,36 @@ def make():
|
||||
if "1" == config.option("use-clang"):
|
||||
command_configure = "CXXFLAGS=-stdlib=libc++ " + command_configure
|
||||
command_compile_addon = "-stdlib=libc++"
|
||||
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)
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
if "" == config.option("sysroot"):
|
||||
base.cmd(command_configure, ["Linux", "--prefix=" + base_dir + "/icu/cross_build_install"])
|
||||
base.replaceInFile("./../source/icudefs.mk.in", "LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)", "LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS) " + command_compile_addon)
|
||||
else:
|
||||
base.set_sysroot_env()
|
||||
base.cmd_exe("./../source/configure", ["--prefix=" + base_dir + "/icu/cross_build_install",
|
||||
"CC=" + config.get_custom_sysroot_bin() + "/gcc", "CXX=" + config.get_custom_sysroot_bin() + "/g++",
|
||||
"AR=" + config.get_custom_sysroot_bin() + "/ar", "RANLIB=" + config.get_custom_sysroot_bin() + "/ranlib",
|
||||
"CFLAGS=--sysroot=" + config.option("sysroot"),
|
||||
"CXXFLAGS=--sysroot=" + config.option("sysroot") + " " + command_compile_addon,
|
||||
"LDFLAGS=--sysroot=" + config.option("sysroot")])
|
||||
|
||||
if "" == config.option("sysroot"):
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
else:
|
||||
base.cmd_exe("make", ["-j4"])
|
||||
base.cmd_exe("make", ["install"], True)
|
||||
base.restore_sysroot_env()
|
||||
|
||||
base.create_dir(base_dir + "/linux_64")
|
||||
base.create_dir(base_dir + "/linux_64/build")
|
||||
base.copy_file(base_dir + "/icu/cross_build_install/lib/libicudata.so." + icu_major + "." + icu_minor, base_dir + "/linux_64/build/libicudata.so." + icu_major)
|
||||
base.copy_file(base_dir + "/icu/cross_build_install/lib/libicuuc.so." + icu_major + "." + icu_minor, base_dir + "/linux_64/build/libicuuc.so." + icu_major)
|
||||
base.copy_dir(base_dir + "/icu/cross_build_install/include", base_dir + "/linux_64/build/include")
|
||||
|
||||
|
||||
if config.check_option("platform", "linux_arm64") and not base.is_dir(base_dir + "/linux_arm64") and not base.is_os_arm():
|
||||
base.create_dir(base_dir + "/icu/linux_arm64")
|
||||
os.chdir(base_dir + "/icu/linux_arm64")
|
||||
base_arm_tool_dir = base.get_prefix_cross_compiler_arm64()
|
||||
base_arm_tool_dir = config.option('arm64-toolchain-bin') + '/' + base.get_prefix_cross_compiler_arm64()
|
||||
base.cmd("./../source/configure", ["--host=arm-linux", "--prefix=" + base_dir + "/icu/linux_arm64_install", "--with-cross-build=" + base_dir + "/icu/cross_build",
|
||||
"CC=" + base_arm_tool_dir + "gcc", "CXX=" + base_arm_tool_dir + "g++", "AR=" + base_arm_tool_dir + "ar", "RANLIB=" + base_arm_tool_dir + "ranlib"])
|
||||
base.cmd("make", ["-j4"])
|
||||
@ -135,6 +187,6 @@ def make():
|
||||
if (-1 != config.option("platform").find("ios")):
|
||||
if not base.is_dir("build"):
|
||||
base.bash("./icu_ios")
|
||||
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
@ -5,37 +5,29 @@ sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
|
||||
def change_icu_defs(current_dir, arch):
|
||||
icudef_file = current_dir + "/icudefs.mk"
|
||||
icudef_file_old = current_dir + "/icudefs.mk.back"
|
||||
def change_icu_defs(arch):
|
||||
old_env = dict(os.environ)
|
||||
|
||||
param = "-arch x86_64"
|
||||
if arch == "arm64":
|
||||
param = "-arch arm64 -isysroot " + base.find_mac_sdk()
|
||||
param = "-arch arm64"
|
||||
|
||||
param += " -isysroot " + base.find_mac_sdk()
|
||||
param += " -mmacosx-version-min=10.12"
|
||||
|
||||
base.copy_file(icudef_file, icudef_file_old)
|
||||
os.environ["CFLAGS"] = param
|
||||
os.environ["CXXFLAGS"] = param + " --std=c++11"
|
||||
os.environ["LDFLAGS"] = param
|
||||
|
||||
base.replaceInFile(icudef_file, "CFLAGS = ", "CFLAGS = " + param + " ")
|
||||
base.replaceInFile(icudef_file, "CXXFLAGS = ", "CXXFLAGS = " + param + " ")
|
||||
base.replaceInFile(icudef_file, "RPATHLDFLAGS =", "RPATHLDFLAGS2 =")
|
||||
base.replaceInFile(icudef_file, "LDFLAGS = ", "LDFLAGS = " + param + " ")
|
||||
base.replaceInFile(icudef_file, "RPATHLDFLAGS2 =", "RPATHLDFLAGS =")
|
||||
return old_env
|
||||
|
||||
def restore_icu_defs(old_env):
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
return
|
||||
|
||||
def restore_icu_defs(current_dir):
|
||||
icudef_file = current_dir + "/icudefs.mk"
|
||||
icudef_file_old = current_dir + "/icudefs.mk.back"
|
||||
|
||||
base.delete_file(icudef_file)
|
||||
base.copy_file(icudef_file_old, icudef_file)
|
||||
base.delete_file(icudef_file_old)
|
||||
return
|
||||
|
||||
icu_major = "58"
|
||||
icu_minor = "3"
|
||||
icu_major = "74"
|
||||
icu_minor = "2"
|
||||
|
||||
current_dir_old = os.getcwd()
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu"
|
||||
@ -46,29 +38,33 @@ if not base.is_dir(current_dir + "/mac_cross_64"):
|
||||
base.create_dir(current_dir + "/mac_cross_64")
|
||||
os.chdir(current_dir + "/mac_cross_64")
|
||||
|
||||
base.cmd("../icu/source/runConfigureICU", ["MacOSX",
|
||||
"--prefix=" + current_dir + "/mac_cross_64", "CFLAGS=-Os CXXFLAGS=--std=c++11"])
|
||||
old_env = change_icu_defs("x86_64")
|
||||
|
||||
change_icu_defs(current_dir + "/mac_cross_64", "x86_64")
|
||||
base.cmd("../icu/source/runConfigureICU", ["MacOSX",
|
||||
"--prefix=" + current_dir + "/mac_cross_64", "--enable-static"])
|
||||
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
|
||||
restore_icu_defs(current_dir + "/mac_cross_64")
|
||||
restore_icu_defs(old_env)
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
os.chdir(current_dir + "/icu/source")
|
||||
|
||||
base.cmd("./configure", ["--prefix=" + current_dir + "/mac_arm_64",
|
||||
"--with-cross-build=" + current_dir + "/mac_cross_64", "VERBOSE=1"])
|
||||
old_env = change_icu_defs("arm64")
|
||||
|
||||
change_icu_defs(current_dir + "/icu/source", "arm64")
|
||||
addon = []
|
||||
if not base.is_os_arm():
|
||||
addon = ["--host=aarch64-apple-darwin"]
|
||||
|
||||
base.cmd("./configure", ["--prefix=" + current_dir + "/mac_arm_64",
|
||||
"--with-cross-build=" + current_dir + "/mac_cross_64", "--enable-static", "VERBOSE=1"] + addon)
|
||||
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"])
|
||||
|
||||
restore_icu_defs(current_dir + "/icu/source")
|
||||
restore_icu_defs(old_env)
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
@ -85,12 +81,22 @@ base.create_dir(current_dir + "/mac_arm64")
|
||||
base.create_dir(current_dir + "/mac_arm64/build")
|
||||
|
||||
base.copy_dir(current_dir + "/mac_cross_64/include", current_dir + "/mac_64/build/include")
|
||||
# copy shared libs
|
||||
base.copy_file(current_dir + "/mac_cross_64/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file(current_dir + "/mac_cross_64/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicuuc." + icu_major + ".dylib")
|
||||
# copy static libs
|
||||
base.copy_file(current_dir + "/mac_cross_64/lib/libicudata.a", current_dir + "/mac_64/build")
|
||||
base.copy_file(current_dir + "/mac_cross_64/lib/libicui18n.a", current_dir + "/mac_64/build")
|
||||
base.copy_file(current_dir + "/mac_cross_64/lib/libicuuc.a", current_dir + "/mac_64/build")
|
||||
|
||||
base.copy_dir(current_dir + "/mac_arm_64/include", current_dir + "/mac_arm64/build/include")
|
||||
# copy shared libs
|
||||
base.copy_file(current_dir + "/mac_arm_64/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file(current_dir + "/mac_arm_64/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicuuc." + icu_major + ".dylib")
|
||||
# copy static libs
|
||||
base.copy_file(current_dir + "/mac_arm_64/lib/libicudata.a", current_dir + "/mac_arm64/build")
|
||||
base.copy_file(current_dir + "/mac_arm_64/lib/libicui18n.a", current_dir + "/mac_arm64/build")
|
||||
base.copy_file(current_dir + "/mac_arm_64/lib/libicuuc.a", current_dir + "/mac_arm64/build")
|
||||
|
||||
base.delete_dir(current_dir + "/mac_cross_64")
|
||||
base.delete_dir(current_dir + "/mac_arm_64")
|
||||
|
||||
@ -54,6 +54,14 @@ def make():
|
||||
qmake_bat.append("call nmake clean")
|
||||
qmake_bat.append("call nmake build_libs install")
|
||||
base.run_as_bat(qmake_bat, True)
|
||||
if (-1 != config.option("platform").find("win_arm64")) and not base.is_dir("../build/win_arm64"):
|
||||
base.create_dir("./../build/win_arm64")
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x64_arm64")
|
||||
qmake_bat.append("perl Configure VC-WIN64-ARM --prefix=" + old_cur_dir + "\\build\\win_arm64 --openssldir=" + old_cur_dir + "\\build\\win_arm64 no-shared no-asm enable-md2")
|
||||
qmake_bat.append("call nmake clean")
|
||||
qmake_bat.append("call nmake build_libs install")
|
||||
base.run_as_bat(qmake_bat, True)
|
||||
os.chdir(old_cur)
|
||||
# xp ----------------------------------------------------------------------------------------------------
|
||||
os.chdir(base_dir + "/openssl")
|
||||
@ -79,22 +87,32 @@ def make():
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
return
|
||||
|
||||
if (-1 != config.option("platform").find("linux")) and not base.is_dir("../build/linux_64"):
|
||||
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")
|
||||
base.replaceInFile("./Makefile", "CXX=$(CROSS_COMPILE)g++", "CXX=$(CROSS_COMPILE)clang++")
|
||||
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden -stdlib=libc++")
|
||||
base.replaceInFile("./Makefile", "LDFLAGS", "LDFLAGS=-stdlib=libc++")
|
||||
else:
|
||||
base.replaceInFile("./Makefile", "LDFLAGS=", "LDFLAGS=-stdlib=libc++")
|
||||
elif config.option("sysroot") == "":
|
||||
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
|
||||
base.cmd("make")
|
||||
base.cmd("make", ["install"])
|
||||
base.cmd("make", ["clean"], True)
|
||||
# TODO: support x86
|
||||
else:
|
||||
base.replaceInFile("./Makefile", "CROSS_COMPILE=", "CROSS_COMPILE=" + config.get_custom_sysroot_bin() + "/")
|
||||
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden --sysroot=" + config.option("sysroot"))
|
||||
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden --sysroot=" + config.option("sysroot"))
|
||||
|
||||
if config.option("sysroot") == "":
|
||||
base.cmd("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)
|
||||
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()):
|
||||
|
||||
@ -26,6 +26,8 @@ def clean():
|
||||
def is_main_platform():
|
||||
if (config.check_option("platform", "win_64") or config.check_option("platform", "win_32")):
|
||||
return True
|
||||
if (config.check_option("platform", "win_arm64")):
|
||||
return True
|
||||
if (config.check_option("platform", "linux_64") or config.check_option("platform", "linux_32") or config.check_option("platform", "linux_arm64")):
|
||||
return True
|
||||
if config.check_option("platform", "mac_64"):
|
||||
@ -45,7 +47,7 @@ def is_use_clang():
|
||||
gcc_version = base.get_gcc_version()
|
||||
|
||||
is_clang = "false"
|
||||
if (gcc_version >= 6000 or "1" == config.option("use-clang")):
|
||||
if config.option("sysroot") == "" and (gcc_version >= 6000 or "1" == config.option("use-clang")):
|
||||
is_clang = "true"
|
||||
|
||||
print("gcc version: " + str(gcc_version) + ", use clang:" + is_clang)
|
||||
|
||||
@ -44,7 +44,13 @@ def make_args(args, platform, is_64=True, is_debug=False):
|
||||
args_copy.append("target_cpu=\\\"arm64\\\"")
|
||||
args_copy.append("v8_target_cpu=\\\"arm64\\\"")
|
||||
args_copy.append("use_sysroot=true")
|
||||
|
||||
|
||||
if (platform == "win_arm64"):
|
||||
args_copy = args[:]
|
||||
args_copy.append("target_cpu=\\\"arm64\\\"")
|
||||
args_copy.append("v8_target_cpu=\\\"arm64\\\"")
|
||||
args_copy.append("is_clang=false")
|
||||
|
||||
if is_debug:
|
||||
args_copy.append("is_debug=true")
|
||||
if (platform == "windows"):
|
||||
@ -53,13 +59,18 @@ def make_args(args, platform, is_64=True, is_debug=False):
|
||||
args_copy.append("is_debug=false")
|
||||
|
||||
linux_clang = False
|
||||
if (platform == "linux"):
|
||||
args_copy.append("is_clang=true")
|
||||
if "1" == config.option("use-clang"):
|
||||
args_copy.append("use_sysroot=true")
|
||||
linux_clang = True
|
||||
else:
|
||||
if platform == "linux":
|
||||
if "" != config.option("sysroot"):
|
||||
args_copy.append("use_sysroot=false")
|
||||
args_copy.append("is_clang=false")
|
||||
else:
|
||||
args_copy.append("is_clang=true")
|
||||
if "1" == config.option("use-clang"):
|
||||
linux_clang = True
|
||||
else:
|
||||
args_copy.append("use_sysroot=false")
|
||||
|
||||
|
||||
if (platform == "windows"):
|
||||
args_copy.append("is_clang=false")
|
||||
|
||||
@ -68,12 +79,21 @@ def make_args(args, platform, is_64=True, is_debug=False):
|
||||
|
||||
return "--args=\"" + " ".join(args_copy) + "\""
|
||||
|
||||
def ninja_windows_make(args, is_64=True, is_debug=False):
|
||||
def ninja_windows_make(args, is_64=True, is_debug=False, is_arm=False):
|
||||
directory_out = "out.gn/"
|
||||
directory_out += ("win_64/" if is_64 else "win_32/")
|
||||
|
||||
if is_arm:
|
||||
directory_out += "win_arm64/"
|
||||
else:
|
||||
directory_out += ("win_64/" if is_64 else "win_32/")
|
||||
|
||||
directory_out += ("debug" if is_debug else "release")
|
||||
|
||||
base.cmd2("gn", ["gen", directory_out, make_args(args, "windows", is_64, is_debug)])
|
||||
if is_arm:
|
||||
base.cmd2("gn", ["gen", directory_out, make_args(args, "win_arm64", is_64, is_debug)])
|
||||
else:
|
||||
base.cmd2("gn", ["gen", directory_out, make_args(args, "windows", is_64, is_debug)])
|
||||
|
||||
base.copy_file("./" + directory_out + "/obj/v8_wrappers.ninja", "./" + directory_out + "/obj/v8_wrappers.ninja.bak")
|
||||
base.replaceInFile("./" + directory_out + "/obj/v8_wrappers.ninja", "target_output_name = v8_wrappers", "target_output_name = v8_wrappers\nbuild obj/v8_wrappers.obj: cxx ../../../src/base/platform/wrappers.cc")
|
||||
base.replaceInFile("./" + directory_out + "/obj/v8_wrappers.ninja", "build obj/v8_wrappers.lib: alink", "build obj/v8_wrappers.lib: alink obj/v8_wrappers.obj")
|
||||
@ -83,7 +103,10 @@ def ninja_windows_make(args, is_64=True, is_debug=False):
|
||||
if (-1 == win_toolset_wrapper_file_content.find("line = line.decode('utf8')")):
|
||||
base.replaceInFile(win_toolset_wrapper_file, "for line in link.stdout:\n", "for line in link.stdout:\n line = line.decode('utf8')\n")
|
||||
|
||||
|
||||
base.cmd("ninja", ["-C", directory_out, "v8_wrappers"])
|
||||
if is_arm:
|
||||
base.copy_file('./' + directory_out + '/obj/v8_wrappers.lib', './' + directory_out + '/x64/obj/v8_wrappers.lib')
|
||||
base.cmd("ninja", ["-C", directory_out])
|
||||
base.delete_file("./" + directory_out + "/obj/v8_wrappers.ninja")
|
||||
base.move_file("./" + directory_out + "/obj/v8_wrappers.ninja.bak", "./" + directory_out + "/obj/v8_wrappers.ninja")
|
||||
@ -149,8 +172,19 @@ def make():
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
base.replaceInFile("v8/build/config/win/BUILD.gn", ":static_crt", ":dynamic_crt")
|
||||
|
||||
# fix for new depot_tools and vs2019, as VC folder contains a folder with a symbol in the name
|
||||
# sorting is done by increasing version, so 0 is a dummy value
|
||||
replace_src = " def to_int_if_int(x):\n try:\n return int(x)\n except ValueError:\n return x"
|
||||
replace_dst = " def to_int_if_int(x):\n try:\n return int(x)\n except ValueError:\n return 0"
|
||||
base.replaceInFile("v8/build/vs_toolchain.py", replace_src, replace_dst)
|
||||
|
||||
|
||||
if not base.is_file("v8/src/base/platform/wrappers.cc"):
|
||||
base.writeFile("v8/src/base/platform/wrappers.cc", "#include \"src/base/platform/wrappers.h\"\n")
|
||||
|
||||
if config.check_option("platform", "win_arm64"):
|
||||
base.replaceInFile("v8/build/toolchain/win/setup_toolchain.py", "SDK_VERSION = \'10.0.26100.0\'", "SDK_VERSION = \'10.0.22621.0\'")
|
||||
else:
|
||||
base.replaceInFile("depot_tools/gclient_paths.py", "@functools.lru_cache", "")
|
||||
|
||||
@ -172,8 +206,24 @@ def make():
|
||||
"treat_warnings_as_errors=false"]
|
||||
|
||||
if config.check_option("platform", "linux_64"):
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_64", make_args(gn_args, "linux")])
|
||||
base.cmd("ninja", ["-C", "out.gn/linux_64"])
|
||||
if config.option("sysroot") != "":
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
|
||||
if config.check_option("platform", "linux_32"):
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_32", make_args(gn_args, "linux", False)])
|
||||
@ -187,6 +237,9 @@ def make():
|
||||
if config.check_option("platform", "mac_64"):
|
||||
base.cmd2("gn", ["gen", "out.gn/mac_64", make_args(gn_args, "mac")])
|
||||
base.cmd("ninja", ["-C", "out.gn/mac_64"])
|
||||
|
||||
if config.check_option("platform", "win_arm64") and not base.is_file("out.gn/win_arm64/release/obj/v8_monolith.lib"):
|
||||
ninja_windows_make(gn_args, True, False, True)
|
||||
|
||||
if config.check_option("platform", "win_64"):
|
||||
if (-1 != config.option("config").lower().find("debug")):
|
||||
|
||||
@ -15,6 +15,7 @@ def make():
|
||||
continue
|
||||
|
||||
root_dir = base_dir + ("/" + native_platform + "/" + branding + ("/DocumentBuilder" if base.is_windows() else "/documentbuilder"))
|
||||
root_dir_win64 = base_dir + "/win_64/" + branding + "/DocumentBuilder"
|
||||
if (base.is_dir(root_dir)):
|
||||
base.delete_dir(root_dir)
|
||||
base.create_dir(root_dir)
|
||||
@ -57,17 +58,7 @@ def make():
|
||||
# base.generate_check_linux_system(git_dir + "/build_tools", root_dir)
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/icudt58.dll")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icuuc58.dll", root_dir + "/icuuc58.dll")
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", root_dir + "/libicudata.so.58")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.so.58", root_dir + "/libicuuc.so.58")
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.58.dylib", root_dir + "/libicudata.58.dylib")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.58.dylib", root_dir + "/libicuuc.58.dylib")
|
||||
base.deploy_icu(core_dir, root_dir, native_platform)
|
||||
|
||||
# doctrenderer
|
||||
if isWindowsXP:
|
||||
@ -106,23 +97,24 @@ def make():
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/src/docbuilder_midl.h", root_dir + "/include/docbuilder_midl.h")
|
||||
base.replaceInFile(root_dir + "/include/docbuilder.h", "Q_DECL_EXPORT", "BUILDING_DOCBUILDER")
|
||||
|
||||
|
||||
if ("win_64" == platform):
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/deploy/win_64/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.net/deploy/win_64/docbuilder.net.dll", root_dir + "/docbuilder.net.dll")
|
||||
|
||||
|
||||
elif ("win_32" == platform):
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/deploy/win_32/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.net/deploy/win_32/docbuilder.net.dll", root_dir + "/docbuilder.net.dll")
|
||||
|
||||
# correct ios frameworks
|
||||
if ("ios" == platform):
|
||||
base.generate_plist(root_dir)
|
||||
base.for_each_framework(root_dir, "ios", callbacks=[base.generate_plist, base.generate_xcprivacy])
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.linux_correct_rpath_docbuilder(root_dir)
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.for_each_framework(root_dir, "mac", callbacks=[base.generate_plist], max_depth=1)
|
||||
base.mac_correct_rpath_x2t(root_dir)
|
||||
base.mac_correct_rpath_docbuilder(root_dir)
|
||||
|
||||
@ -134,12 +126,12 @@ def make():
|
||||
base.copy_dir(git_dir + "/core-fonts/crosextra", root_dir + "/fonts/crosextra")
|
||||
base.copy_dir(git_dir + "/core-fonts/openoffice", root_dir + "/fonts/openoffice")
|
||||
base.copy_file(git_dir + "/core-fonts/ASC.ttf", root_dir + "/fonts/ASC.ttf")
|
||||
|
||||
|
||||
# delete unnecessary builder files
|
||||
def delete_files(files):
|
||||
for file in files:
|
||||
base.delete_file(file)
|
||||
|
||||
|
||||
delete_files(base.find_files(root_dir, "*.wasm"))
|
||||
delete_files(base.find_files(root_dir, "*_ie.js"))
|
||||
base.delete_file(root_dir + "/sdkjs/pdf/src/engine/cmap.bin")
|
||||
@ -153,4 +145,3 @@ def make():
|
||||
base.delete_dir(root_dir + "/sdkjs/common/Images")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@ -53,7 +53,8 @@ def make():
|
||||
if ("windows" == base.host_platform()):
|
||||
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*.dll", archive_dir + "/")
|
||||
else:
|
||||
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*", archive_dir + "/")
|
||||
if not (0 == platform.find("mac") and config.check_option("config", "bundle_dylibs")):
|
||||
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*", archive_dir + "/")
|
||||
base.copy_v8_files(core_dir, archive_dir, platform)
|
||||
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "allfontsgen")
|
||||
@ -66,6 +67,11 @@ def make():
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "metafiletester")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "dictionariestester")
|
||||
|
||||
# correct mac frameworks
|
||||
if (0 == platform.find("mac")):
|
||||
base.for_each_framework(archive_dir, "mac", callbacks=[base.generate_plist], max_depth=1)
|
||||
base.mac_correct_rpath_x2t(archive_dir)
|
||||
|
||||
# js cache
|
||||
base.generate_doctrenderer_config(archive_dir + "/DoctRenderer.config", "./", "builder", "", "./dictionaries")
|
||||
base.create_x2t_js_cache(archive_dir, "core", platform)
|
||||
@ -74,4 +80,3 @@ def make():
|
||||
# dictionaries
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", archive_dir + "/dictionaries", True, False)
|
||||
return
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ def copy_lib_with_links(src_dir, dst_dir, lib, version):
|
||||
lib_major_name = lib + "." + major_version
|
||||
|
||||
base.copy_file(src_dir + "/" + lib_full_name, dst_dir + "/" + lib_full_name)
|
||||
|
||||
|
||||
base.cmd_in_dir(dst_dir, "ln", ["-s", "./" + lib_full_name, "./" + lib_major_name])
|
||||
base.cmd_in_dir(dst_dir, "ln", ["-s", "./" + lib_major_name, "./" + lib])
|
||||
|
||||
@ -72,7 +72,7 @@ def make():
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "IWorkFile")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "HWPFile")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "DocxRenderer")
|
||||
|
||||
|
||||
if ("ios" == platform):
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "x2t")
|
||||
else:
|
||||
@ -82,24 +82,13 @@ def make():
|
||||
# base.generate_check_linux_system(git_dir + "/build_tools", root_dir + "/converter")
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/converter/icudt58.dll")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icuuc58.dll", root_dir + "/converter/icuuc58.dll")
|
||||
#base.copy_file(git_dir + "/desktop-apps/common/converter/package.config", root_dir + "/converter/package.config")
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", root_dir + "/converter/libicudata.so.58")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.so.58", root_dir + "/converter/libicuuc.so.58")
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.58.dylib", root_dir + "/converter/libicudata.58.dylib")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.58.dylib", root_dir + "/converter/libicuuc.58.dylib")
|
||||
base.deploy_icu(core_dir, root_dir + "/converter", native_platform)
|
||||
|
||||
# doctrenderer
|
||||
if isWindowsXP:
|
||||
base.copy_lib(build_libraries_path + "/xp", root_dir + "/converter", "doctrenderer")
|
||||
else:
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "doctrenderer")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "doctrenderer")
|
||||
base.copy_v8_files(core_dir, root_dir + "/converter", platform, isWindowsXP)
|
||||
|
||||
base.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop", "", "../dictionaries")
|
||||
@ -128,6 +117,20 @@ def make():
|
||||
else:
|
||||
base.copy_files(core_dir + "/Common/3dParty/cef/" + native_platform + "/" + build_dir_name + "/*", root_dir)
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
dir_base_old = os.getcwd()
|
||||
os.chdir(root_dir + "/Chromium Embedded Framework.framework")
|
||||
base.create_dir("Versions")
|
||||
base.create_dir("Versions/A")
|
||||
base.move_file("Chromium Embedded Framework", "Versions/A/Chromium Embedded Framework")
|
||||
base.move_dir("Resources", "Versions/A/Resources")
|
||||
base.move_dir("Libraries", "Versions/A/Libraries")
|
||||
base.cmd("ln", ["-s", "Versions/A/Chromium Embedded Framework", "Chromium Embedded Framework"])
|
||||
base.cmd("ln", ["-s", "Versions/A/Resources", "Resources"])
|
||||
base.cmd("ln", ["-s", "Versions/A/Libraries", "Libraries"])
|
||||
base.cmd("ln", ["-s", "A", "Versions/Current"])
|
||||
os.chdir(dir_base_old);
|
||||
|
||||
isUseQt = True
|
||||
if (0 == platform.find("mac")) or (0 == platform.find("ios")):
|
||||
isUseQt = False
|
||||
@ -138,18 +141,18 @@ def make():
|
||||
base.copy_lib(build_libraries_path + ("/xp" if isWindowsXP else ""), root_dir, "ascdocumentscore")
|
||||
if (0 != platform.find("mac")):
|
||||
base.copy_lib(build_libraries_path + ("/xp" if isWindowsXP else ""), root_dir, "qtascdocumentscore")
|
||||
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.copy_dir(core_build_dir + "/bin/" + platform_postfix + "/editors_helper.app", root_dir + "/editors_helper.app")
|
||||
else:
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "editors_helper")
|
||||
|
||||
|
||||
if isUseQt:
|
||||
base.qt_copy_lib("Qt5Core", root_dir)
|
||||
base.qt_copy_lib("Qt5Gui", root_dir)
|
||||
base.qt_copy_lib("Qt5PrintSupport", root_dir)
|
||||
base.qt_copy_lib("Qt5Svg", root_dir)
|
||||
base.qt_copy_lib("Qt5Widgets", root_dir)
|
||||
base.qt_copy_lib("Qt5Widgets", root_dir)
|
||||
base.qt_copy_lib("Qt5Network", root_dir)
|
||||
base.qt_copy_lib("Qt5OpenGL", root_dir)
|
||||
|
||||
@ -158,7 +161,7 @@ def make():
|
||||
base.qt_copy_plugin("imageformats", root_dir)
|
||||
base.qt_copy_plugin("platforms", root_dir)
|
||||
base.qt_copy_plugin("platforminputcontexts", root_dir)
|
||||
base.qt_copy_plugin("printsupport", root_dir)
|
||||
base.qt_copy_plugin("printsupport", root_dir)
|
||||
|
||||
base.qt_copy_plugin("platformthemes", root_dir)
|
||||
base.qt_copy_plugin("xcbglintegrations", root_dir)
|
||||
@ -190,9 +193,9 @@ def make():
|
||||
|
||||
if base.check_congig_option_with_platfom(platform, "libvlc"):
|
||||
vlc_dir = git_dir + "/core/Common/3dParty/libvlc/build/" + platform + "/lib"
|
||||
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_dir(vlc_dir + "/plugins", root_dir + "/plugins")
|
||||
base.copy_dir(vlc_dir + "/plugins", root_dir + "/plugins")
|
||||
base.copy_files(vlc_dir + "/*.dll", root_dir)
|
||||
base.copy_file(vlc_dir + "/vlc-cache-gen.exe", root_dir + "/vlc-cache-gen.exe")
|
||||
elif (0 == platform.find("linux")):
|
||||
@ -238,7 +241,20 @@ def make():
|
||||
#base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt/ui/common/{14A8FC87-8E26-4216-B34E-F27F053B2EC4}", root_dir + "/editors/sdkjs-plugins/{14A8FC87-8E26-4216-B34E-F27F053B2EC4}")
|
||||
#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
|
||||
if isWindowsXP:
|
||||
isUseAgent = False
|
||||
|
||||
if (isUseAgent):
|
||||
agent_plugin_dir = git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/ai-agent"
|
||||
if (False):
|
||||
base.cmd_in_dir(agent_plugin_dir, "npm", ["install"], True)
|
||||
base.cmd_in_dir(agent_plugin_dir, "npm", ["run", "build"], True)
|
||||
base.copy_dir(agent_plugin_dir + "/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}", root_dir + "/editors/sdkjs-plugins/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}")
|
||||
else:
|
||||
base.copy_dir(agent_plugin_dir + "/deploy/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}", root_dir + "/editors/sdkjs-plugins/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}")
|
||||
|
||||
base.copy_file(base_dir + "/js/" + branding + "/desktop/index.html", root_dir + "/index.html")
|
||||
base.create_dir(root_dir + "/editors/webext")
|
||||
base.copy_file(base_dir + "/js/" + branding + "/desktop/noconnect.html", root_dir + "/editors/webext/noconnect.html")
|
||||
@ -249,14 +265,12 @@ 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")):
|
||||
file_size_doctrenderer = os.path.getsize(root_dir + "/converter/libdoctrenderer.dylib")
|
||||
doctrenderer_lib = "libdoctrenderer.dylib"
|
||||
if config.check_option("config", "bundle_dylibs"):
|
||||
doctrenderer_lib = "doctrenderer.framework/doctrenderer"
|
||||
file_size_doctrenderer = os.path.getsize(root_dir + "/converter/" + doctrenderer_lib)
|
||||
print("file_size_doctrenderer: " + str(file_size_doctrenderer))
|
||||
if (file_size_doctrenderer < 5*1024*1024):
|
||||
isUseJSC = True
|
||||
@ -270,29 +284,36 @@ def make():
|
||||
base.delete_file(root_dir + "/cef_sandbox.lib")
|
||||
base.delete_file(root_dir + "/libcef.lib")
|
||||
|
||||
isMacArmPlaformOnIntel = False
|
||||
if (platform == "mac_arm64") and not base.is_os_arm():
|
||||
isMacArmPlaformOnIntel = True
|
||||
is_host_not_arm = False
|
||||
host_platform = ""
|
||||
if (platform == "mac_arm64" or platform == "win_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"
|
||||
|
||||
# all themes generate ----
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "allfontsgen")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "allthemesgen")
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
# gen plists with max_depth 2 because frameworks are only located in root_dir and converter subdirectory
|
||||
base.for_each_framework(root_dir, "mac", callbacks=[base.generate_plist], max_depth=2)
|
||||
base.mac_correct_rpath_desktop(root_dir)
|
||||
|
||||
if isMacArmPlaformOnIntel:
|
||||
if is_host_not_arm:
|
||||
sdkjs_dir = root_dir + "/editors/sdkjs"
|
||||
end_find_platform = sdkjs_dir.rfind("/mac_arm64/")
|
||||
sdkjs_dir_mac64 = sdkjs_dir[0:end_find_platform] + "/mac_64/" + sdkjs_dir[end_find_platform+11:]
|
||||
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_mac64, sdkjs_dir)
|
||||
base.copy_dir(sdkjs_dir_64, sdkjs_dir)
|
||||
else:
|
||||
themes_params = []
|
||||
if ("" != config.option("themesparams")):
|
||||
themes_params = ["--params=\"" + config.option("themesparams") + "\""]
|
||||
base.cmd_exe(root_dir + "/converter/allfontsgen", ["--use-system=\"1\"", "--input=\"" + root_dir + "/fonts\"", "--input=\"" + git_dir + "/core-fonts\"", "--allfonts=\"" + root_dir + "/converter/AllFonts.js\"", "--selection=\"" + root_dir + "/converter/font_selection.bin\""])
|
||||
base.cmd_exe(root_dir + "/converter/allthemesgen", ["--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\""] + themes_params)
|
||||
base.cmd_exe(root_dir + "/converter/allfontsgen", ["--use-system=\"1\"", "--input=\"" + root_dir + "/fonts\"", "--input=\"" + git_dir + "/core-fonts\"", "--allfonts=\"" + root_dir + "/converter/AllFonts.js\"", "--selection=\"" + root_dir + "/converter/font_selection.bin\""], True)
|
||||
base.cmd_exe(root_dir + "/converter/allthemesgen", ["--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\""] + themes_params, True)
|
||||
base.delete_file(root_dir + "/converter/AllFonts.js")
|
||||
base.delete_file(root_dir + "/converter/font_selection.bin")
|
||||
base.delete_file(root_dir + "/converter/fonts.log")
|
||||
@ -304,4 +325,3 @@ def make():
|
||||
base.delete_file(root_dir + "/editors/sdkjs/slide/sdk-all.cache")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ def deploy_fonts(git_dir, root_dir, platform=""):
|
||||
if (platform == "android"):
|
||||
base.copy_dir(git_dir + "/core-fonts/dejavu", root_dir + "/fonts/dejavu")
|
||||
base.copy_dir(git_dir + "/core-fonts/liberation", root_dir + "/fonts/liberation")
|
||||
return
|
||||
return
|
||||
|
||||
def make():
|
||||
base_dir = base.get_script_dir() + "/../out"
|
||||
@ -35,7 +35,7 @@ def make():
|
||||
|
||||
if base.get_env("DESTDIR_BUILD_OVERRIDE") != "":
|
||||
return
|
||||
|
||||
|
||||
if (base.is_dir(root_dir)):
|
||||
base.delete_dir(root_dir)
|
||||
base.create_dir(root_dir)
|
||||
@ -73,29 +73,14 @@ def make():
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "x2t")
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/icudt58.dll")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icuuc58.dll", root_dir + "/icuuc58.dll")
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", root_dir + "/libicudata.so.58")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.so.58", root_dir + "/libicuuc.so.58")
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.58.dylib", root_dir + "/libicudata.58.dylib")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.58.dylib", root_dir + "/libicuuc.58.dylib")
|
||||
|
||||
if (0 == platform.find("android")):
|
||||
#base.copy_file(core_dir + "/Common/3dParty/icu/android/build/" + platform[8:] + "/libicudata.so", root_dir + "/libicudata.so")
|
||||
#base.copy_file(core_dir + "/Common/3dParty/icu/android/build/" + platform[8:] + "/libicuuc.so", root_dir + "/libicuuc.so")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/android/build/" + platform[8:] + "/icudt58l.dat", root_dir + "/icudt58l.dat")
|
||||
base.deploy_icu(core_dir, root_dir, platform)
|
||||
|
||||
# js
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/mobile/sdkjs", root_dir + "/sdkjs")
|
||||
|
||||
# correct ios frameworks
|
||||
if ("ios" == platform):
|
||||
base.generate_plist(root_dir)
|
||||
base.for_each_framework(root_dir, "ios", callbacks=[base.generate_plist, base.generate_xcprivacy])
|
||||
deploy_fonts(git_dir, root_dir)
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", root_dir + "/dictionaries", True, False)
|
||||
|
||||
@ -115,7 +100,7 @@ def make():
|
||||
deploy_fonts(git_dir, root_dir, "android")
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", root_dir + "/dictionaries", True, False)
|
||||
# app
|
||||
base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder", "", "./dictionaries")
|
||||
base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder", "", "./dictionaries")
|
||||
libs_dir = root_dir + "/lib"
|
||||
base.create_dir(libs_dir + "/arm64-v8a")
|
||||
base.copy_files(base_dir + "/android_arm64_v8a/" + branding + "/mobile/*.so", libs_dir + "/arm64-v8a")
|
||||
|
||||
@ -18,7 +18,7 @@ def make():
|
||||
|
||||
if base.get_env("DESTDIR_BUILD_OVERRIDE") != "":
|
||||
return
|
||||
|
||||
|
||||
if (base.is_dir(root_dir)):
|
||||
base.delete_dir(root_dir)
|
||||
base.create_dir(root_dir)
|
||||
@ -37,7 +37,7 @@ def make():
|
||||
|
||||
# correct ios frameworks
|
||||
if ("ios" == platform):
|
||||
base.generate_plist(root_dir)
|
||||
base.for_each_framework(root_dir, "ios", callbacks=[base.generate_plist, base.generate_xcprivacy])
|
||||
|
||||
for native_platform in platforms:
|
||||
if native_platform == "android":
|
||||
|
||||
@ -58,6 +58,14 @@ def make():
|
||||
base.create_dir(build_server_dir + '/Metrics/node_modules/modern-syslog/build/Release')
|
||||
base.copy_file(server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node", build_server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node")
|
||||
|
||||
# AdminPanel server part
|
||||
base.create_dir(build_server_dir + '/AdminPanel/server')
|
||||
base.copy_exe(server_dir + "/AdminPanel/server", build_server_dir + '/AdminPanel/server', "adminpanel")
|
||||
|
||||
# AdminPanel client part
|
||||
base.create_dir(build_server_dir + '/AdminPanel/client/build')
|
||||
base.copy_dir(server_dir + '/AdminPanel/client/build', build_server_dir + '/AdminPanel/client/build')
|
||||
|
||||
qt_dir = base.qt_setup(native_platform)
|
||||
platform = native_platform
|
||||
|
||||
@ -94,24 +102,18 @@ def make():
|
||||
base.generate_doctrenderer_config(converter_dir + "/DoctRenderer.config", "../../../", "server", "", "../../../dictionaries")
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", converter_dir + "/icudt58.dll")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icuuc58.dll", converter_dir + "/icuuc58.dll")
|
||||
base.deploy_icu(core_dir, converter_dir, platform)
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", converter_dir + "/libicudata.so.58")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.so.58", converter_dir + "/libicuuc.so.58")
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.58.dylib", converter_dir + "/libicudata.58.dylib")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.58.dylib", converter_dir + "/libicuuc.58.dylib")
|
||||
|
||||
base.copy_v8_files(core_dir, converter_dir, platform)
|
||||
|
||||
# builder
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, converter_dir, "docbuilder")
|
||||
base.copy_dir(git_dir + "/document-templates/new/en-US", converter_dir + "/empty")
|
||||
|
||||
# correct mac frameworks
|
||||
if (0 == platform.find("mac")):
|
||||
base.for_each_framework(converter_dir, "mac", callbacks=[base.generate_plist], max_depth=1)
|
||||
|
||||
# js
|
||||
js_dir = root_dir
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", js_dir + "/sdkjs")
|
||||
@ -124,7 +126,7 @@ def make():
|
||||
|
||||
# add embed worker code
|
||||
base.cmd_in_dir(git_dir + "/sdkjs/common/embed", "python", ["make.py", js_dir + "/web-apps/apps/api/documents/api.js"])
|
||||
|
||||
|
||||
# plugins
|
||||
base.create_dir(js_dir + "/sdkjs-plugins")
|
||||
base.copy_marketplace_plugin(js_dir + "/sdkjs-plugins", False, True)
|
||||
@ -146,7 +148,7 @@ def make():
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, tools_dir, "allthemesgen")
|
||||
if ("1" != config.option("preinstalled-plugins")):
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, tools_dir, "pluginsmanager")
|
||||
|
||||
|
||||
branding_dir = server_dir + "/branding"
|
||||
if("" != config.option("branding") and "onlyoffice" != config.option("branding")):
|
||||
branding_dir = git_dir + '/' + config.option("branding") + '/server'
|
||||
@ -228,4 +230,3 @@ def make():
|
||||
base.delete_file(root_dir_snap + '/example/nodejs/example')
|
||||
|
||||
return
|
||||
|
||||
|
||||
@ -131,6 +131,9 @@ def make_inno(edition = "opensource"):
|
||||
if common.sign:
|
||||
args += ["-Sign"]
|
||||
|
||||
if xp:
|
||||
args += ["-TimestampServer", "http://timestamp.comodoca.com/authenticode"]
|
||||
|
||||
utils.log_h2("desktop inno " + edition + " build")
|
||||
ret = utils.ps1("make_inno.ps1", args, verbose=True)
|
||||
utils.set_summary("desktop inno " + edition + " build", ret)
|
||||
|
||||
@ -25,7 +25,7 @@ def get_j_num():
|
||||
|
||||
def check_support_platform(platform):
|
||||
qt_dir = base.qt_setup(platform)
|
||||
if not base.is_file(qt_dir + "/bin/qmake") and not base.is_file(qt_dir + "/bin/qmake.exe"):
|
||||
if not base.is_file(qt_dir + "/bin/qmake") and not base.is_file(qt_dir + "/bin/qmake.exe") and not base.is_file(qt_dir + "/bin/qmake.bat"):
|
||||
return False
|
||||
return True
|
||||
|
||||
@ -91,6 +91,7 @@ def make(platform, project, qmake_config_addon="", is_no_errors=False):
|
||||
build_params = ["-nocache", file_pro] + base.qt_config_as_param(config_param) + qmake_addon
|
||||
|
||||
qmake_app = qt_dir + "/bin/qmake"
|
||||
|
||||
# non windows platform
|
||||
if not base.is_windows():
|
||||
if base.is_file(qt_dir + "/onlyoffice_qt.conf"):
|
||||
@ -99,7 +100,12 @@ 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++")
|
||||
base.cmd(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")):
|
||||
base.cmd_and_return_cwd("make", clean_params, True)
|
||||
@ -116,12 +122,22 @@ def make(platform, project, qmake_config_addon="", is_no_errors=False):
|
||||
if ("" != qmake_addon_string):
|
||||
qmake_addon_string = " " + qmake_addon_string
|
||||
|
||||
vcvarsall_arch = "x64"
|
||||
if base.platform_is_32(platform):
|
||||
vcvarsall_arch = "x86"
|
||||
if (platform == "win_arm64"):
|
||||
vcvarsall_arch = "x64_arm64"
|
||||
|
||||
qmake_env_addon = base.get_env("QT_QMAKE_ADDON")
|
||||
if (qmake_env_addon != ""):
|
||||
qmake_env_addon += " "
|
||||
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + ("x86" if base.platform_is_32(platform) else "x64"))
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + vcvarsall_arch)
|
||||
qmake_addon_string = ""
|
||||
if ("" != config.option("qmake_addon")):
|
||||
qmake_addon_string = " " + (" ").join(["\"" + addon + "\"" for addon in qmake_addon])
|
||||
qmake_bat.append("call \"" + qmake_app + "\" -nocache " + file_pro + config_params_string + qmake_addon_string)
|
||||
qmake_bat.append("call \"" + qmake_app + "\" -nocache " + qmake_env_addon + file_pro + config_params_string + qmake_addon_string)
|
||||
if ("1" == config.option("clean")):
|
||||
qmake_bat.append("call nmake " + " ".join(clean_params))
|
||||
qmake_bat.append("call nmake " + " ".join(distclean_params))
|
||||
|
||||
5
tools/linux/arm/cross_arm64/.gitignore
vendored
Normal file
5
tools/linux/arm/cross_arm64/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
qt_source*
|
||||
qt_binary*
|
||||
qt_build*
|
||||
qt-*
|
||||
gcc-linaro-*
|
||||
103
tools/linux/arm/cross_arm64/build_qt.py
Normal file
103
tools/linux/arm/cross_arm64/build_qt.py
Normal file
@ -0,0 +1,103 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.append('../../../../scripts')
|
||||
|
||||
import base
|
||||
|
||||
def update_qmake_conf(arm_toolchain_bin):
|
||||
replace_file = "./qt-everywhere-src-5.15.2/qtbase/mkspecs/linux-aarch64-gnu-g++/qmake.conf"
|
||||
arm_toolchain_bin = os.path.abspath(arm_toolchain_bin)
|
||||
|
||||
replace_src = ""
|
||||
replace_src += "# modifications to g++.conf\n"
|
||||
replace_src += "QMAKE_CC = aarch64-linux-gnu-gcc\n"
|
||||
replace_src += "QMAKE_CXX = aarch64-linux-gnu-g++\n"
|
||||
replace_src += "QMAKE_LINK = aarch64-linux-gnu-g++\n"
|
||||
replace_src += "QMAKE_LINK_SHLIB = aarch64-linux-gnu-g++\n"
|
||||
replace_src += "\n"
|
||||
replace_src += "# modifications to linux.conf\n"
|
||||
replace_src += "QMAKE_AR = aarch64-linux-gnu-ar cqs\n"
|
||||
replace_src += "QMAKE_OBJCOPY = aarch64-linux-gnu-objcopy\n"
|
||||
replace_src += "QMAKE_NM = aarch64-linux-gnu-nm -P\n"
|
||||
replace_src += "QMAKE_STRIP = aarch64-linux-gnu-strip\n"
|
||||
|
||||
replace_dst = ""
|
||||
replace_dst += "# modifications to g++.conf\n"
|
||||
replace_dst += "QMAKE_CC = " + arm_toolchain_bin + "/aarch64-linux-gnu-gcc\n"
|
||||
replace_dst += "QMAKE_CXX = " + arm_toolchain_bin + "/aarch64-linux-gnu-g++\n"
|
||||
replace_dst += "QMAKE_LINK = " + arm_toolchain_bin + "/aarch64-linux-gnu-g++\n"
|
||||
replace_dst += "QMAKE_LINK_SHLIB = " + arm_toolchain_bin + "/aarch64-linux-gnu-g++\n"
|
||||
replace_dst += "\n"
|
||||
replace_dst += "# modifications to linux.conf\n"
|
||||
replace_dst += "QMAKE_AR = " + arm_toolchain_bin + "/aarch64-linux-gnu-ar cqs\n"
|
||||
replace_dst += "QMAKE_OBJCOPY = " + arm_toolchain_bin + "/aarch64-linux-gnu-objcopy\n"
|
||||
replace_dst += "QMAKE_NM = " + arm_toolchain_bin + "/aarch64-linux-gnu-nm -P\n"
|
||||
replace_dst += "QMAKE_STRIP = " + arm_toolchain_bin + "/aarch64-linux-gnu-strip\n"
|
||||
|
||||
base.replaceInFile(replace_file, replace_src, replace_dst)
|
||||
|
||||
def make(arm_toolchain_bin=""):
|
||||
qt_build_path = os.path.dirname(os.path.abspath(__file__)) + "/qt_build/Qt-5.15.2/linux_arm64"
|
||||
qt_params = ["-opensource",
|
||||
"-confirm-license",
|
||||
"-release",
|
||||
"-shared",
|
||||
"-accessibility",
|
||||
"-prefix", "\"" + qt_build_path + "\"",
|
||||
"-extprefix", "\"" + qt_build_path + "\"",
|
||||
"-hostprefix", "\"" + qt_build_path + "\"",
|
||||
"-c++std", "c++11",
|
||||
"-qt-zlib",
|
||||
"-qt-libpng",
|
||||
"-qt-libjpeg",
|
||||
"-qt-pcre",
|
||||
"-no-sql-sqlite",
|
||||
"-no-opengl",
|
||||
"-nomake", "examples",
|
||||
"-nomake", "tests",
|
||||
"-skip", "qtlocation",
|
||||
"-skip", "qtserialport",
|
||||
"-skip", "qtsensors",
|
||||
"-skip", "qtxmlpatterns",
|
||||
"-skip", "qt3d",
|
||||
"-skip", "qtwebview",
|
||||
"-skip", "qtwebengine",
|
||||
"-skip", "qtdeclarative",
|
||||
"-xplatform", "linux-aarch64-gnu-g++", # be sure that aarch64 gnu compiler is installed
|
||||
"-no-pch"]
|
||||
|
||||
qt_params_str = ""
|
||||
for param in qt_params:
|
||||
qt_params_str += (param + " ")
|
||||
|
||||
qt_url = "https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/qt/qt-everywhere-src-5.15.2.tar.xz"
|
||||
if not base.is_file("./qt_source_5.15.2.tar.xz"):
|
||||
base.download(qt_url, "./qt_source_5.15.2.tar.xz")
|
||||
|
||||
if not base.is_dir("./qt-everywhere-src-5.15.2"):
|
||||
base.cmd("tar", ["-xf", "./qt_source_5.15.2.tar.xz"])
|
||||
|
||||
# https://bugreports.qt.io/browse/QTBUG-93452
|
||||
# for GCC 11 and Qt5/Qt6
|
||||
additional_gcc_11 = "#ifdef __cplusplus\n#include <limits>\n#endif\n"
|
||||
chanage_file = "./qt-everywhere-src-5.15.2/qtbase/src/corelib/global/qglobal.h"
|
||||
filedata = base.readFile(chanage_file)
|
||||
if filedata.find(additional_gcc_11) == -1:
|
||||
filedata = additional_gcc_11 + filedata
|
||||
base.writeFile(chanage_file, filedata)
|
||||
|
||||
if arm_toolchain_bin != "":
|
||||
update_qmake_conf(arm_toolchain_bin)
|
||||
|
||||
base.cmd_in_dir("./qt-everywhere-src-5.15.2", "./configure " + qt_params_str)
|
||||
base.cmd_in_dir("./qt-everywhere-src-5.15.2", "make -j4")
|
||||
base.cmd_in_dir("./qt-everywhere-src-5.15.2", "make install")
|
||||
|
||||
if __name__ == "__main__":
|
||||
arm_toolchain_path = "./gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu/bin"
|
||||
if len(sys.argv) != 1:
|
||||
arm_toolchain_path = sys.argv[1]
|
||||
|
||||
make(arm_toolchain_path)
|
||||
16
tools/linux/arm/cross_arm64/download_arm_toolchain.py
Normal file
16
tools/linux/arm/cross_arm64/download_arm_toolchain.py
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.append('../../../../scripts')
|
||||
|
||||
import base
|
||||
|
||||
def make():
|
||||
arm_toolchain_url = 'https://releases.linaro.org/components/toolchain/binaries/5.4-2017.05/aarch64-linux-gnu/'
|
||||
arm_toolchain_tar_filename = 'gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz'
|
||||
base.cmd2('wget', [arm_toolchain_url + arm_toolchain_tar_filename])
|
||||
base.cmd2('tar', ['-xf', arm_toolchain_tar_filename])
|
||||
|
||||
if __name__ == "__main__":
|
||||
make()
|
||||
22
tools/linux/arm/cross_arm64/fetch_qt.py
Normal file
22
tools/linux/arm/cross_arm64/fetch_qt.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.append('../../../scripts')
|
||||
|
||||
import base
|
||||
|
||||
|
||||
def make():
|
||||
qt_build_path = os.path.dirname(os.path.abspath(__file__)) + "/qt_build/Qt-5.15.2"
|
||||
qt_binary_url = "https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/qt/qt_binary_linux_arm64.7z"
|
||||
|
||||
if not base.is_file("./qt_binary_linux_arm64.7z"):
|
||||
base.download(qt_binary_url, "./qt_binary_linux_arm64.7z")
|
||||
|
||||
if not base.is_dir(qt_build_path):
|
||||
os.makedirs(qt_build_path)
|
||||
base.cmd("tar", ["-xf", "./qt_binary_linux_arm64.7z", "-C", qt_build_path])
|
||||
|
||||
if __name__ == "__main__":
|
||||
make()
|
||||
10
tools/linux/arm/cross_arm64/linux-arm64.toolchain.cmake
Normal file
10
tools/linux/arm/cross_arm64/linux-arm64.toolchain.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||
|
||||
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
|
||||
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
5
tools/linux/arm/cross_arm64/pyrightconfig.json
Normal file
5
tools/linux/arm/cross_arm64/pyrightconfig.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"exclude": [
|
||||
"qt-everywhere-src-5.15.2/**"
|
||||
]
|
||||
}
|
||||
@ -20,7 +20,7 @@ def get_branch_name(directory):
|
||||
def install_qt():
|
||||
# qt
|
||||
if not base.is_file("./qt_source_5.9.9.tar.xz"):
|
||||
base.download("https://download.qt.io/new_archive/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz", "./qt_source_5.9.9.tar.xz")
|
||||
base.download("https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/qt/qt-everywhere-opensource-src-5.9.9.tar.xz", "./qt_source_5.9.9.tar.xz")
|
||||
|
||||
if not base.is_dir("./qt-everywhere-opensource-src-5.9.9"):
|
||||
base.cmd("tar", ["-xf", "./qt_source_5.9.9.tar.xz"])
|
||||
@ -57,7 +57,7 @@ def install_qt():
|
||||
return
|
||||
|
||||
def install_qt_prebuild():
|
||||
url_amd64 = "https://s3.eu-west-1.amazonaws.com/static-doc.teamlab.eu.com/qt/5.9.9/linux_amd64/qt_binary.7z"
|
||||
url_amd64 = "https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/qt/qt_binary_linux_amd64.7z"
|
||||
base.download(url_amd64, "./qt_amd64.7z")
|
||||
base.extract("./qt_amd64.7z", "./qt_build")
|
||||
base.create_dir("./qt_build/Qt-5.9.9")
|
||||
@ -71,7 +71,10 @@ if not base.is_file("./node_js_setup_14.x"):
|
||||
|
||||
if not base.is_dir("./qt_build"):
|
||||
print("install qt...")
|
||||
install_qt_prebuild()
|
||||
if base.get_env("DO_NOT_USE_PREBUILD_QT") == "1":
|
||||
install_qt()
|
||||
else:
|
||||
install_qt_prebuild()
|
||||
|
||||
branch = get_branch_name("../..")
|
||||
|
||||
|
||||
Binary file not shown.
82
tools/linux/sysroot/build_sysroot.py
Executable file
82
tools/linux/sysroot/build_sysroot.py
Executable file
@ -0,0 +1,82 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../../scripts')
|
||||
import base
|
||||
import os
|
||||
import shutil
|
||||
import fix_symlinks
|
||||
|
||||
def bash_chroot(command, sysroot):
|
||||
base.cmd2('sudo -S chroot', [sysroot, '/bin/bash -c', '\"' + command + ' \"'])
|
||||
|
||||
|
||||
def download_sysroot():
|
||||
curr_dir = base.get_script_dir(__file__)
|
||||
tmp_sysroot_ubuntu_dir = curr_dir + '/sysroot_ubuntu_1604'
|
||||
|
||||
if os.path.isdir(tmp_sysroot_ubuntu_dir):
|
||||
shutil.rmtree(tmp_sysroot_ubuntu_dir)
|
||||
|
||||
# debootstrap for downloading sysroot
|
||||
base.cmd2('sudo -S apt-get', ['install', 'debootstrap'])
|
||||
|
||||
archive_ubuntu_url = 'http://archive.ubuntu.com/ubuntu/'
|
||||
base.cmd2('sudo -S debootstrap', ['--arch=amd64', 'xenial', tmp_sysroot_ubuntu_dir, archive_ubuntu_url])
|
||||
|
||||
# setup a new sources
|
||||
base.cmd2('sudo -S cp', [curr_dir + '/sources.list', tmp_sysroot_ubuntu_dir + '/etc/apt/sources.list'])
|
||||
|
||||
bash_chroot('apt update -y', tmp_sysroot_ubuntu_dir)
|
||||
bash_chroot('apt upgrade -y', tmp_sysroot_ubuntu_dir)
|
||||
|
||||
apt_libs = ["build-essential"]
|
||||
apt_libs += ["libpthread-stubs0-dev"]
|
||||
apt_libs += ["zlib1g-dev"]
|
||||
apt_libs += ["curl"]
|
||||
apt_libs += ["libc6-dev"]
|
||||
apt_libs += ["glib-2.0-dev"]
|
||||
apt_libs += ["libglu1-mesa-dev"]
|
||||
apt_libs += ["libgtk-3-dev"]
|
||||
apt_libs += ["libpulse-dev"]
|
||||
apt_libs += ["libasound2-dev"]
|
||||
apt_libs += ["libatspi2.0-dev"]
|
||||
apt_libs += ["libcups2-dev"]
|
||||
apt_libs += ["libdbus-1-dev"]
|
||||
apt_libs += ["libicu-dev"]
|
||||
apt_libs += ["libgstreamer1.0-dev"]
|
||||
apt_libs += ["libgstreamer-plugins-base1.0-dev"]
|
||||
apt_libs += ["libx11-xcb-dev"]
|
||||
apt_libs += ["libxcb*"]
|
||||
apt_libs += ["libxi-dev"]
|
||||
apt_libs += ["libxrender-dev"]
|
||||
apt_libs += ["libxss-dev"]
|
||||
apt_libs += ["libxkbcommon-dev"]
|
||||
apt_libs += ["libxkbcommon-x11-dev"]
|
||||
apt_libs += ["libnotify-dev"]
|
||||
apt_libs += ["gtk+-3.0-dev"]
|
||||
|
||||
apt_libs_str = ""
|
||||
for apt_lib in apt_libs:
|
||||
apt_libs_str += apt_lib + " "
|
||||
bash_chroot('apt install -y ' + apt_libs_str, tmp_sysroot_ubuntu_dir)
|
||||
|
||||
# # downloading arm toolchain
|
||||
arm_toolchain_url = 'https://releases.linaro.org/components/toolchain/binaries/5.4-2017.05/aarch64-linux-gnu/'
|
||||
arm_toolchain_tar_filename = 'gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz'
|
||||
arm_toolchain_output_dir = 'gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu'
|
||||
base.cmd2('wget', [arm_toolchain_url + arm_toolchain_tar_filename])
|
||||
base.cmd2('tar', ['-xf', arm_toolchain_tar_filename])
|
||||
base.cmd2('sudo -S rsync', ['-avh', '--progress', curr_dir + '/' + arm_toolchain_output_dir + '/', tmp_sysroot_ubuntu_dir + '/usr/'])
|
||||
shutil.rmtree(arm_toolchain_output_dir)
|
||||
os.remove(arm_toolchain_tar_filename)
|
||||
|
||||
base.cmd2('sudo -S chmod', ['-R', 'o+rwx', tmp_sysroot_ubuntu_dir])
|
||||
|
||||
# fix symlinks
|
||||
fix_symlinks.fix_symlinks(tmp_sysroot_ubuntu_dir)
|
||||
|
||||
return
|
||||
|
||||
if __name__ == '__main__':
|
||||
download_sysroot()
|
||||
4
tools/linux/sysroot/custom-sysroot.toolchain.cmake
Normal file
4
tools/linux/sysroot/custom-sysroot.toolchain.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
set(CMAKE_C_FLAGS $ENV{CFLAGS})
|
||||
set(CMAKE_CXX_FLAGS $ENV{CXXFLAGS})
|
||||
set(CMAKE_C_LINKER_FLAGS $ENV{LDFLAGS})
|
||||
set(CMAKE_CXX_LINKER_FLAGS $ENV{LDFLAGS})
|
||||
45
tools/linux/sysroot/fix_symlinks.py
Normal file
45
tools/linux/sysroot/fix_symlinks.py
Normal file
@ -0,0 +1,45 @@
|
||||
import os
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
# change symbolic link to relative paths
|
||||
def fix_symlinks(top_dir='./sysroot_ubuntu_1604'):
|
||||
for root, dirs, files in os.walk(top_dir):
|
||||
for name in files:
|
||||
path = os.path.join(root, name)
|
||||
if not os.path.islink(path):
|
||||
continue
|
||||
try:
|
||||
target = os.readlink(path)
|
||||
except OSError as e:
|
||||
print(f"Error reading link '{path}': {e}", file=sys.stderr)
|
||||
continue
|
||||
|
||||
if not target.startswith('/'):
|
||||
continue
|
||||
|
||||
new_target = top_dir + target
|
||||
new_target_rel = os.path.relpath(new_target, os.path.dirname(path))
|
||||
temp_name = f".tmp.{uuid.uuid4().hex}"
|
||||
temp_path = os.path.join(root, temp_name)
|
||||
try:
|
||||
os.symlink(new_target_rel, temp_path)
|
||||
except OSError as e:
|
||||
print(f"Failed to create temporary symlink for '{path}': {e}", file=sys.stderr)
|
||||
continue
|
||||
try:
|
||||
os.replace(temp_path, path)
|
||||
print(f"Updated: {path} -> {new_target_rel}")
|
||||
except OSError as e:
|
||||
print(f"Failed to replace symlink '{path}': {e}", file=sys.stderr)
|
||||
try:
|
||||
os.unlink(temp_path)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1:
|
||||
directory = sys.argv[1]
|
||||
else:
|
||||
directory = './sysroot_ubuntu_1604'
|
||||
fix_symlinks(directory)
|
||||
51
tools/linux/sysroot/sources.list
Normal file
51
tools/linux/sysroot/sources.list
Normal file
@ -0,0 +1,51 @@
|
||||
#deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
|
||||
|
||||
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
|
||||
# newer versions of the distribution.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
|
||||
|
||||
## Major bug fix updates produced after the final release of the
|
||||
## distribution.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
|
||||
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team. Also, please note that software in universe WILL NOT receive any
|
||||
## review or updates from the Ubuntu security team.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
|
||||
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team, and may not be under a free licence. Please satisfy yourself as to
|
||||
## your rights to use the software. Also, please note that software in
|
||||
## multiverse WILL NOT receive any review or updates from the Ubuntu
|
||||
## security team.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
|
||||
|
||||
## N.B. software from this repository may not have been tested as
|
||||
## extensively as that contained in the main release, although it includes
|
||||
## newer versions of some applications which may provide useful features.
|
||||
## Also, please note that software in backports WILL NOT receive any review
|
||||
## or updates from the Ubuntu security team.
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
|
||||
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
|
||||
|
||||
## Uncomment the following two lines to add software from Canonical's
|
||||
## 'partner' repository.
|
||||
## This software is not part of Ubuntu, but is offered by Canonical and the
|
||||
## respective vendors as a service to Ubuntu users.
|
||||
# deb http://archive.canonical.com/ubuntu xenial partner
|
||||
# deb-src http://archive.canonical.com/ubuntu xenial partner
|
||||
|
||||
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
|
||||
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
|
||||
deb http://security.ubuntu.com/ubuntu xenial-security universe
|
||||
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
|
||||
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
|
||||
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
|
||||
5
tools/win/arm64/.gitignore
vendored
Normal file
5
tools/win/arm64/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
tmp.bat
|
||||
qt_source*
|
||||
qt_binary*
|
||||
qt_build*
|
||||
qt-*
|
||||
77
tools/win/arm64/build_qt.py
Normal file
77
tools/win/arm64/build_qt.py
Normal file
@ -0,0 +1,77 @@
|
||||
import sys
|
||||
import os
|
||||
sys.path.append('../../../scripts')
|
||||
|
||||
import base
|
||||
|
||||
def get_vs_path(version = "2019"):
|
||||
vs_path = ""
|
||||
programFilesDir = base.get_env("ProgramFiles")
|
||||
if ("" != base.get_env("ProgramFiles(x86)")):
|
||||
programFilesDir = base.get_env("ProgramFiles(x86)")
|
||||
if ("2015" == version):
|
||||
vs_path = programFilesDir + "/Microsoft Visual Studio 14.0/VC"
|
||||
elif ("2019" == version):
|
||||
if base.is_dir(programFilesDir + "/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build"):
|
||||
vs_path = programFilesDir + "/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build"
|
||||
elif base.is_dir(programFilesDir + "/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build"):
|
||||
vs_path = programFilesDir + "/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build"
|
||||
else:
|
||||
vs_path = programFilesDir + "/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build"
|
||||
|
||||
return vs_path
|
||||
|
||||
def make():
|
||||
qt_build_path = os.path.dirname(os.path.abspath(__file__)) + "/qt_build/Qt-5.15.2/win_arm64"
|
||||
qt_params = ["-opensource",
|
||||
"-confirm-license",
|
||||
"-release",
|
||||
"-shared",
|
||||
"-accessibility",
|
||||
"-prefix", "\"" + qt_build_path + "\"",
|
||||
"-extprefix", "\"" + qt_build_path + "\"",
|
||||
"-hostprefix", "\"" + qt_build_path + "\"",
|
||||
"-c++std", "c++11",
|
||||
"-qt-zlib",
|
||||
"-qt-libpng",
|
||||
"-qt-libjpeg",
|
||||
"-qt-pcre",
|
||||
"-no-sql-sqlite",
|
||||
"-no-qml-debug",
|
||||
"-nomake", "examples",
|
||||
"-nomake", "tests",
|
||||
"-skip", "qtlocation",
|
||||
"-skip", "qtserialport",
|
||||
"-skip", "qtsensors",
|
||||
"-skip", "qtxmlpatterns",
|
||||
"-skip", "qt3d",
|
||||
"-skip", "qtwebview",
|
||||
"-skip", "qtwebengine",
|
||||
"-xplatform", "win32-arm64-msvc2017",
|
||||
"-mp",
|
||||
"-no-pch"]
|
||||
|
||||
qt_params_str = ""
|
||||
for param in qt_params:
|
||||
qt_params_str += (param + " ")
|
||||
|
||||
qt_url = "https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/qt/qt-everywhere-src-5.15.2.tar.xz"
|
||||
if not base.is_file("./qt_source_5.15.2.tar.xz"):
|
||||
base.download(qt_url, "./qt_source_5.15.2.tar.xz")
|
||||
|
||||
if not base.is_dir("./qt-everywhere-src-5.15.2"):
|
||||
base.cmd("tar", ["-xf", "./qt_source_5.15.2.tar.xz"])
|
||||
|
||||
vs_path = get_vs_path()
|
||||
vcvarsall_host_arch = "x64"
|
||||
|
||||
qt_build_bat = []
|
||||
qt_build_bat.append("call \"" + vs_path + "/vcvarsall.bat\" " + vcvarsall_host_arch) # for nmake
|
||||
qt_build_bat.append("cd qt-everywhere-src-5.15.2")
|
||||
qt_build_bat.append("call configure " + qt_params_str)
|
||||
qt_build_bat.append("call nmake")
|
||||
qt_build_bat.append("call nmake install")
|
||||
base.run_as_bat(qt_build_bat)
|
||||
|
||||
if __name__ == "__main__":
|
||||
make()
|
||||
20
tools/win/arm64/fetch_qt.py
Normal file
20
tools/win/arm64/fetch_qt.py
Normal file
@ -0,0 +1,20 @@
|
||||
import sys
|
||||
import os
|
||||
sys.path.append('../../../scripts')
|
||||
|
||||
import base
|
||||
|
||||
def make():
|
||||
qt_build_path = os.path.dirname(os.path.abspath(__file__)) + "/qt_build/Qt-5.15.2"
|
||||
qt_binary_url = "https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/qt/qt_binary_win_arm64.7z"
|
||||
|
||||
if not base.is_file("./qt_binary_win_arm64.7z"):
|
||||
base.download(qt_binary_url, "./qt_binary_win_arm64.7z")
|
||||
|
||||
if not base.is_dir(qt_build_path):
|
||||
os.makedirs(qt_build_path)
|
||||
base.extract("./qt_binary_win_arm64.7z", qt_build_path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
base.configure_common_apps()
|
||||
make()
|
||||
5
tools/win/arm64/pyrightconfig.json
Normal file
5
tools/win/arm64/pyrightconfig.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"exclude": [
|
||||
"qt-everywhere-src-5.15.2/**"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user