mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
Compare commits
82 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a35214b2b | |||
| e93317ebb2 | |||
| 8381ef6c24 | |||
| d5bf7cff40 | |||
| a00f198a33 | |||
| 3d9870e8a3 | |||
| 070c77f11a | |||
| b34e11cfdf | |||
| 25a453fa1e | |||
| 830b01114a | |||
| 48f2d54676 | |||
| c3ab2959bd | |||
| 4e5fe85e6d | |||
| 730b2e5adb | |||
| 5217b7c342 | |||
| ee22cbca1b | |||
| c1e21f9884 | |||
| 74a6da2f57 | |||
| c25c28333a | |||
| fc80745b8d | |||
| b361128ec4 | |||
| fa7dfa2e96 | |||
| bb58688b49 | |||
| 676b519f46 | |||
| 626a121eb0 | |||
| c89a54ccf4 | |||
| 23a7b9cc87 | |||
| 351192378d | |||
| aa978f56d1 | |||
| df98984a40 | |||
| 1af7d31285 | |||
| 3942c2f69a | |||
| 8c93a0ebae | |||
| e9359c86d2 | |||
| afde46bbae | |||
| ee9fed8fe8 | |||
| 68a2eb8742 | |||
| d582343874 | |||
| ac071bd62b | |||
| b6260f100a | |||
| 0fb4a31c3c | |||
| 407db1a1ae | |||
| 2abdf201df | |||
| 8a61529d41 | |||
| cf5b322852 | |||
| 42ac2b9907 | |||
| 917165cc86 | |||
| 12c18895e9 | |||
| 832147f4d2 | |||
| a9ad740efe | |||
| 0b33ff68bf | |||
| d685720dd6 | |||
| c305cf4684 | |||
| f254b46efc | |||
| b627457c98 | |||
| a739db1854 | |||
| 5631c9825e | |||
| 11487b4fd2 | |||
| 7bb5eba0ea | |||
| 284b7e2f90 | |||
| b3b23e4d47 | |||
| f09cd28ba3 | |||
| 7cd507d023 | |||
| 68cfbf067d | |||
| 9538741b11 | |||
| 7219c65dcb | |||
| 938019d26f | |||
| c4b81dc438 | |||
| 46bbbd1bc0 | |||
| bb690328a8 | |||
| 5e7b22b6d7 | |||
| 4a4e8b7568 | |||
| 26ce05f76c | |||
| 1f3f801124 | |||
| 63a6ecd17f | |||
| 55448fcb73 | |||
| 6364de594f | |||
| dd8145083e | |||
| d17eec062c | |||
| 22d8c377df | |||
| ad12cc9a54 | |||
| baee5f58b8 |
@ -4,9 +4,10 @@ ENV TZ=Etc/UTC
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN apt-get -y update && \
|
||||
apt-get -y install python3 \
|
||||
apt-get -y install python \
|
||||
python3 \
|
||||
sudo
|
||||
|
||||
RUN rm /usr/bin/python && ln -s /usr/bin/python2 /usr/bin/python
|
||||
ADD . /build_tools
|
||||
WORKDIR /build_tools
|
||||
|
||||
|
||||
3
Rakefile
3
Rakefile
@ -2,8 +2,9 @@
|
||||
|
||||
desc 'Cleanup old build files'
|
||||
task :clean do
|
||||
archive_name_pattern = 'build_tools*.tar.gz'
|
||||
sh('sudo rm -rf out')
|
||||
sh('rm build_tools*.tar.gz')
|
||||
sh("rm #{archive_name_pattern}") unless Dir.glob(archive_name_pattern).empty?
|
||||
end
|
||||
|
||||
desc 'Build version anew'
|
||||
|
||||
@ -267,8 +267,8 @@ epubfile.makefile = $$CORE_ROOT_DIR/EpubFile/Makefile.EpubFile$$PRO_SUF
|
||||
}
|
||||
|
||||
desktop {
|
||||
hunspell.file = $$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt/hunspell.pro
|
||||
hunspell.makefile = $$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt/Makefile.hunspell$$PRO_SUFFIX
|
||||
hunspell.file = $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro
|
||||
hunspell.makefile = $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/Makefile.hunspell$$PRO_SUFFIX
|
||||
|
||||
ooxmlsignature.file = $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/ooxmlsignature.pro
|
||||
ooxmlsignature.makefile = $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/Makefile.ooxmlsignature$$PRO_SUFFIX
|
||||
@ -353,4 +353,4 @@ desktop {
|
||||
xlsformat \
|
||||
fb2file \
|
||||
epubfile
|
||||
}
|
||||
}
|
||||
|
||||
12
make.py
12
make.py
@ -13,13 +13,13 @@ import build_js
|
||||
import build_server
|
||||
import deploy
|
||||
import make_common
|
||||
import config_server as develop_config_server
|
||||
import dependence
|
||||
import develop
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
base.set_env("BUILD_PLATFORM", config.option("platform"))
|
||||
|
||||
# branding
|
||||
@ -59,13 +59,7 @@ if ("1" == config.option("update")):
|
||||
base.configure_common_apps()
|
||||
|
||||
# developing...
|
||||
if ("1" == config.option("develop")):
|
||||
if not dependence.check_dependencies():
|
||||
exit(1)
|
||||
build_server.build_server_develop()
|
||||
build_js.build_js_develop(base_dir + "/..")
|
||||
develop_config_server.make()
|
||||
exit(0)
|
||||
develop.make();
|
||||
|
||||
# check only js builds
|
||||
if ("1" == base.get_env("OO_ONLY_BUILD_JS")):
|
||||
|
||||
34
make_packages.py
Executable file
34
make_packages.py
Executable file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('scripts')
|
||||
sys.path.append('scripts/develop')
|
||||
sys.path.append('scripts/develop/vendor')
|
||||
sys.path.append('scripts/core_common')
|
||||
sys.path.append('scripts/core_common/modules')
|
||||
import config
|
||||
import base
|
||||
import packages
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
base.set_env("BUILD_PLATFORM", config.option("platform"))
|
||||
|
||||
# branding
|
||||
if ("1" != base.get_env("OO_RUNNING_BRANDING")) and ("" != config.option("branding")):
|
||||
branding_dir = base_dir + "/../" + config.option("branding")
|
||||
|
||||
if base.is_file(branding_dir + "/build_tools/make_packages.py"):
|
||||
base.check_build_version(branding_dir + "/build_tools")
|
||||
base.set_env("OO_RUNNING_BRANDING", "1")
|
||||
base.set_env("OO_BRANDING", config.option("branding"))
|
||||
base.cmd_in_dir(branding_dir + "/build_tools", "python", ["make_packages.py"])
|
||||
exit(0)
|
||||
|
||||
base.check_build_version(base_dir)
|
||||
|
||||
# build packages
|
||||
packages.make()
|
||||
@ -328,11 +328,29 @@ def run_command(sCommand):
|
||||
return result
|
||||
|
||||
def run_command_in_dir(directory, sCommand):
|
||||
dir = get_path(directory)
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(dir)
|
||||
host = host_platform()
|
||||
if (host == 'windows'):
|
||||
dir = get_path(directory)
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(dir)
|
||||
|
||||
ret = run_command(sCommand)
|
||||
os.chdir(cur_dir)
|
||||
|
||||
if (host == 'windows'):
|
||||
os.chdir(cur_dir)
|
||||
return ret
|
||||
|
||||
def exec_command_in_dir(directory, sCommand):
|
||||
host = host_platform()
|
||||
if (host == 'windows'):
|
||||
dir = get_path(directory)
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(dir)
|
||||
|
||||
ret = os.system(sCommand)
|
||||
|
||||
if (host == 'windows'):
|
||||
os.chdir(cur_dir)
|
||||
return ret
|
||||
|
||||
def run_process(args=[]):
|
||||
@ -390,8 +408,10 @@ def git_update(repo, is_no_errors=False, is_current_dir=False):
|
||||
print("branch does not exist...")
|
||||
print("switching to master...")
|
||||
cmd("git", ["checkout", "-f", "master"])
|
||||
cmd("git", ["submodule", "update", "--init", "--recursive"], True)
|
||||
if (0 != config.option("branch").find("tags/")):
|
||||
cmd("git", ["pull"], False if ("1" != config.option("update-light")) else True)
|
||||
cmd("git", ["submodule", "update", "--recursive", "--remote"], True)
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
@ -445,7 +465,7 @@ def create_pull_request(branches_to, repo, is_no_errors=False, is_current_dir=Fa
|
||||
if "" != run_command("git log origin/" + branch_to + "..origin/" + branch_from)["stdout"]:
|
||||
cmd("git", ["checkout", "-f", branch_to], is_no_errors)
|
||||
cmd("git", ["pull"], is_no_errors)
|
||||
cmd("hub", ["pull-request", "--force", "--base", branch_to, "--head", branch_from, "--message", "Merge from " + branch_from + " to " + branch_to], is_no_errors)
|
||||
cmd("gh", ["pr", "create", "--base", branch_to, "--head", branch_from, "--title", "Merge branch " + branch_from + " to " + branch_to, "--body", ""], is_no_errors)
|
||||
if 0 != cmd("git", ["merge", "origin/" + branch_from, "--no-ff", "--no-edit"], is_no_errors):
|
||||
print_error("[git] Conflicts merge " + "origin/" + branch_from + " to " + branch_to + " in repo " + url)
|
||||
cmd("git", ["merge", "--abort"], is_no_errors)
|
||||
@ -501,6 +521,8 @@ def qt_config(platform):
|
||||
config_param += " iphoneos device"
|
||||
if (-1 == config_param_lower.find("debug")):
|
||||
config_param += " release"
|
||||
if ("mac_arm64" == platform):
|
||||
config_param += " apple_silicon use_javascript_core"
|
||||
return config_param
|
||||
|
||||
def qt_major_version():
|
||||
@ -510,7 +532,10 @@ def qt_major_version():
|
||||
def qt_copy_lib(lib, dir):
|
||||
qt_dir = get_env("QT_DEPLOY")
|
||||
if ("windows" == host_platform()):
|
||||
copy_lib(qt_dir, dir, lib)
|
||||
if ("" == qt_dst_postfix()):
|
||||
copy_lib(qt_dir, dir, lib)
|
||||
else:
|
||||
copy_lib(qt_dir, dir, lib + "d")
|
||||
else:
|
||||
copy_file(qt_dir + "/../lib/lib" + lib + ".so." + qt_version(), dir + "/lib" + lib + ".so." + qt_major_version())
|
||||
return
|
||||
@ -550,8 +575,12 @@ def qt_copy_plugin(name, out):
|
||||
for file in glob.glob(out + "/" + name + "/*d.dll"):
|
||||
fileCheck = file[0:-5] + ".dll"
|
||||
if is_file(fileCheck):
|
||||
delete_file(file)
|
||||
|
||||
if ("" == qt_dst_postfix()):
|
||||
delete_file(file)
|
||||
else:
|
||||
delete_file(fileCheck)
|
||||
for file in glob.glob(out + "/" + name + "/*.pdb"):
|
||||
delete_file(file)
|
||||
return
|
||||
|
||||
def qt_dst_postfix():
|
||||
@ -822,13 +851,16 @@ def vcvarsall_end():
|
||||
return
|
||||
|
||||
def run_as_bat(lines, is_no_errors=False):
|
||||
name = "tmp.bat"
|
||||
name = "tmp.bat" if ("windows" == host_platform()) else "./tmp.sh"
|
||||
content = "\n".join(lines)
|
||||
|
||||
file = codecs.open(name, "w", "utf-8")
|
||||
file.write(content)
|
||||
file.close()
|
||||
|
||||
if ("windows" != host_platform()):
|
||||
os.system("chmod +x " + name)
|
||||
|
||||
cmd(name, [], is_no_errors)
|
||||
delete_file(name)
|
||||
return
|
||||
@ -886,7 +918,7 @@ def mac_correct_rpath_x2t(dir):
|
||||
mac_correct_rpath_library("graphics", ["UnicodeConverter", "kernel"])
|
||||
mac_correct_rpath_library("doctrenderer", ["UnicodeConverter", "kernel", "graphics"])
|
||||
mac_correct_rpath_library("HtmlFile2", ["UnicodeConverter", "kernel", "graphics"])
|
||||
mac_correct_rpath_library("EpubFile", ["kernel", "HtmlFile2"])
|
||||
mac_correct_rpath_library("EpubFile", ["kernel", "HtmlFile2", "graphics"])
|
||||
mac_correct_rpath_library("Fb2File", ["UnicodeConverter", "kernel", "graphics"])
|
||||
mac_correct_rpath_library("HtmlRenderer", ["UnicodeConverter", "kernel", "graphics"])
|
||||
mac_correct_rpath_library("PdfWriter", ["UnicodeConverter", "kernel", "graphics"])
|
||||
@ -1049,3 +1081,23 @@ def hack_xcode_ios():
|
||||
with open(get_path(qmake_spec_file), "w") as file:
|
||||
file.write(filedata)
|
||||
return
|
||||
|
||||
def find_mac_sdk_version():
|
||||
sdk_dir = run_command("xcode-select -print-path")['stdout']
|
||||
sdk_dir = os.path.join(sdk_dir, "Platforms/MacOSX.platform/Developer/SDKs")
|
||||
sdks = [re.findall('^MacOSX(1\d\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
|
||||
sdks = [s[0] for s in sdks if s]
|
||||
return sdks[0]
|
||||
|
||||
def find_mac_sdk():
|
||||
return run_command("xcrun --sdk macosx --show-sdk-path")['stdout']
|
||||
|
||||
def get_mac_sdk_version_number():
|
||||
ver = find_mac_sdk_version()
|
||||
ver_arr = ver.split(".")
|
||||
if 0 == len(ver_arr):
|
||||
return 0
|
||||
if 1 == len(ver_arr):
|
||||
return 1000 * int(ver_arr[0])
|
||||
return 1000 * int(ver_arr[0]) + int(ver_arr[1])
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ def parse():
|
||||
global platforms
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp",
|
||||
"linux_64", "linux_32",
|
||||
"mac_64",
|
||||
"mac_64", "mac_arm64",
|
||||
"ios",
|
||||
"android_arm64_v8a", "android_armv7", "android_x86", "android_x86_64"]
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ import icu
|
||||
import openssl
|
||||
import v8
|
||||
import html2
|
||||
import hunspell
|
||||
|
||||
def make():
|
||||
boost.make()
|
||||
@ -21,4 +22,5 @@ def make():
|
||||
openssl.make()
|
||||
v8.make()
|
||||
html2.make()
|
||||
hunspell.make(False)
|
||||
return
|
||||
|
||||
@ -68,12 +68,12 @@ def make():
|
||||
if ("windows" == base.host_platform()):
|
||||
win_toolset = "msvc-14.0"
|
||||
if (-1 != config.option("platform").find("win_64")) and not base.is_dir("../build/win_64"):
|
||||
base.cmd("bootstrap.bat")
|
||||
base.cmd("bootstrap.bat", ["vc14"])
|
||||
base.cmd("b2.exe", ["headers"])
|
||||
base.cmd("b2.exe", ["--clean"])
|
||||
base.cmd("b2.exe", ["--prefix=./../build/win_64", "link=static", "--with-filesystem", "--with-system", "--with-date_time", "--with-regex", "--toolset=" + win_toolset, "address-model=64", "install"])
|
||||
if (-1 != config.option("platform").find("win_32")) and not base.is_dir("../build/win_32"):
|
||||
base.cmd("bootstrap.bat")
|
||||
base.cmd("bootstrap.bat", ["vc14"])
|
||||
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"])
|
||||
@ -87,13 +87,6 @@ def make():
|
||||
base.cmd("./b2", ["--prefix=./../build/linux_64", "link=static", "cxxflags=-fPIC", "install"])
|
||||
# TODO: support x86
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
|
||||
clang_correct()
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex"])
|
||||
base.cmd("./b2", ["headers"])
|
||||
base.cmd("./b2", ["--clean"])
|
||||
base.cmd("./b2", ["--prefix=./../build/mac_64", "link=static", "install"])
|
||||
|
||||
if (-1 != config.option("platform").find("ios")) and not base.is_dir("../build/ios"):
|
||||
clang_correct()
|
||||
os.chdir("../")
|
||||
@ -102,6 +95,20 @@ def make():
|
||||
if (-1 != config.option("platform").find("android")) and not base.is_dir("../build/android"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"])
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "mac_64")
|
||||
directory_build = base_dir + "/build/mac_64/lib"
|
||||
base.delete_file(directory_build + "/libboost_system.a")
|
||||
base.delete_file(directory_build + "/libboost_system.dylib")
|
||||
base.copy_files(directory_build + "/mac_64/*.a", directory_build)
|
||||
|
||||
if (-1 != config.option("platform").find("mac_arm64")) and not base.is_dir("../build/mac_arm64"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "mac_arm64")
|
||||
directory_build = base_dir + "/build/mac_arm64/lib"
|
||||
base.delete_file(directory_build + "/libboost_system.a")
|
||||
base.delete_file(directory_build + "/libboost_system.dylib")
|
||||
base.copy_files(directory_build + "/mac_arm64/*.a", directory_build)
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
|
||||
@ -7,12 +7,12 @@ import base
|
||||
import os
|
||||
import build
|
||||
|
||||
def make(src_dir, modules):
|
||||
def make(src_dir, modules, build_platform="android"):
|
||||
old_cur = os.getcwd()
|
||||
|
||||
print("boost-headers...")
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=system"])
|
||||
base.cmd("./b2", ["--prefix=./../build/android", "headers", "install"])
|
||||
base.cmd("./b2", ["--prefix=./../build/" + build_platform, "headers", "install"])
|
||||
|
||||
for module in modules:
|
||||
print("boost-module: " + module + " ...")
|
||||
@ -40,7 +40,7 @@ def make(src_dir, modules):
|
||||
pro_file_content.append("")
|
||||
pro_file_content.append("SOURCES += $$files($$PWD/src/*.cpp, true)")
|
||||
pro_file_content.append("")
|
||||
pro_file_content.append("DESTDIR = $$BOOST_SOURCES/../build/android/lib/$$CORE_BUILDS_PLATFORM_PREFIX")
|
||||
pro_file_content.append("DESTDIR = $$BOOST_SOURCES/../build/" + build_platform + "/lib/$$CORE_BUILDS_PLATFORM_PREFIX")
|
||||
base.save_as_script(module_dir + "/" + module + ".pro", pro_file_content)
|
||||
build.make_pro_file(module_dir + "/makefiles", module_dir + "/" + module + ".pro")
|
||||
|
||||
|
||||
171
scripts/core_common/modules/hunspell.py
Normal file
171
scripts/core_common/modules/hunspell.py
Normal file
@ -0,0 +1,171 @@
|
||||
import sys
|
||||
sys.path.append('../../../scripts')
|
||||
import base
|
||||
import os
|
||||
|
||||
def make(build_js = True):
|
||||
|
||||
old_cur_dir = os.getcwd()
|
||||
#fetch libhunspell
|
||||
print("[fetch & build]: hunspell")
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/hunspell"
|
||||
os.chdir(base_dir)
|
||||
if not base.is_dir("hunspell"):
|
||||
last_stable_commit = "8a2fdfe5a6bb1cbafc04b0c8486abcefd17ad903"
|
||||
repo_path = "https://github.com/hunspell/hunspell.git"
|
||||
base.cmd("git", ["clone", repo_path])
|
||||
os.chdir("hunspell")
|
||||
base.cmd("git", ["checkout", last_stable_commit])
|
||||
base.replaceInFile("./src/hunspell/filemgr.hxx", "FileMgr& operator=(const FileMgr&);", "FileMgr& operator=(const FileMgr&); \n"
|
||||
+" #ifdef HUNSPELL_WASM_MODULE \n char* memory;size_t index;size_t size; \n #endif") #custon filemgr support watch filemgr_wrapper_new.cxx
|
||||
os.chdir("../")
|
||||
|
||||
if not build_js:
|
||||
os.chdir(old_cur_dir)
|
||||
return
|
||||
base.configure_common_apps()
|
||||
|
||||
# remove previous version
|
||||
if base.is_dir("./deploy"):
|
||||
base.delete_dir("./deploy")
|
||||
base.create_dir("./deploy")
|
||||
base.create_dir("./deploy/spell")
|
||||
|
||||
# fetch emsdk
|
||||
command_prefix = "" if ("windows" == base.host_platform()) else "./"
|
||||
if not base.is_dir("emsdk"):
|
||||
base.cmd("git", ["clone", "https://github.com/emscripten-core/emsdk.git"])
|
||||
os.chdir("emsdk")
|
||||
base.cmd(command_prefix + "emsdk", ["install", "latest"])
|
||||
base.cmd(command_prefix + "emsdk", ["activate", "latest"])
|
||||
os.chdir("../")
|
||||
|
||||
# compile
|
||||
compiler_flags = ["-o spell.js",
|
||||
"-O3",
|
||||
"-fno-exceptions",
|
||||
"-fno-rtti",
|
||||
"-s WASM=1",
|
||||
"-s ALLOW_MEMORY_GROWTH=1",
|
||||
"-s FILESYSTEM=0",
|
||||
"-s ENVIRONMENT='web,worker'"]
|
||||
|
||||
exported_functions = ["_malloc",
|
||||
"_free",
|
||||
"_Spellchecker_Malloc",
|
||||
"_Spellchecker_Free",
|
||||
"_Spellchecker_Create",
|
||||
"_Spellchecker_Destroy",
|
||||
"_Spellchecker_AddDictionary",
|
||||
"_Spellchecker_RemoveDicrionary",
|
||||
"_Spellchecker_Load",
|
||||
"_Spellchecker_Spell",
|
||||
"_Spellchecker_Suggest",
|
||||
"_Spellchecker_RemoveEngine",
|
||||
"_Spellchecker_TotalAllocatedMemory"]
|
||||
|
||||
version_hunspell = 17
|
||||
libhunspell_src_path = "./hunspell/src/hunspell"
|
||||
|
||||
input_sources = ["affentry.cxx",
|
||||
"affixmgr.cxx",
|
||||
"csutil.cxx",
|
||||
"dictmgr.cxx",
|
||||
"hashmgr.cxx",
|
||||
"hunspell.cxx",
|
||||
"hunzip.cxx",
|
||||
"phonet.cxx",
|
||||
"replist.cxx",
|
||||
"suggestmgr.cxx"]
|
||||
|
||||
sources = []
|
||||
for item in input_sources:
|
||||
if base.is_file(libhunspell_src_path + "/" + item):
|
||||
sources.append(libhunspell_src_path + "/" + item)
|
||||
|
||||
if (13 == version_hunspell):
|
||||
sources.append("./wasm/src/filemgr_wrapper.cxx")
|
||||
else:
|
||||
sources.append("./wasm/src/filemgr_wrapper_new.cxx")
|
||||
|
||||
sources.append("./wasm/src/base.cpp")
|
||||
|
||||
compiler_flags.append("-I" + libhunspell_src_path)
|
||||
compiler_flags.append("-DWIN32 -DNDEBUG -DHUNSPELL_STATIC -DBUILDING_LIBHUNSPELL -DHUNSPELL_WASM_MODULE")
|
||||
|
||||
# arguments
|
||||
arguments = ""
|
||||
for item in compiler_flags:
|
||||
arguments += (item + " ")
|
||||
|
||||
arguments += "-s EXPORTED_FUNCTIONS=\"["
|
||||
for item in exported_functions:
|
||||
arguments += ("'" + item + "',")
|
||||
arguments = arguments[:-1]
|
||||
arguments += "]\" "
|
||||
|
||||
for item in sources:
|
||||
arguments += (item + " ")
|
||||
|
||||
|
||||
# command
|
||||
windows_bat = []
|
||||
if (base.host_platform() == "windows"):
|
||||
windows_bat.append("call emsdk/emsdk_env.bat")
|
||||
windows_bat.append("call emcc " + arguments)
|
||||
else:
|
||||
windows_bat.append("#!/bin/bash")
|
||||
windows_bat.append("source ./emsdk/emsdk_env.sh")
|
||||
windows_bat.append("emcc " + arguments)
|
||||
base.run_as_bat(windows_bat)
|
||||
|
||||
# finalize
|
||||
base.replaceInFile("./spell.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[function(){self.onEngineInit();}];")
|
||||
base.replaceInFile("./spell.js", "function getBinaryPromise(){", "function getBinaryPromise2(){")
|
||||
|
||||
spell_js_content = base.readFile("./spell.js")
|
||||
engine_base_js_content = base.readFile("./wasm/js/spell.js")
|
||||
engine_js_content = engine_base_js_content.replace("//module", spell_js_content)
|
||||
|
||||
# write new version
|
||||
base.writeFile("./deploy/spell/spell.js", engine_js_content)
|
||||
base.copy_file("spell.wasm", "./deploy/spell/spell.wasm")
|
||||
|
||||
# ie asm version
|
||||
arguments = arguments.replace("WASM=1", "WASM=0")
|
||||
|
||||
# command
|
||||
windows_bat = []
|
||||
if (base.host_platform() == "windows"):
|
||||
windows_bat.append("call emsdk/emsdk_env.bat")
|
||||
windows_bat.append("call emcc " + arguments)
|
||||
else:
|
||||
windows_bat.append("#!/bin/bash")
|
||||
windows_bat.append("source ./emsdk/emsdk_env.sh")
|
||||
windows_bat.append("emcc " + arguments)
|
||||
base.run_as_bat(windows_bat)
|
||||
|
||||
# finalize
|
||||
base.replaceInFile("./spell.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[function(){self.onEngineInit();}];")
|
||||
base.replaceInFile("./spell.js", "function getBinaryPromise(){", "function getBinaryPromise2(){")
|
||||
|
||||
spell_js_content = base.readFile("./spell.js")
|
||||
engine_base_js_content = base.readFile("./wasm/js/spell.js")
|
||||
engine_base_js_polyfill = base.readFile("./wasm/js/polyfill.js")
|
||||
engine_js_content = engine_base_js_polyfill + "\n\n" + engine_base_js_content.replace("//module", spell_js_content)
|
||||
|
||||
# write new version
|
||||
base.writeFile("./deploy/spell/spell_ie.js", engine_js_content)
|
||||
base.copy_file("spell.js.mem", "./deploy/spell/spell.js.mem")
|
||||
|
||||
base.copy_file("./wasm/js/code.js", "./deploy/spell.js")
|
||||
base.copy_file("./wasm/js/index.html", "./deploy/index.html")
|
||||
|
||||
base.delete_file("spell.js")
|
||||
base.delete_file("spell.js.mem")
|
||||
os.chdir(old_cur_dir)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# manual compile
|
||||
make(True)
|
||||
@ -67,10 +67,12 @@ def make():
|
||||
if (-1 != config.option("platform").find("ios")):
|
||||
if not base.is_dir("build"):
|
||||
base.bash("./icu_ios")
|
||||
elif (platform == "mac_64") and not base.is_dir(platform + "/build"):
|
||||
base.cmd_in_dir(base_dir + "/../../../../build_tools/scripts/core_common/modules", "python", ["icu_mac.py"])
|
||||
elif ("" != platform) and not base.is_dir(platform + "/build"):
|
||||
base.create_dir(platform)
|
||||
os.chdir("icu/source")
|
||||
base.cmd("./runConfigureICU", ["Linux" if "linux" == base.host_platform() else "MacOSX"])
|
||||
base.cmd("./runConfigureICU", ["Linux"])
|
||||
old_dest_dir = base.get_env("DESTDIR")
|
||||
base.set_env("DESTDIR", base_dir + "/" + platform)
|
||||
base.cmd("make", ["install"])
|
||||
@ -83,9 +85,6 @@ def make():
|
||||
if ("linux_64" == platform):
|
||||
base.copy_file("icu/source/lib/libicudata.so." + icu_major + "." + icu_minor, platform + "/build/libicudata.so." + icu_major)
|
||||
base.copy_file("icu/source/lib/libicuuc.so." + icu_major + "." + icu_minor, platform + "/build/libicuuc.so." + icu_major)
|
||||
elif ("mac_64" == platform):
|
||||
base.copy_file("icu/source/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", platform + "/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file("icu/source/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", platform + "/build/libicuuc." + icu_major + ".dylib")
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
96
scripts/core_common/modules/icu_mac.py
Executable file
96
scripts/core_common/modules/icu_mac.py
Executable file
@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
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"
|
||||
|
||||
param = "-arch x86_64"
|
||||
if arch == "arm64":
|
||||
param = "-arch arm64 -isysroot " + base.find_mac_sdk()
|
||||
|
||||
base.copy_file(icudef_file, icudef_file_old)
|
||||
|
||||
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
|
||||
|
||||
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 = "2"
|
||||
|
||||
current_dir_old = os.getcwd()
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu"
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
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"])
|
||||
|
||||
change_icu_defs(current_dir + "/mac_cross_64", "x86_64")
|
||||
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
|
||||
restore_icu_defs(current_dir + "/mac_cross_64")
|
||||
|
||||
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"])
|
||||
|
||||
change_icu_defs(current_dir + "/icu/source", "arm64")
|
||||
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"])
|
||||
|
||||
restore_icu_defs(current_dir + "/icu/source")
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
if base.is_dir(current_dir + "/mac_64"):
|
||||
base.delete_dir(current_dir + "/mac_64")
|
||||
|
||||
if base.is_dir(current_dir + "/mac_arm64"):
|
||||
base.delete_dir(current_dir + "/mac_arm64")
|
||||
|
||||
base.create_dir(current_dir + "/mac_64")
|
||||
base.create_dir(current_dir + "/mac_64/build")
|
||||
|
||||
base.create_dir(current_dir + "/mac_arm64")
|
||||
base.create_dir(current_dir + "/mac_arm64/build")
|
||||
|
||||
base.copy_dir(current_dir + "/mac_cross_64/include", current_dir + "/mac_64/build/include")
|
||||
base.copy_file(current_dir + "/mac_cross_64/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file(current_dir + "/mac_cross_64/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicuuc." + icu_major + ".dylib")
|
||||
|
||||
base.copy_dir(current_dir + "/mac_arm_64/include", current_dir + "/mac_arm64/build/include")
|
||||
base.copy_file(current_dir + "/mac_arm_64/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file(current_dir + "/mac_arm_64/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicuuc." + icu_major + ".dylib")
|
||||
|
||||
base.delete_dir(current_dir + "/mac_cross_64")
|
||||
base.delete_dir(current_dir + "/mac_arm_64")
|
||||
|
||||
os.chdir(current_dir_old)
|
||||
@ -83,7 +83,25 @@ def make():
|
||||
# TODO: support x86
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
|
||||
base.cmd("./config", ["no-shared", "no-asm", "--prefix=" + old_cur_dir + "/build/mac_64", "--openssldir=" + old_cur_dir + "/build/mac_64", "-mmacosx-version-min=10.11"])
|
||||
base.cmd("./Configure", ["no-shared", "no-asm", "darwin64-x86_64-cc", "--prefix=" + old_cur_dir + "/build/mac_64", "--openssldir=" + old_cur_dir + "/build/mac_64", "-mmacosx-version-min=10.11"])
|
||||
base.cmd("make", ["build_libs", "install"])
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_arm64"):
|
||||
os.chdir(base_dir)
|
||||
base.cmd("git", ["clone", "--depth=1", "--branch", "OpenSSL_1_1_1f", "https://github.com/openssl/openssl.git", "openssl2"])
|
||||
os.chdir(base_dir + "/openssl2")
|
||||
replace1 = "\"darwin64-x86_64-cc\" => {"
|
||||
replace2 = "\"darwin64-arm64-cc\" => {\n\
|
||||
inherit_from => [ \"darwin-common\", asm(\"aarch64_asm\") ],\n\
|
||||
CFLAGS => add(\"-Wall\"),\n\
|
||||
cflags => add(\"-arch arm64 -isysroot " + base.find_mac_sdk() + "\"),\n\
|
||||
lib_cppflags => add(\"-DL_ENDIAN\"),\n\
|
||||
bn_ops => \"SIXTY_FOUR_BIT_LONG\",\n\
|
||||
perlasm_scheme => \"macosx\",\n\
|
||||
},\n\
|
||||
\"darwin64-x86_64-cc\" => {"
|
||||
base.replaceInFile(base_dir + "/openssl2/Configurations/10-main.conf", replace1, replace2)
|
||||
base.cmd("./Configure", ["no-shared", "no-asm", "darwin64-arm64-cc", "--prefix=" + old_cur_dir + "/build/mac_arm64", "--openssldir=" + old_cur_dir + "/build/mac_arm64"])
|
||||
base.cmd("make", ["build_libs", "install"])
|
||||
|
||||
os.chdir(old_cur)
|
||||
|
||||
@ -67,6 +67,9 @@ def make():
|
||||
if (-1 == config.option("platform").find("linux")) and (-1 == config.option("platform").find("mac")) and (-1 == config.option("platform").find("win")):
|
||||
return
|
||||
|
||||
if ("mac" == base.host_platform()) and (-1 == config.option("config").find("use_v8")):
|
||||
return
|
||||
|
||||
print("[fetch & build]: v8")
|
||||
old_env = dict(os.environ)
|
||||
|
||||
@ -146,6 +149,11 @@ def make():
|
||||
base.replaceInFile("v8/build/config/mac/mac_sdk.gni", "if (mac_sdk_version != mac_sdk_min_build_override", "if (false && mac_sdk_version != mac_sdk_min_build_override")
|
||||
base.replaceInFile("v8/build/mac/find_sdk.py", "^MacOSX(10\\.\\d+)\\.sdk$", "^MacOSX(1\\d\\.\\d+)\\.sdk$")
|
||||
|
||||
if (11003 <= base.get_mac_sdk_version_number()):
|
||||
base.copy_dir("v8/third_party/llvm-build/Release+Asserts/include", "v8/third_party/llvm-build/Release+Asserts/__include")
|
||||
base.delete_dir("v8/third_party/llvm-build/Release+Asserts/include")
|
||||
base.replaceInFile("v8/build/config/mac/BUILD.gn", "\"-mmacosx-version-min=$mac_deployment_target\",", "\"-mmacosx-version-min=$mac_deployment_target\",\n \"-Wno-deprecated-declarations\",")
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# build
|
||||
os.chdir("v8")
|
||||
|
||||
@ -72,7 +72,7 @@ def make():
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_build_dir + "/lib/" + platform_postfix + "/doctrenderer.lib", root_dir + "/doctrenderer.lib")
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/")
|
||||
else:
|
||||
elif (-1 == config.option("config").find("use_javascript_core")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/icudtl.dat")
|
||||
|
||||
# app
|
||||
|
||||
@ -49,7 +49,8 @@ def make():
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", archive_dir + "/")
|
||||
else:
|
||||
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*", archive_dir + "/")
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", archive_dir + "/")
|
||||
if (-1 == config.option("config").find("use_javascript_core")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", archive_dir + "/")
|
||||
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allfontsgen")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allthemesgen")
|
||||
|
||||
@ -80,7 +80,7 @@ def make():
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "doctrenderer")
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/converter/")
|
||||
else:
|
||||
elif (-1 == config.option("config").find("use_javascript_core")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/converter/icudtl.dat")
|
||||
|
||||
base.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop")
|
||||
|
||||
@ -106,7 +106,7 @@ def make():
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", converter_dir + "/")
|
||||
else:
|
||||
elif (-1 == config.option("config").find("use_javascript_core")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", converter_dir + "/icudtl.dat")
|
||||
|
||||
# builder
|
||||
|
||||
@ -102,11 +102,11 @@ def check_dependencies():
|
||||
install_args += checksResult.get_uninstall()
|
||||
install_args += checksResult.get_removepath()
|
||||
install_args += checksResult.get_install()
|
||||
install_args[0] = './scripts/develop/' + install_args[0]
|
||||
if (host_platform == 'windows'):
|
||||
install_args[0] = './scripts/develop/' + install_args[0]
|
||||
code = libwindows.sudo(unicode(sys.executable), install_args)
|
||||
elif (host_platform == 'linux'):
|
||||
base.cmd_in_dir('./scripts/develop/', 'python', install_args)
|
||||
base.cmd('python', install_args, False)
|
||||
get_updates()
|
||||
|
||||
check_npmPath()
|
||||
@ -195,16 +195,19 @@ def check_java():
|
||||
def get_erlang_path_to_bin():
|
||||
erlangPath = ''
|
||||
if (host_platform == 'windows'):
|
||||
erlangPath = os.getenv("ERLANG_HOME")
|
||||
if (erlangPath is not None):
|
||||
erlangPath += '\\bin'
|
||||
erlangPath = os.getenv("ERLANG_HOME", "")
|
||||
if (erlangPath != ""):
|
||||
erlangPath += "\\bin"
|
||||
return erlangPath
|
||||
def check_erlang():
|
||||
dependence = CDependencies()
|
||||
base.print_info('Check installed Erlang')
|
||||
|
||||
erlangBitness = base.run_command_in_dir(get_erlang_path_to_bin(), 'erl -eval "erlang:display(erlang:system_info(wordsize)), halt()." -noshell')['stdout']
|
||||
|
||||
erlangBitness = ""
|
||||
erlang_path_home = get_erlang_path_to_bin()
|
||||
if ("" != erlang_path_home or host_platform != 'windows'):
|
||||
erlangBitness = base.run_command_in_dir(erlang_path_home, 'erl -eval "erlang:display(erlang:system_info(wordsize)), halt()." -noshell')['stdout']
|
||||
|
||||
if (erlangBitness == '8'):
|
||||
print("Installed Erlang is valid")
|
||||
return dependence
|
||||
@ -384,6 +387,31 @@ def check_7z():
|
||||
|
||||
return dependence
|
||||
|
||||
def check_gh():
|
||||
base.print_info('Check installed GitHub CLI')
|
||||
|
||||
result = base.run_command('gh --version')['stdout']
|
||||
|
||||
if (result == ''):
|
||||
base.print_info('GitHub CLI not found')
|
||||
# ToDo install
|
||||
return False
|
||||
|
||||
base.print_info('GitHub CLI is installed')
|
||||
return True
|
||||
|
||||
def check_gh_auth():
|
||||
base.print_info('Check auth for GitHub CLI')
|
||||
|
||||
result = base.run_command('gh auth status')['stderr']
|
||||
|
||||
if (result.find('not logged') != -1):
|
||||
base.print_info('GitHub CLI not logged in to github')
|
||||
return False
|
||||
|
||||
base.print_info('GitHub CLI logged in to github')
|
||||
return True
|
||||
|
||||
def get_mysql_path_to_bin(mysqlPath = ''):
|
||||
if (host_platform == 'windows'):
|
||||
if (mysqlPath == ''):
|
||||
@ -450,9 +478,14 @@ def check_mysqlServer():
|
||||
|
||||
print('Valid MySQL Server not found')
|
||||
dependence.append_uninstall('MySQL Server')
|
||||
dependence.append_uninstall('MySQL Installer')
|
||||
dependence.append_install('MySQLInstaller')
|
||||
dependence.append_install('MySQLServer')
|
||||
|
||||
MySQLData = os.environ['ProgramData'] + '\\MySQL\\'
|
||||
if base.is_exist(MySQLData) == False:
|
||||
return dependence
|
||||
|
||||
dir = os.listdir(MySQLData)
|
||||
for path in dir:
|
||||
if (path.find('MySQL Server') != -1) and (base.is_file(MySQLData + path) == False):
|
||||
@ -467,27 +500,26 @@ def check_MySQLConfig(mysqlPath = ''):
|
||||
if (base.run_command_in_dir(mysql_path_to_bin, mysqlLoginSrt + ' -e "SHOW DATABASES;"')['stdout'].find('onlyoffice') == -1):
|
||||
print('Database onlyoffice not found')
|
||||
creatdb_path = base.get_script_dir() + "/../../server/schema/mysql/createdb.sql"
|
||||
result = execMySQLScript(mysqlPath, creatdb_path)
|
||||
result = execMySQLScript(mysql_path_to_bin, creatdb_path)
|
||||
if (base.run_command_in_dir(mysql_path_to_bin, mysqlLoginSrt + ' -e "SELECT plugin from mysql.user where User=' + "'" + install_params['MySQLServer']['user'] + "';" + '"')['stdout'].find('mysql_native_password') == -1):
|
||||
print('Password encryption is not valid')
|
||||
result = set_MySQLEncrypt(mysqlPath, 'mysql_native_password') and result
|
||||
result = set_MySQLEncrypt(mysql_path_to_bin, 'mysql_native_password') and result
|
||||
|
||||
return result
|
||||
def execMySQLScript(mysqlPath, scriptPath):
|
||||
#ToDo check path to mysql
|
||||
def execMySQLScript(mysql_path_to_bin, scriptPath):
|
||||
print('Execution ' + scriptPath)
|
||||
|
||||
code = subprocess.call(get_mysqlLoginSrting() + ' < "' + scriptPath + '"', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
mysqlLoginSrt = get_mysqlLoginSrting()
|
||||
|
||||
code = base.exec_command_in_dir(mysql_path_to_bin, get_mysqlLoginSrting() + ' < "' + scriptPath + '"')
|
||||
if (code != 0):
|
||||
print('Execution failed!')
|
||||
return False
|
||||
print('Execution completed')
|
||||
return True
|
||||
def set_MySQLEncrypt(mysqlPath, sEncrypt):
|
||||
#ToDo check path to mysql
|
||||
def set_MySQLEncrypt(mysql_path_to_bin, sEncrypt):
|
||||
print('Setting MySQL password encrypting...')
|
||||
|
||||
code = subprocess.call(get_mysqlLoginSrting() + ' -e "' + "ALTER USER '" + install_params['MySQLServer']['user'] + "'@'localhost' IDENTIFIED WITH " + sEncrypt + " BY '" + install_params['MySQLServer']['pass'] + "';" + '"', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
code = base.exec_command_in_dir(mysql_path_to_bin, get_mysqlLoginSrting() + ' -e "' + "ALTER USER '" + install_params['MySQLServer']['user'] + "'@'localhost' IDENTIFIED WITH " + sEncrypt + " BY '" + install_params['MySQLServer']['pass'] + "';" + '"')
|
||||
if (code != 0):
|
||||
print('Setting password encryption failed!')
|
||||
return False
|
||||
@ -508,8 +540,8 @@ def uninstall_mysqlserver():
|
||||
def get_postrgre_path_to_bin(postgrePath = ''):
|
||||
if (host_platform == 'windows'):
|
||||
if (postgrePath == ''):
|
||||
postgrePath = os.environ['PROGRAMW6432'] + '\\PostgreSQL\\13\\'
|
||||
postgrePath += 'bin'
|
||||
postgrePath = os.environ['PROGRAMW6432'] + '\\PostgreSQL\\13'
|
||||
postgrePath += '\\bin'
|
||||
return postgrePath
|
||||
def get_postgreLoginSrting(userName):
|
||||
if (host_platform == 'windows'):
|
||||
@ -548,8 +580,9 @@ def check_postgreSQL():
|
||||
|
||||
if (host_platform == 'linux'):
|
||||
result = os.system(postgreLoginSrt + ' -c "\q"')
|
||||
connectionResult = base.run_command(connectionString)['stdout']
|
||||
|
||||
if (result != 0):
|
||||
if (result != 0 or connectionResult.find(install_params['PostgreSQL']['dbPort']) == -1):
|
||||
print('Valid PostgreSQL not found!')
|
||||
dependence.append_install('PostgreSQL')
|
||||
dependence.append_uninstall('PostgreSQL')
|
||||
@ -563,7 +596,7 @@ def check_postgreSQL():
|
||||
for info in arrInfo:
|
||||
if (base.is_dir(info['Location']) == False):
|
||||
continue
|
||||
|
||||
|
||||
postgre_full_name = 'PostgreSQL ' + info['Version'][:2] + ' '
|
||||
connectionResult = base.run_command_in_dir(get_postrgre_path_to_bin(info['Location']), connectionString)['stdout']
|
||||
|
||||
@ -601,60 +634,55 @@ def check_postgreConfig(postgrePath = ''):
|
||||
if (os.system(postgreLoginDbUser + '-c "\q"') != 0):
|
||||
print('Invalid user password!')
|
||||
base.print_info('Changing password...')
|
||||
result = change_userPass(dbUser, dbPass, postgrePath) and result
|
||||
result = change_userPass(dbUser, dbPass, postgre_path_to_bin) and result
|
||||
else:
|
||||
print('User ' + dbUser + ' not exist!')
|
||||
base.print_info('Creating ' + dbName + ' user...')
|
||||
result = create_postgreUser(dbUser, dbPass, postgrePath) and result
|
||||
result = create_postgreUser(dbUser, dbPass, postgre_path_to_bin) and result
|
||||
|
||||
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + ' -c "SELECT datname FROM pg_database;"')['stdout'].find('onlyoffice') == -1):
|
||||
print('Database ' + dbName + ' not found')
|
||||
base.print_info('Creating ' + dbName + ' database...')
|
||||
result = create_postgreDb(dbName, postgrePath) and configureDb(dbUser, dbName, creatdb_path, postgrePath)
|
||||
result = create_postgreDb(dbName, postgre_path_to_bin) and configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
|
||||
else:
|
||||
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "SELECT pg_size_pretty(pg_database_size(' + "'" + dbName + "'" + '));"')['stdout'].find('7559 kB') != -1):
|
||||
print('Database ' + dbName + ' not configured')
|
||||
base.print_info('Configuring ' + dbName + ' database...')
|
||||
result = configureDb(dbName, creatdb_path, postgrePath) and result
|
||||
result = configureDb(dbName, creatdb_path, postgre_path_to_bin) and result
|
||||
print('Database ' + dbName + ' is valid')
|
||||
|
||||
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "\l+ ' + dbName + '"')['stdout'].find(dbUser +'=CTc/' + rootUser) == -1):
|
||||
print('User ' + dbUser + ' has no database privileges!')
|
||||
base.print_info('Setting database privileges for user ' + dbUser + '...')
|
||||
result = set_dbPrivilegesForUser(dbUser, dbName, postgrePath) and result
|
||||
result = set_dbPrivilegesForUser(dbUser, dbName, postgre_path_to_bin) and result
|
||||
print('User ' + dbUser + ' has database privileges')
|
||||
|
||||
return result
|
||||
def create_postgreDb(dbName, postgrePath = ''):
|
||||
#ToDo check path to postgre
|
||||
def create_postgreDb(dbName, postgre_path_to_bin = ''):
|
||||
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
if (os.system(postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"') != 0):
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"') != 0):
|
||||
return False
|
||||
return True
|
||||
def set_dbPrivilegesForUser(userName, dbName, postgrePath = ''):
|
||||
#ToDo check path to postgre
|
||||
def set_dbPrivilegesForUser(userName, dbName, postgre_path_to_bin = ''):
|
||||
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
if (os.system(postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"') != 0):
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"') != 0):
|
||||
return False
|
||||
return True
|
||||
def create_postgreUser(userName, userPass, postgrePath = ''):
|
||||
#ToDo check path to postgre
|
||||
def create_postgreUser(userName, userPass, postgre_path_to_bin = ''):
|
||||
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
if (os.system(postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"') != 0):
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"') != 0):
|
||||
return False
|
||||
return True
|
||||
def change_userPass(userName, userPass, postgrePath = ''):
|
||||
#ToDo check path to postgre
|
||||
def change_userPass(userName, userPass, postgre_path_to_bin = ''):
|
||||
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
|
||||
if (os.system(postgreLoginRoot + '-c "ALTER USER ' + userName + " WITH PASSWORD '" + userPass + "';" + '"') != 0):
|
||||
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "ALTER USER ' + userName + " WITH PASSWORD '" + userPass + "';" + '"') != 0):
|
||||
return False
|
||||
return True
|
||||
def configureDb(userName, dbName, scriptPath, postgrePath = ''):
|
||||
#ToDo check path to postgre
|
||||
def configureDb(userName, dbName, scriptPath, postgre_path_to_bin = ''):
|
||||
print('Execution ' + scriptPath)
|
||||
postgreLoginSrt = get_postgreLoginSrting(userName)
|
||||
|
||||
code = os.system(postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"')
|
||||
code = base.exec_command_in_dir(postgre_path_to_bin, postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"')
|
||||
if (code != 0):
|
||||
print('Execution failed!')
|
||||
return False
|
||||
@ -667,6 +695,7 @@ def uninstall_postgresql():
|
||||
code = os.system('sudo rm -rf /etc/postgresql/') and code
|
||||
code = os.system('sudo userdel -r postgres') and code
|
||||
code = os.system('sudo groupdel postgres') and code
|
||||
os.system('sudo kill ' + base.run_command('sudo fuser -vn tcp 5432')['stdout'])
|
||||
|
||||
return code
|
||||
|
||||
@ -724,12 +753,11 @@ def uninstallProgram(sName):
|
||||
if (code != 0):
|
||||
print("Uninstalling was failed!")
|
||||
return False
|
||||
|
||||
|
||||
return True
|
||||
|
||||
def installProgram(sName):
|
||||
base.print_info("Installing " + sName + "...")
|
||||
|
||||
if (host_platform == 'windows'):
|
||||
if (sName in install_special):
|
||||
code = install_special[sName]()
|
||||
@ -891,3 +919,4 @@ install_params = {
|
||||
uninstall_params = {
|
||||
'PostgreSQL': '--mode unattended --unattendedmodeui none'
|
||||
}
|
||||
|
||||
|
||||
22
scripts/develop/develop.py
Normal file
22
scripts/develop/develop.py
Normal file
@ -0,0 +1,22 @@
|
||||
import sys
|
||||
sys.path.append('scripts')
|
||||
sys.path.append('scripts/develop')
|
||||
import base
|
||||
import build_js
|
||||
import build_server
|
||||
import config
|
||||
import dependence
|
||||
import config_server as develop_config_server
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
def make():
|
||||
if ("1" != config.option("develop")):
|
||||
return
|
||||
if not dependence.check_dependencies():
|
||||
exit(1)
|
||||
build_server.build_server_develop()
|
||||
build_js.build_js_develop(base_dir + "/../../..")
|
||||
develop_config_server.make()
|
||||
exit(0)
|
||||
|
||||
@ -7,14 +7,26 @@ import base
|
||||
import dependence
|
||||
import config
|
||||
|
||||
branch_from = ''
|
||||
branches_to = []
|
||||
def protect_brunch(branch, repo, strict = False):
|
||||
team = '' if strict else 'dep-application-development-leads'
|
||||
command = 'echo {"required_status_checks": null,"enforce_admins":true,"required_pull_request_reviews": null,"restrictions": {"users":[],"teams":["'
|
||||
command += team + '"]}} | gh api -X PUT repos/ONLYOFFICE/' + repo + '/branches/' + branch + '/protection --input -'
|
||||
result = base.run_command(command)
|
||||
if ('' != result['stderr']):
|
||||
print(result['stderr'])
|
||||
return
|
||||
|
||||
branch_from = 'release/v6.2.0'
|
||||
branches_to = ['develop']
|
||||
|
||||
platform = base.host_platform()
|
||||
if ("windows" == platform):
|
||||
dependence.check_pythonPath()
|
||||
dependence.check_gitPath()
|
||||
|
||||
if (dependence.check_gh() != True or dependence.check_gh_auth() != True):
|
||||
sys.exit(0)
|
||||
|
||||
base.cmd_in_dir('../../', 'python', ['configure.py', '--branding', 'onlyoffice', '--branding-url', 'https://github.com/ONLYOFFICE/onlyoffice.git', '--branch', branch_from, '--module', 'core desktop builder server mobile', '--update', '1', '--update-light', '1', '--clean', '0'])
|
||||
|
||||
# parse configuration
|
||||
@ -37,6 +49,14 @@ base.update_repositories(repositories)
|
||||
repositories['onlyoffice'] = [True, False]
|
||||
|
||||
for repo in repositories:
|
||||
base.create_pull_request(branches_to, repo, True)
|
||||
current_dir = repositories[repo][1]
|
||||
if current_dir != False:
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(current_dir)
|
||||
|
||||
base.create_pull_request(branches_to, repo, True, current_dir)
|
||||
|
||||
if current_dir != False:
|
||||
os.chdir(cur_dir)
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
@ -31,12 +31,21 @@ def start_mac_services():
|
||||
base.run_process(['mysql.server', 'restart'])
|
||||
base.print_info('Start RabbitMQ Server')
|
||||
base.run_process(['rabbitmq-server'])
|
||||
base.print_info('Start Redis')
|
||||
base.run_process(['redis-server'])
|
||||
# base.print_info('Start Redis')
|
||||
# base.run_process(['redis-server'])
|
||||
|
||||
def start_linux_services():
|
||||
base.print_info('Restart MySQL Server')
|
||||
os.system('sudo service mysql restart')
|
||||
base.print_info('Restart RabbitMQ Server')
|
||||
os.system('sudo service rabbitmq-server restart')
|
||||
|
||||
def run_integration_example():
|
||||
base.cmd_in_dir('../../../document-server-integration/web/documentserver-example/nodejs', 'python', ['run-develop.py'])
|
||||
|
||||
def start_linux_services():
|
||||
base.print_info('Restart MySQL Server')
|
||||
|
||||
def make(args = []):
|
||||
try:
|
||||
base.configure_common_apps()
|
||||
@ -48,6 +57,9 @@ def make(args = []):
|
||||
restart_win_rabbit()
|
||||
elif ("mac" == platform):
|
||||
start_mac_services()
|
||||
elif ("linux" == platform):
|
||||
start_linux_services()
|
||||
|
||||
|
||||
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']
|
||||
|
||||
@ -62,20 +74,18 @@ def make(args = []):
|
||||
install_module('../../../server/DocService')
|
||||
install_module('../../../server/Common')
|
||||
install_module('../../../server/FileConverter')
|
||||
install_module('../../../server/SpellChecker')
|
||||
|
||||
base.set_env('NODE_ENV', 'development-' + platform)
|
||||
base.set_env('NODE_CONFIG_DIR', '../../Common/config')
|
||||
base.set_env('NODE_CONFIG_DIR', '../Common/config')
|
||||
|
||||
if ("mac" == platform):
|
||||
base.set_env('DYLD_LIBRARY_PATH', '../../FileConverter/bin/')
|
||||
base.set_env('DYLD_LIBRARY_PATH', '../FileConverter/bin/')
|
||||
elif ("linux" == platform):
|
||||
base.set_env('LD_LIBRARY_PATH', '../../FileConverter/bin/')
|
||||
base.set_env('LD_LIBRARY_PATH', '../FileConverter/bin/')
|
||||
|
||||
run_module('../../../server/DocService/sources', ['server.js'])
|
||||
run_module('../../../server/DocService/sources', ['gc.js'])
|
||||
run_module('../../../server/FileConverter/sources', ['convertermaster.js'])
|
||||
run_module('../../../server/SpellChecker/sources', ['server.js'])
|
||||
run_module('../../../server/DocService', ['sources/server.js'])
|
||||
#run_module('../../../server/DocService', ['sources/gc.js'])
|
||||
run_module('../../../server/FileConverter', ['sources/convertermaster.js'])
|
||||
except SystemExit:
|
||||
input("Ignoring SystemExit. Press Enter to continue...")
|
||||
exit(0)
|
||||
|
||||
16
scripts/packages.py
Normal file
16
scripts/packages.py
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import config
|
||||
import base
|
||||
import packages_desktop
|
||||
# import packages_server
|
||||
# import packages_builder
|
||||
|
||||
def make():
|
||||
if config.check_option("module", "desktop"):
|
||||
packages_desktop.make()
|
||||
# if config.check_option("module", "server"):
|
||||
# packages_server.make()
|
||||
# if config.check_option("module", "builder"):
|
||||
# packages_builder.make()
|
||||
return
|
||||
67
scripts/packages_desktop.py
Normal file
67
scripts/packages_desktop.py
Normal file
@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import re
|
||||
|
||||
def make():
|
||||
base_dir = base.get_script_dir() + "/../out"
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
branding = config.branding()
|
||||
|
||||
platforms = config.option("platform").split()
|
||||
for native_platform in platforms:
|
||||
if not native_platform in config.platforms:
|
||||
continue
|
||||
|
||||
isWindowsXP = False if (-1 == native_platform.find("_xp")) else True
|
||||
platform = native_platform[0:-3] if isWindowsXP else native_platform
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
macos_dir = git_dir + "/desktop-apps/macos"
|
||||
update_dir = macos_dir + "/build/update"
|
||||
|
||||
isX86 = True if ("" != base.get_env("_X86")) else False
|
||||
|
||||
target = "release" if not isX86 else "release_x86"
|
||||
base.cmd_in_dir(macos_dir, "bundler", ["exec", "fastlane", target, "skip_git_bump:true"])
|
||||
|
||||
package = "ONLYOFFICE" if not isX86 else "ONLYOFFICE-x86"
|
||||
app_version = base.run_command("mdls -name kMDItemVersion -raw " +
|
||||
macos_dir + "/build/ONLYOFFICE.app")['stdout']
|
||||
macos_zip = macos_dir + "/build/" + package + "-" + app_version + ".zip"
|
||||
update_storage = base.get_env("ARCHIVES_DIR") + "/" + package + "/_updates"
|
||||
changes_dir = macos_dir + "/ONLYOFFICE/update/updates/ONLYOFFICE/changes/" + app_version
|
||||
base.delete_dir(update_dir)
|
||||
base.delete_dir(os.path.expanduser("~/Library/Caches/Sparkle_generate_appcast"))
|
||||
base.create_dir(update_dir)
|
||||
base.copy_dir_content(update_storage, update_dir, ".zip")
|
||||
base.copy_file(macos_zip, update_dir)
|
||||
for file in os.listdir(update_dir):
|
||||
if file.endswith(".zip"):
|
||||
base.copy_file(changes_dir + "/ReleaseNotes.html",
|
||||
update_dir + "/" + os.path.splitext(file)[0] + ".html")
|
||||
base.copy_file(changes_dir + "/ReleaseNotesRU.html",
|
||||
update_dir + "/" + os.path.splitext(file)[0] + ".ru.html")
|
||||
|
||||
base.cmd(macos_dir + "/Vendor/Sparkle/bin/generate_appcast", [update_dir])
|
||||
|
||||
base_url = "https://download.onlyoffice.com/install/desktop/editors/mac"
|
||||
changes_url = base_url + "/updates/onlyoffice/changes"
|
||||
update_url = base_url + ("/updates/onlyoffice" if not isX86 else "/x86")
|
||||
|
||||
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
|
||||
r"(<sparkle:releaseNotesLink>)(?:.+ONLYOFFICE(?:|-x86)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
|
||||
"\\1" + changes_url + "/\\2/ReleaseNotes.html\\3")
|
||||
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
|
||||
r"(<sparkle:releaseNotesLink xml:lang=\"ru\">)(?:ONLYOFFICE(?:|-x86)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
|
||||
"\\1" + changes_url + "/\\2/ReleaseNotesRU.html\\3")
|
||||
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
|
||||
r"(url=\")(?:.+/)(ONLYOFFICE.+\")", "\\1" + update_url + "/\\2")
|
||||
|
||||
for file in os.listdir(update_dir):
|
||||
if -1 == file.find(app_version) and (file.endswith(".zip") or file.endswith(".html")):
|
||||
base.delete_dir(update_dir + "/" + file)
|
||||
|
||||
return
|
||||
@ -17,6 +17,9 @@ def get_branch_name(directory):
|
||||
return current_branch
|
||||
|
||||
def install_deps():
|
||||
if base.is_file("./packages_complete"):
|
||||
return
|
||||
|
||||
# dependencies
|
||||
packages = ["apt-transport-https",
|
||||
"autoconf2.13",
|
||||
@ -51,28 +54,52 @@ def install_deps():
|
||||
base.cmd("sudo", ["apt-get", "install", "-y"] + packages)
|
||||
|
||||
# nodejs
|
||||
if not base.is_file("./node_js_setup_10.x"):
|
||||
base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"])
|
||||
nodejs_cur = 0
|
||||
try:
|
||||
nodejs_version = base.run_command('node -v')['stdout']
|
||||
nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:])
|
||||
nodejs_cur_version_minor = int(nodejs_version.split('.')[1])
|
||||
nodejs_cur = nodejs_cur_version_major * 1000 + nodejs_cur_version_minor
|
||||
print("Installed Node.js version: " + str(nodejs_cur_version_major) + "." + str(nodejs_cur_version_minor))
|
||||
except:
|
||||
nodejs_cur = 1
|
||||
if (nodejs_cur < 10020):
|
||||
print("Node.js version cannot be less 10.20")
|
||||
print("Reinstall")
|
||||
if (base.is_dir("./node_js_setup_10.x")):
|
||||
base.delete_dir("./node_js_setup_10.x")
|
||||
base.cmd("sudo", ["apt-get", "remove", "--purge", "-y", "nodejs"])
|
||||
base.download("https://deb.nodesource.com/setup_10.x", "./node_js_setup_10.x")
|
||||
base.cmd('curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -')
|
||||
base.cmd("sudo", ["bash", "./node_js_setup_10.x"])
|
||||
base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"])
|
||||
base.cmd("sudo", ["npm", "install", "-g", "npm@6"])
|
||||
base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"])
|
||||
base.cmd("sudo", ["npm", "install", "-g", "pkg"])
|
||||
else:
|
||||
print("OK")
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "npm", "yarn"], True)
|
||||
base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"])
|
||||
base.cmd("sudo", ["npm", "install", "-g", "pkg"])
|
||||
|
||||
# java
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "software-properties-common"])
|
||||
base.cmd("sudo", ["add-apt-repository", "-y", "ppa:openjdk-r/ppa"])
|
||||
base.cmd("sudo", ["apt-get", "update"])
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"])
|
||||
base.cmd("sudo", ["update-alternatives", "--config", "java"])
|
||||
base.cmd("sudo", ["update-alternatives", "--config", "javac"])
|
||||
java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-11-jdk"], True)
|
||||
if (0 != java_error):
|
||||
java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"], True)
|
||||
if (0 != java_error):
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "software-properties-common"])
|
||||
base.cmd("sudo", ["add-apt-repository", "-y", "ppa:openjdk-r/ppa"])
|
||||
base.cmd("sudo", ["apt-get", "update"])
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"])
|
||||
base.cmd("sudo", ["update-alternatives", "--config", "java"])
|
||||
base.cmd("sudo", ["update-alternatives", "--config", "javac"])
|
||||
|
||||
base.writeFile("./packages_complete", "complete")
|
||||
return
|
||||
|
||||
def install_qt():
|
||||
# qt
|
||||
if not base.is_file("./qt_source_5.9.9.tar.xz"):
|
||||
base.download("http://download.qt.io/official_releases/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://download.qt.io/archive/qt/5.9/5.9.9/single/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"])
|
||||
|
||||
Reference in New Issue
Block a user