def build_arch(arch, api_version): print("icu build: " + arch + " ----------------------------------------") if base.is_dir(current_dir + "/icu/" + arch): base.delete_dir(current_dir + "/icu/" + arch) base.create_dir(current_dir + "/icu/" + arch) os.chdir(current_dir + "/icu/" + arch) base.cmd( base.get_env("ANDROID_NDK_ROOT") + "/build/tools/make-standalone-toolchain.sh", [ "--platform=android-" + api_version, "--install-dir=" + current_dir + "/toolchain/" + arch, "--toolchain=" + platforms[arch]["arch"], "--force" ]) base.set_env("PATH", current_dir + "/toolchain/" + arch + "/bin:" + current_path) command_args = "--prefix=" + current_dir + "/build_tmp/" + arch + " --host=!!!MASK!!! --with-cross-build=" + current_dir + "/icu/cross_build CFLAGS=-Os CXXFLAGS=--std=c++11 CC=!!!MASK!!!-clang CXX=!!!MASK!!!-clang++ AR=!!!MASK!!!-ar RANLIB=!!!MASK!!!-ranlib" if not icu_is_shared: command_args += " --enable-static --enable-shared=no --with-data-packaging=archive CFLAGS=-fPIC CXXFLAGS=-fPIC" command_args = command_args.replace("!!!MASK!!!", platforms[arch]["bin"]) base.cmd("../source/configure", command_args.split()) base.cmd("make", ["-j4"]) base.cmd("make", ["install"]) base.set_env("PATH", current_path) os.chdir(current_dir) return
def buildIOS(): # Build for iphone base.cmd("xcodebuild", [ "-sdk", "iphoneos", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release" ]) # Build for simulator base.cmd("xcodebuild", [ "-sdk", "iphonesimulator", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release" ]) # Remove arm64 for simulator for SDK 14 base.cmd("lipo", [ "-remove", "arm64", "-output", "build/Release-iphonesimulator/libSocketRocket.a", "build/Release-iphonesimulator/libSocketRocket.a" ]) base.create_dir(current_dir + "/build/ios/lib") # Create fat lib base.cmd("lipo", [ "./build/Release-iphonesimulator/libSocketRocket.a", "./build/Release-iphoneos/libSocketRocket.a", "-create", "-output", "./build/ios/lib/libSoсketRocket.a" ]) return
def build_arch(platform, arch, params, is_debug=False): print("ixwebsocket build: " + platform + "....." + arch + " ----------------------------------------") if base.is_dir(current_dir + "/IXWebSocket/build/" + platform + "/" + arch): base.delete_dir(current_dir + "/IXWebSocket/build/" + platform + "/" + arch) base.create_dir(current_dir + "/IXWebSocket/build/" + platform + "/" + arch) cache_dir = current_dir + "/IXWebSocket/build/" + platform + "/cache" base.create_dir(cache_dir) os.chdir(cache_dir) libext = "a" prefix = "/" zlib = "1" if (0 == platform.find("windows")): zlib = "0" libext = "lib" prefix = cache_dir + "/../" + arch path = platform if (platform == "ios" or platform == "android"): path += "/" else: path = "" base.cmd(CMAKE, [ "../../..", "-DUSE_WS=0", "-DUSE_ZLIB=" + zlib, "-DUSE_TLS=1", "-DUSE_OPEN_SSL=1", "-DOPENSSL_ROOT_DIR=" + cache_dir + "/../../../../../openssl/build/" + path + arch, "-DOPENSSL_INCLUDE_DIR=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/include", "-DOPENSSL_CRYPTO_LIBRARY=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/lib/libcrypto." + libext, "-DOPENSSL_SSL_LIBRARY=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/lib/libssl." + libext, "-DCMAKE_INSTALL_PREFIX:PATH=" + prefix ] + params) if (-1 != platform.find("ios") or -1 != platform.find("mac")): base.cmd(CMAKE, ["--build", ".", "--config", "Release"]) base.cmd(CMAKE, [ "--install", ".", "--config", "Release", "--prefix", cache_dir + "/../" + arch ]) elif (-1 != platform.find("android") or -1 != platform.find("linux")): base.cmd("make", ["-j4"]) base.cmd("make", ["DESTDIR=" + cache_dir + "/../" + arch, "install"]) elif (-1 != platform.find("windows")): conf = "Debug" if is_debug else "Release" base.cmd(CMAKE, ["--build", ".", "--target", "install", "--config", conf]) base.delete_dir(cache_dir) os.chdir(current_dir) return
def make(args=[]): try: base.configure_common_apps() platform = base.host_platform() if ("windows" == platform): dependence.check_pythonPath() dependence.check_gitPath() 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'] base.print_info('Build modules') base.cmd_in_dir('../../', 'python', [ 'configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0' ] + args) base.cmd_in_dir('../../', 'python', ['make.py']) run_integration_example() base.create_dir('../../../server/App_Data') install_module('../../../server/DocService') install_module('../../../server/Common') install_module('../../../server/FileConverter') base.set_env('NODE_ENV', 'development-' + platform) base.set_env('NODE_CONFIG_DIR', '../Common/config') if ("mac" == platform): base.set_env('DYLD_LIBRARY_PATH', '../FileConverter/bin/') elif ("linux" == platform): 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']) except SystemExit: input("Ignoring SystemExit. Press Enter to continue...") exit(0) except KeyboardInterrupt: pass except: input("Unexpected error. " + traceback.format_exc() + "Press Enter to continue...")
def move_debug_libs_windows(dir): base.create_dir(dir + "/debug") for file in glob.glob(dir + "/*"): file_name = os.path.basename(file) if not base.is_file(file): continue if (0 != file_name.find("libboost_")): continue base.copy_file(file, dir + "/debug/" + file_name) base.delete_file(file) return
def buildMacOS(): # Build for iphone base.cmd("xcodebuild", [ "-sdk", "macosx", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release" ]) base.create_dir(current_dir + "/build/mac_64/lib") base.create_dir(current_dir + "/build/mac_arm64/lib") base.cmd("lipo", [ "build/Release/libSocketRocket.a", "-thin", "x86_64", "-output", "build/mac_64/lib/libSoсketRocket.a" ]) base.cmd("lipo", [ "build/Release/libSocketRocket.a", "-thin", "arm64", "-output", "build/mac_arm64/lib/libSoсketRocket.a" ]) base.delete_file("build/Release/libSocketRocket.a") return
def make(): if ("1" == base.get_env("OO_NO_BUILD_JS")): return if ("core" == config.option("module")): return base_dir = base.get_script_dir() + "/.." out_dir = base_dir + "/out/js/" branding = config.option("branding-name") if ("" == branding): branding = "onlyoffice" out_dir += branding base.create_dir(out_dir) # builder build_interface(base_dir + "/../web-apps/build") build_sdk_builder(base_dir + "/../sdkjs/build") base.create_dir(out_dir + "/builder") base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/builder/web-apps") base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/builder/sdkjs") # desktop build_sdk_desktop(base_dir + "/../sdkjs/build") if config.check_option("module", "desktop"): build_sdk_desktop(base_dir + "/../sdkjs/build") base.create_dir(out_dir + "/desktop") base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/desktop/sdkjs") base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/desktop/web-apps") base.delete_dir(out_dir + "/desktop/web-apps/apps/documenteditor/embed") base.delete_dir(out_dir + "/desktop/web-apps/apps/documenteditor/mobile") base.delete_dir(out_dir + "/desktop/web-apps/apps/presentationeditor/embed") base.delete_dir(out_dir + "/desktop/web-apps/apps/presentationeditor/mobile") base.delete_dir(out_dir + "/desktop/web-apps/apps/spreadsheeteditor/embed") base.delete_dir(out_dir + "/desktop/web-apps/apps/spreadsheeteditor/mobile") 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") base.copy_file( base_dir + "/../desktop-apps/common/loginpage/deploy/index.html", out_dir + "/desktop/index.html") return
config.extend_option( "qmake_addon", "LINK=https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.xml" ) if not base.is_file(base_dir + "/tools/WinSparkle-0.7.0.zip"): base.cmd("curl.exe", [ "https://d2ettrnqo7v976.cloudfront.net/winsparkle/WinSparkle-0.7.0.zip", "--output", base_dir + "/tools/WinSparkle-0.7.0.zip" ]) if not base.is_dir(base_dir + "/tools/WinSparkle-0.7.0"): base.cmd("7z.exe", ["x", base_dir + "/tools/WinSparkle-0.7.0.zip", "-otools"]) base.create_dir(base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle") #base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/include", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/include") base.copy_dir( base_dir + "/tools/WinSparkle-0.7.0/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_32") base.copy_dir( base_dir + "/tools/WinSparkle-0.7.0/x64/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_64") # build build.make() # js build_js.make() #server
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)
def make(): base_dir = base.get_script_dir() + "/../out" git_dir = base.get_script_dir() + "/../.." core_dir = git_dir + "/core" core_build_dir = core_dir + "/build" branding = config.branding() if ("" != config.option("branding")): core_build_dir += ("/" + config.option("branding")) platforms = config.option("platform").split() for native_platform in platforms: if not native_platform in config.platforms: continue archive_dir = base_dir + ("/" + native_platform + "/" + branding + "/core") if (base.is_dir(archive_dir)): base.delete_dir(archive_dir) base.create_dir(archive_dir) platform = native_platform base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "kernel") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "graphics") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "doctrenderer") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "HtmlRenderer") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "DjVuFile") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "XpsFile") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "PdfReader") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "PdfWriter") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "HtmlFile2") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "UnicodeConverter") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "Fb2File") base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "EpubFile") base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "x2t") base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", archive_dir + "/sdkjs") base.create_dir(archive_dir + "/sdkjs/vendor") base.copy_dir( base_dir + "/js/" + branding + "/builder/web-apps/vendor/jquery", archive_dir + "/sdkjs/vendor/jquery") base.copy_dir( base_dir + "/js/" + branding + "/builder/web-apps/vendor/xregexp", archive_dir + "/sdkjs/vendor/xregexp") if ("windows" == base.host_platform()): base.copy_files( core_dir + "/Common/3dParty/icu/" + platform + "/build/*.dll", archive_dir + "/") 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 + "/") base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allfontsgen") base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allthemesgen") base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "standardtester") if base.is_file(archive_dir + "/core.7z"): base.delete_file(archive_dir + "/core.7z") base.archive_folder(archive_dir, archive_dir + "/core.7z") return
def make(packages): base_dir = base.get_script_dir() + "/../out" git_dir = base.get_script_dir() + "/../.." for package in packages: if -1 != package.find("diskimage"): macos_dir = os.path.abspath(git_dir + "/desktop-apps/macos") update_dir = macos_dir + "/build/update" changes_dir = macos_dir + "/ONLYOFFICE/update/updates/ONLYOFFICE/changes" if (package == "diskimage-x86_64"): lane = "release_x86_64" scheme = "ONLYOFFICE-x86_64" elif (package == "diskimage-v8-x86_64"): lane = "release_v8" scheme = "ONLYOFFICE-v8" elif (package == "diskimage-arm64"): lane = "release_arm" scheme = "ONLYOFFICE-arm" else: exit(1) print("Build package " + scheme) print("$ bundler exec fastlane " + lane + " skip_git_bump:true") base.cmd_in_dir(macos_dir, "bundler", ["exec", "fastlane", lane, "skip_git_bump:true"]) print("Build updates") app_version = base.run_command( "/usr/libexec/PlistBuddy -c 'print :CFBundleShortVersionString' " + macos_dir + "/build/ONLYOFFICE.app/Contents/Info.plist")['stdout'] zip_filename = scheme + "-" + app_version macos_zip = macos_dir + "/build/" + zip_filename + ".zip" update_storage_dir = base.get_env( "ARCHIVES_DIR") + "/" + scheme + "/_updates" base.create_dir(update_dir) base.copy_dir_content(update_storage_dir, update_dir, ".zip") base.copy_dir_content(update_storage_dir, update_dir, ".html") base.copy_file(macos_zip, update_dir) notes_src = changes_dir + "/" + app_version + "/ReleaseNotes.html" notes_dst = update_dir + "/" + zip_filename + ".html" cur_date = base.run_command( "LC_ALL=en_US.UTF-8 date -u \"+%B %e, %Y\"")['stdout'] if base.is_exist(notes_src): base.copy_file(notes_src, notes_dst) base.replaceInFileRE( notes_dst, r"(<span class=\"releasedate\">).+(</span>)", "\\1 - " + cur_date + "\\2") else: base.writeFile(notes_dst, "placeholder\n") notes_src = changes_dir + "/" + app_version + "/ReleaseNotesRU.html" notes_dst = update_dir + "/" + zip_filename + ".ru.html" cur_date = base.run_command( "LC_ALL=ru_RU.UTF-8 date -u \"+%e %B %Y\"")['stdout'] if base.is_exist(notes_src): base.copy_file(notes_src, notes_dst) base.replaceInFileRE( notes_dst, r"(<span class=\"releasedate\">).+(</span>)", "\\1 - " + cur_date + "\\2") else: base.writeFile(notes_dst, "placeholder\n") print("$ ./generate_appcast " + update_dir) base.cmd(macos_dir + "/Vendor/Sparkle/bin/generate_appcast", [update_dir]) print("Edit Sparkle appcast links") sparkle_base_url = "https://download.onlyoffice.com/install/desktop/editors/mac" if (package == "diskimage-x86_64"): sparkle_base_url += "/x86_64" elif (package == "diskimage-v8-x86_64"): sparkle_base_url += "/v8" elif (package == "diskimage-arm64"): sparkle_base_url += "/arm" base.replaceInFileRE( update_dir + "/onlyoffice.xml", r"(<sparkle:releaseNotesLink>)(?:.+ONLYOFFICE-(?:x86|x86_64|v8|arm)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)", "\\1" + sparkle_base_url + "/updates/changes/\\2/ReleaseNotes.html\\3") base.replaceInFileRE( update_dir + "/onlyoffice.xml", r"(<sparkle:releaseNotesLink xml:lang=\"ru\">)(?:ONLYOFFICE-(?:x86|x86_64|v8|arm)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)", "\\1" + sparkle_base_url + "/updates/changes/\\2/ReleaseNotesRU.html\\3") base.replaceInFileRE(update_dir + "/onlyoffice.xml", r"(url=\")(?:.+/)(ONLYOFFICE.+\")", "\\1" + sparkle_base_url + "/updates/\\2") print("Delete unnecessary files") for file in os.listdir(update_dir): if (-1 == file.find(app_version)) and (file.endswith(".zip") or file.endswith(".html")): base.delete_file(update_dir + "/" + file) return
def make(): print("[fetch & build]: icu") base_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu" old_cur = os.getcwd() os.chdir(base_dir) icu_major = "58" icu_minor = "2" if not base.is_dir("icu"): base.cmd("svn", ["export", "https://github.com/unicode-org/icu/tags/release-" + icu_major + "-" + icu_minor + "/icu4c", "./icu"]) if ("windows" == base.host_platform()): need_platforms = [] if (-1 != config.option("platform").find("win_64")): need_platforms.append("win_64") if (-1 != config.option("platform").find("win_32")): need_platforms.append("win_32") 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) base.vcvarsall_start("x64" if ("win_64" == platform) else "x86") base.cmd("MSBuild.exe", ["icu/source/allinone/allinone.sln", "/p:Configuration=Release", "/p:PlatformToolset=v140", "/p:Platform=" + ("X64" if ("win_64" == platform) else "Win32")]) base.vcvarsall_end() 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/") platform = "" if ("linux" == base.host_platform()): platform = "linux_64" if not base.is_dir(platform + "/build"): base.replaceInFile("./icu/source/i18n/digitlst.cpp", "xlocale", "locale") if ("mac" == base.host_platform()): platform = "mac_64" if not base.is_dir(platform + "/build"): base.replaceInFile("./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\",") if (-1 != config.option("platform").find("ios")): if not base.is_dir("build"): base.bash("./icu_ios") 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"]) old_dest_dir = base.get_env("DESTDIR") base.set_env("DESTDIR", base_dir + "/" + platform) base.cmd("make", ["install"]) base.set_env("DESTDIR", old_dest_dir) os.chdir("../..") base.create_dir(platform + "/build") 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
def make(): git_dir = base.get_script_dir() + "/../.." old_cur = os.getcwd() work_dir = git_dir + "/server/FileConverter/bin" if not base.is_dir(work_dir): base.create_dir(work_dir) os.chdir(work_dir) arch = "x64" arch2 = "_64" if ("windows" == base.host_platform()) and not base.host_platform_is64(): arch = "x86" arch2 = "_32" url = get_core_url(arch, config.option("branch")) data_url = base.get_file_last_modified_url(url) if (data_url == "" and config.option("branch") != "develop"): url = get_core_url(arch, "develop") data_url = base.get_file_last_modified_url(url) old_data_url = base.readFile("./core.7z.data") if (data_url != "" and old_data_url != data_url): print("-----------------------------------------------------------") print("Downloading core last version... --------------------------") print("-----------------------------------------------------------") if (base.is_file("./core.7z")): base.delete_file("./core.7z") if (base.is_dir("./core")): base.delete_dir("./core") base.download(url, "./core.7z") print("-----------------------------------------------------------") print("Extracting core last version... ---------------------------") print("-----------------------------------------------------------") base.extract("./core.7z", "./") base.writeFile("./core.7z.data", data_url) platform = "" if ("windows" == base.host_platform()): platform = "win" + arch2 else: platform = base.host_platform() + arch2 base.copy_files("./core/*", "./") else: print("-----------------------------------------------------------") print("Core is up to date. ---------------------------------------") print("-----------------------------------------------------------") base.generate_doctrenderer_config("./DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/") base.support_old_versions_plugins(git_dir + "/sdkjs-plugins") if base.is_dir(git_dir + "/fonts"): base.delete_dir(git_dir + "/fonts") base.create_dir(git_dir + "/fonts") if ("mac" == base.host_platform()): base.mac_correct_rpath_x2t("./") print("-----------------------------------------------------------") print("All fonts generation... -----------------------------------") print("-----------------------------------------------------------") base.cmd_exe("./allfontsgen", [ "--input=../../../core-fonts", "--allfonts-web=../../../sdkjs/common/AllFonts.js", "--allfonts=./AllFonts.js", "--images=../../../sdkjs/common/Images", "--selection=./font_selection.bin", "--use-system=true", "--output-web=../../../fonts" ]) print("All presentation themes generation... ---------------------") print("-----------------------------------------------------------") base.cmd_exe("./allthemesgen", [ "--converter-dir=\"" + git_dir + "/server/FileConverter/bin\"", "--src=\"" + git_dir + "/sdkjs/slide/themes\"", "--output=\"" + git_dir + "/sdkjs/common/Images\"" ]) #print("- allthemesgen (ios) --------------------------------------") #base.cmd_exe("./allthemesgen", ["--converter-dir=\"" + git_dir + "/server/FileConverter/bin\"", "--src=\"" + git_dir + "/sdkjs/slide/themes\"", "--output=\"" + git_dir + "/sdkjs/common/Images\"", "--postfix=ios", "--params=280,224"]) # android #print("- allthemesgen (android) ----------------------------------") #base.cmd_exe("./allthemesgen", ["--converter-dir=\"" + git_dir + "/server/FileConverter/bin\"", "--src=\"" + git_dir + "/sdkjs/slide/themes\"", "--output=\"" + git_dir + "/sdkjs/common/Images\"", "--postfix=android", "--params=280,224"]) # add directories to open directories addon_base_path = "../../../" server_config = {} static_content = {} sql = {} server_addons = [] if (config.option("server-addons") != ""): server_addons = config.option("server-addons").rsplit(", ") if ("server-lockstorage" in server_addons): server_config["editorDataStorage"] = "editorDataRedis" sdkjs_addons = [] if (config.option("sdkjs-addons") != ""): sdkjs_addons = config.option("sdkjs-addons").rsplit(", ") for addon in sdkjs_addons: static_content["/" + addon] = {"path": addon_base_path + addon} web_apps_addons = [] if (config.option("web-apps-addons") != ""): web_apps_addons = config.option("web-apps-addons").rsplit(", ") for addon in web_apps_addons: static_content["/" + addon] = {"path": addon_base_path + addon} if (config.option("external-folder") != ""): external_folder = config.option("external-folder") static_content["/sdkjs"] = { "path": addon_base_path + external_folder + "/sdkjs" } static_content["/web-apps"] = { "path": addon_base_path + external_folder + "/web-apps" } if (config.option("sql-type") != ""): sql["type"] = config.option("sql-type") if (config.option("db-port") != ""): sql["dbPort"] = config.option("db-port") if (config.option("db-user") != ""): sql["dbUser"] = config.option("db-user") if (config.option("db-pass") != ""): sql["dbPass"] = config.option("db-pass") server_config["static_content"] = static_content json_file = git_dir + "/server/Common/config/local-development-" + base.host_platform( ) + ".json" base.writeFile( json_file, json.dumps( { "services": { "CoAuthoring": { "server": server_config, "sql": sql } } }, indent=2)) os.chdir(old_cur) return
def make(): if ("android" == base.host_platform() or "ios" == config.option("platform")): return print("[fetch & build]: openssl") base_dir = base.get_script_dir() + "/../../core/Common/3dParty/openssl" old_cur = os.getcwd() os.chdir(base_dir) base.common_check_version("openssl", "3", clean) if not base.is_dir("openssl"): base.cmd("git", [ "clone", "--depth=1", "--branch", "OpenSSL_1_1_1f", "https://github.com/openssl/openssl.git" ]) os.chdir(base_dir + "/openssl") old_cur_dir = base_dir.replace(" ", "\\ ") if ("windows" == base.host_platform()): old_cur_dir = base_dir.replace(" ", "\\ ") if (-1 != config.option("platform").find("win_64") ) and not base.is_dir("../build/win_64"): base.create_dir("./../build/win_64") qmake_bat = [] qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x64") qmake_bat.append("perl Configure VC-WIN64A --prefix=" + old_cur_dir + "\\build\\win_64 --openssldir=" + old_cur_dir + "\\build\\win_64 no-shared no-asm") 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_32") ) and not base.is_dir("../build/win_32"): base.create_dir("./../build/win_32") qmake_bat = [] qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x86") qmake_bat.append("perl Configure VC-WIN32 --prefix=" + old_cur_dir + "\\build\\win_32 --openssldir=" + old_cur_dir + "\\build\\win_32 no-shared no-asm") 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") base.replaceInFile(base_dir + "/openssl/crypto/rand/rand_win.c", "define USE_BCRYPTGENRANDOM", "define USE_BCRYPTGENRANDOM_FIX") old_cur_dir = base_dir.replace(" ", "\\ ") if (-1 != config.option("platform").find("win_64_xp") ) and not base.is_dir("../build/win_64_xp"): base.create_dir("./../build/win_64_xp") qmake_bat = [] qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x64") qmake_bat.append("perl Configure VC-WIN64A --prefix=" + old_cur_dir + "\\build\\win_64_xp --openssldir=" + old_cur_dir + "\\build\\win_64_xp no-shared no-asm no-async") 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_32_xp") ) and not base.is_dir("../build/win_32_xp"): base.create_dir("./../build/win_32_xp") qmake_bat = [] qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x86") qmake_bat.append("perl Configure VC-WIN32 --prefix=" + old_cur_dir + "\\build\\win_32_xp --openssldir=" + old_cur_dir + "\\build\\win_32_xp no-shared no-asm no-async") 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) # ------------------------------------------------------------------------------------------------------- return if (-1 != config.option("platform").find("linux") ) and not base.is_dir("../build/linux_64"): base.cmd("./config", [ "no-shared", "no-asm", "--prefix=" + old_cur_dir + "/build/linux_64", "--openssldir=" + old_cur_dir + "/build/linux_64" ]) 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"]) # TODO: support x86 if (-1 != config.option("platform").find("mac") ) and not base.is_dir("../build/mac_64"): 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) return
def make(): base_dir = base.get_script_dir() + "/../out" git_dir = base.get_script_dir() + "/../.." core_dir = git_dir + "/core" plugins_dir = git_dir + "/sdkjs-plugins" branding = config.branding() platforms = config.option("platform").split() for native_platform in platforms: if not native_platform in config.platforms: continue if (-1 != native_platform.find("_xp")): print("Server module not supported on Windows XP") continue if (-1 != native_platform.find("ios")): print("Server module not supported on iOS") continue if (-1 != native_platform.find("android")): print("Server module not supported on Android") continue root_dir = base_dir + ("/" + native_platform + "/" + branding + "/documentserver") root_dir_snap = root_dir + '-snap' if (base.is_dir(root_dir)): base.delete_dir(root_dir) base.create_dir(root_dir) build_server_dir = root_dir + '/server' server_dir = base.get_script_dir() + "/../../server" bin_server_dir = server_dir + "/build/server" base.create_dir(build_server_dir + '/DocService') base.copy_dir(bin_server_dir + '/Common/config', build_server_dir + '/Common/config') base.create_dir(build_server_dir + '/DocService') base.copy_exe(bin_server_dir + "/DocService", build_server_dir + '/DocService', "docservice") base.create_dir(build_server_dir + '/FileConverter') base.copy_exe(bin_server_dir + "/FileConverter", build_server_dir + '/FileConverter', "converter") base.create_dir(build_server_dir + '/Metrics') base.copy_exe(bin_server_dir + "/Metrics", build_server_dir + '/Metrics', "metrics") base.copy_dir(bin_server_dir + '/Metrics/config', build_server_dir + '/Metrics/config') base.create_dir(build_server_dir + '/Metrics/node_modules/modern-syslog/build/Release') base.copy_file(bin_server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node", build_server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node") base.create_dir(build_server_dir + '/SpellChecker') base.copy_exe(bin_server_dir + "/SpellChecker", build_server_dir + '/SpellChecker', "spellchecker") base.create_dir(build_server_dir + '/SpellChecker/node_modules/nodehun/build/Release') base.copy_file(bin_server_dir + "/SpellChecker/node_modules/nodehun/build/Release/nodehun.node", build_server_dir + '/SpellChecker/node_modules/nodehun/build/Release/nodehun.node') qt_dir = base.qt_setup(native_platform) platform = native_platform core_build_dir = core_dir + "/build" if ("" != config.option("branding")): core_build_dir += ("/" + config.option("branding")) platform_postfix = platform + base.qt_dst_postfix() converter_dir = root_dir + "/server/FileConverter/bin" base.create_dir(converter_dir) base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "kernel") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "UnicodeConverter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "graphics") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "PdfWriter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "PdfReader") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "DjVuFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "XpsFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "HtmlFile2") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "HtmlRenderer") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "doctrenderer") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "Fb2File") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "EpubFile") base.copy_exe(core_build_dir + "/bin/" + platform_postfix, converter_dir, "x2t") base.generate_doctrenderer_config(converter_dir + "/DoctRenderer.config", "../../../", "server") # 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") 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") if (0 == platform.find("win")): base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", converter_dir + "/") else: base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", converter_dir + "/icudtl.dat") # builder base.copy_exe(core_build_dir + "/bin/" + platform_postfix, converter_dir, "docbuilder") base.copy_dir(git_dir + "/DocumentBuilder/empty", converter_dir + "/empty") # js js_dir = root_dir base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", js_dir + "/sdkjs") base.copy_dir(base_dir + "/js/" + branding + "/builder/web-apps", js_dir + "/web-apps") # plugins base.create_dir(js_dir + "/sdkjs-plugins") base.copy_sdkjs_plugins(js_dir + "/sdkjs-plugins", False, True) base.copy_sdkjs_plugins_server(js_dir + "/sdkjs-plugins", False, True) base.create_dir(js_dir + "/sdkjs-plugins/v1") base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js", js_dir + "/sdkjs-plugins/v1/plugins.js") base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", js_dir + "/sdkjs-plugins/v1/plugins-ui.js") base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", js_dir + "/sdkjs-plugins/v1/plugins.css") base.support_old_versions_plugins(js_dir + "/sdkjs-plugins") # tools tools_dir = root_dir + "/server/tools" base.create_dir(tools_dir) base.copy_exe(core_build_dir + "/bin/" + platform_postfix, tools_dir, "allfontsgen") base.copy_exe(core_build_dir + "/bin/" + platform_postfix, tools_dir, "allthemesgen") branding_dir = server_dir + "/branding" if("" != config.option("branding") and "onlyoffice" != config.option("branding")): branding_dir = git_dir + '/' + config.option("branding") + '/server' #dictionaries spellchecker_dictionaries = build_server_dir + '/SpellChecker/dictionaries' spellchecker_dictionaries_files = server_dir + '/../dictionaries/*_*' base.create_dir(spellchecker_dictionaries) base.copy_files(spellchecker_dictionaries_files, spellchecker_dictionaries) if (0 == platform.find("win")): exec_ext = '.exe' else: exec_ext = '' #schema schema_files = server_dir + '/schema' schema = build_server_dir + '/schema' base.create_dir(schema) base.copy_dir(schema_files, schema) #core-fonts core_fonts_files = server_dir + '/../core-fonts' core_fonts = build_server_dir + '/../core-fonts' base.create_dir(core_fonts) base.copy_dir_content(core_fonts_files, core_fonts, "", ".git") #license license_file1 = server_dir + '/LICENSE.txt' license_file2 = server_dir + '/3rd-Party.txt' license_dir = server_dir + '/license' license = build_server_dir + '/license' base.copy_file(license_file1, build_server_dir) base.copy_file(license_file2, build_server_dir) base.copy_dir(license_dir, license) #branding welcome_files = branding_dir + '/welcome' welcome = build_server_dir + '/welcome' base.create_dir(welcome) base.copy_dir(welcome_files, welcome) info_files = branding_dir + '/info' info = build_server_dir + '/info' base.create_dir(info) base.copy_dir(info_files, info) # example build_example_dir = root_dir + '-example' bin_example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs" base.create_dir(build_example_dir) base.copy_exe(bin_example_dir, build_example_dir, "example") base.copy_dir(bin_example_dir + "/config", build_example_dir + "/config") # snap if (0 == platform.find("linux")): base.create_dir(root_dir_snap) base.copy_dir(root_dir, root_dir_snap) base.copy_dir(bin_server_dir + '/DocService/node_modules', root_dir_snap + '/server/DocService/node_modules') base.copy_dir(bin_server_dir + '/DocService/sources', root_dir_snap + '/server/DocService/sources') base.copy_dir(bin_server_dir + '/DocService/public', root_dir_snap + '/server/DocService/public') base.delete_file(root_dir_snap + '/server/DocService/docservice') base.copy_dir(bin_server_dir + '/FileConverter/node_modules', root_dir_snap + '/server/FileConverter/node_modules') base.copy_dir(bin_server_dir + '/FileConverter/sources', root_dir_snap + '/server/FileConverter/sources') base.delete_file(root_dir_snap + '/server/FileConverter/converter') base.copy_dir(bin_server_dir + '/SpellChecker/node_modules', root_dir_snap + '/server/SpellChecker/node_modules') base.copy_dir(bin_server_dir + '/SpellChecker/sources', root_dir_snap + '/server/SpellChecker/sources') base.delete_file(root_dir_snap + '/server/SpellChecker/spellchecker') base.copy_dir(bin_server_dir + '/Common/node_modules', root_dir_snap + '/server/Common/node_modules') base.copy_dir(bin_server_dir + '/Common/sources', root_dir_snap + '/server/Common/sources') return
def make(): base_dir = base.get_script_dir() + "/../out" git_dir = base.get_script_dir() + "/../.." core_dir = git_dir + "/core" branding = config.branding() platforms = config.option("platform").split() for native_platform in platforms: if not native_platform in config.platforms: continue root_dir = base_dir + ("/" + native_platform + "/" + branding + ("/DocumentBuilder" if base.is_windows() else "/documentbuilder")) if (base.is_dir(root_dir)): base.delete_dir(root_dir) base.create_dir(root_dir) qt_dir = base.qt_setup(native_platform) # check platform on xp isWindowsXP = False if (-1 == native_platform.find("_xp")) else True platform = native_platform[0:-3] if isWindowsXP else native_platform core_build_dir = core_dir + "/build" if ("" != config.option("branding")): core_build_dir += ("/" + config.option("branding")) platform_postfix = platform + base.qt_dst_postfix() # x2t base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "UnicodeConverter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "graphics") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfWriter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfReader") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DjVuFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "XpsFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlFile2") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlRenderer") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "Fb2File") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "EpubFile") if ("ios" == platform): base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "x2t") else: base.copy_exe(core_build_dir + "/bin/" + 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") # doctrenderer if isWindowsXP: base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir, "doctrenderer") base.copy_file(core_build_dir + "/lib/" + platform_postfix + "/xp/doctrenderer.lib", root_dir + "/doctrenderer.lib") base.copy_files(core_dir + "/Common/3dParty/v8/v8_xp/" + platform + "/release/icudt*.dll", root_dir + "/") else: base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "doctrenderer") 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 + "/") 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 base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "docbuilder") base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder") base.copy_dir(git_dir + "/DocumentBuilder/empty", root_dir + "/empty") base.copy_dir(git_dir + "/DocumentBuilder/samples", root_dir + "/samples") # js base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", root_dir + "/sdkjs") base.create_dir(root_dir + "/sdkjs/vendor") base.copy_dir(base_dir + "/js/" + branding + "/builder/web-apps/vendor/jquery", root_dir + "/sdkjs/vendor/jquery") base.copy_dir(base_dir + "/js/" + branding + "/builder/web-apps/vendor/xregexp", root_dir + "/sdkjs/vendor/xregexp") # include base.create_dir(root_dir + "/include") base.copy_file(core_dir + "/DesktopEditor/doctrenderer/common_deploy.h", root_dir + "/include/common.h") base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.h", root_dir + "/include/docbuilder.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/x64/Release/docbuilder.com.dll", root_dir + "/docbuilder.com.dll") elif ("win_32" == platform): base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/Win32/Release/docbuilder.com.dll", root_dir + "/docbuilder.com.dll") # correct ios frameworks if ("ios" == platform): base.generate_plist(root_dir) if (0 == platform.find("mac")): base.mac_correct_rpath_x2t(root_dir) return
def make(): if ("android" == base.host_platform() or "ios" == config.option("platform")): return print("[fetch & build]: openssl") base_dir = base.get_script_dir() + "/../../core/Common/3dParty/openssl" old_cur = os.getcwd() os.chdir(base_dir) base.common_check_version("openssl", "1", clean) if not base.is_dir("openssl"): base.cmd("git", [ "clone", "--depth=1", "--branch", "OpenSSL_1_1_1f", "https://github.com/openssl/openssl.git" ]) os.chdir(base_dir + "/openssl") old_cur_dir = base_dir.replace(" ", "\\ ") if ("windows" == base.host_platform()): old_cur_dir = base_dir.replace(" ", "\\ ") if (-1 != config.option("platform").find("win_64") ) and not base.is_dir("../build/win_64"): base.create_dir("./../build/win_64") qmake_bat = [] qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x64") qmake_bat.append("perl Configure VC-WIN64A --prefix=" + old_cur_dir + "\\build\\win_64 --openssldir=" + old_cur_dir + "\\build\\win_64 no-shared no-asm") 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_32") ) and not base.is_dir("../build/win_32"): base.create_dir("./../build/win_32") qmake_bat = [] qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x86") qmake_bat.append("perl Configure VC-WIN32 --prefix=" + old_cur_dir + "\\build\\win_32 --openssldir=" + old_cur_dir + "\\build\\win_32 no-shared no-asm") 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") base.replaceInFile(base_dir + "/openssl/crypto/rand/rand_win.c", "define USE_BCRYPTGENRANDOM", "define USE_BCRYPTGENRANDOM_FIX") old_cur_dir = base_dir.replace(" ", "\\ ") if (-1 != config.option("platform").find("win_64_xp") ) and not base.is_dir("../build/win_64_xp"): base.create_dir("./../build/win_64_xp") qmake_bat = [] qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x64") qmake_bat.append("perl Configure VC-WIN64A --prefix=" + old_cur_dir + "\\build\\win_64_xp --openssldir=" + old_cur_dir + "\\build\\win_64_xp no-shared no-asm no-async") 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_32_xp") ) and not base.is_dir("../build/win_32_xp"): base.create_dir("./../build/win_32_xp") qmake_bat = [] qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x86") qmake_bat.append("perl Configure VC-WIN32 --prefix=" + old_cur_dir + "\\build\\win_32_xp --openssldir=" + old_cur_dir + "\\build\\win_32_xp no-shared no-asm no-async") 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) # ------------------------------------------------------------------------------------------------------- return if (-1 != config.option("platform").find("linux") ) and not base.is_dir("../build/linux_64"): base.cmd("./config", [ "no-shared", "no-asm", "--prefix=" + old_cur_dir + "/build/linux_64", "--openssldir=" + old_cur_dir + "/build/linux_64" ]) 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"]) # 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" ]) base.cmd("make", ["build_libs", "install"]) os.chdir(old_cur) return
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)
def make(): git_dir = base.get_script_dir() + "/../.." old_cur = os.getcwd() work_dir = git_dir + "/server/FileConverter/bin" if not base.is_dir(work_dir): base.create_dir(work_dir) os.chdir(work_dir) arch = "x64" arch2 = "_64" if ("windows" == base.host_platform()) and not base.host_platform_is64(): arch = "x86" arch2 = "_32" url = "http://repo-doc-onlyoffice-com.s3.amazonaws.com/" + base.host_platform( ) + "/core/" + config.option("branch") + "/latest/" + arch + "/core.7z" data_url = base.get_file_last_modified_url(url) old_data_url = base.readFile("./core.7z.data") if (old_data_url != data_url): print("-----------------------------------------------------------") print("Downloading core last version... --------------------------") print("-----------------------------------------------------------") if (base.is_file("./core.7z")): base.delete_file("./core.7z") if (base.is_dir("./core")): base.delete_dir("./core") if (base.is_dir("./HtmlFileInternal")): base.delete_dir("./HtmlFileInternal") base.download(url, "./core.7z") print("-----------------------------------------------------------") print("Extracting core last version... ---------------------------") print("-----------------------------------------------------------") base.extract("./core.7z", "./") base.writeFile("./core.7z.data", data_url) platform = "" if ("windows" == base.host_platform()): platform = "win" + arch2 else: platform = base.host_platform() + arch2 base.copy_files("./core/*", "./") base.generate_doctrenderer_config("./DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/") base.support_old_versions_plugins(git_dir + "/sdkjs-plugins") if base.is_dir(git_dir + "/fonts"): base.delete_dir(git_dir + "/fonts") base.create_dir(git_dir + "/fonts") if ("mac" == base.host_platform()): base.mac_correct_rpath_x2t("./") print("-----------------------------------------------------------") print("All fonts generation... -----------------------------------") print("-----------------------------------------------------------") base.cmd_exe("./allfontsgen", [ "--input=../../../core-fonts", "--allfonts-web=../../../sdkjs/common/AllFonts.js", "--allfonts=./AllFonts.js", "--images=../../../sdkjs/common/Images", "--selection=./font_selection.bin", "--use-system=true", "--output-web=../../../fonts" ]) print("All presentation themes generation... ---------------------") print("-----------------------------------------------------------") base.cmd_exe("./allthemesgen", [ "--converter-dir=\"" + git_dir + "/server/FileConverter/bin\"", "--src=\"" + git_dir + "/sdkjs/slide/themes\"", "--output=\"" + git_dir + "/sdkjs/common/Images\"" ]) # add directories to open directories data_local_devel = "{\n" data_local_devel += "\"services\": {\n" data_local_devel += "\"CoAuthoring\": {\n" data_local_devel += "\"server\": {\n" data_local_devel += "\"static_content\": {\n" is_exist_addons = False for addon in config.sdkjs_addons: data_local_devel += ("\"/" + config.sdkjs_addons[addon] + "\" : { \"path\": \"../../../" + config.sdkjs_addons[addon] + "\" },\n") is_exist_addons = True for addon in config.web_apps_addons: data_local_devel += ("\"/" + config.web_apps_addons[addon] + "\" : { \"path\": \"../../../" + config.web_apps_addons[addon] + "\" },\n") is_exist_addons = True if is_exist_addons: data_local_devel = data_local_devel[:-2] data_local_devel += "\n" data_local_devel += "}\n" data_local_devel += "}\n" data_local_devel += "}\n" data_local_devel += "}\n" data_local_devel += "}\n" base.writeFile( git_dir + "/server/Common/config/local-development-" + base.host_platform() + ".json", data_local_devel) os.chdir(old_cur) return
def make(): if ("1" == base.get_env("OO_NO_BUILD_JS")): return base_dir = base.get_script_dir() + "/.." out_dir = base_dir + "/out/js/" branding = config.option("branding-name") if ("" == branding): branding = "onlyoffice" out_dir += branding base.create_dir(out_dir) # builder build_interface(base_dir + "/../web-apps/build") build_sdk_builder(base_dir + "/../sdkjs/build") base.create_dir(out_dir + "/builder") base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/builder/web-apps") base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/builder/sdkjs") # desktop if config.check_option("module", "desktop"): build_sdk_desktop(base_dir + "/../sdkjs/build") base.create_dir(out_dir + "/desktop") base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/desktop/sdkjs") base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/desktop/web-apps") if not base.is_file(out_dir + "/desktop/sdkjs/common/AllFonts.js"): base.copy_file( base_dir + "/../sdkjs/common/HtmlFileInternal/AllFonts.js", out_dir + "/desktop/sdkjs/common/AllFonts.js") base.delete_dir(out_dir + "/desktop/web-apps/apps/documenteditor/embed") base.delete_dir(out_dir + "/desktop/web-apps/apps/documenteditor/mobile") base.delete_dir(out_dir + "/desktop/web-apps/apps/presentationeditor/embed") base.delete_dir(out_dir + "/desktop/web-apps/apps/presentationeditor/mobile") base.delete_dir(out_dir + "/desktop/web-apps/apps/spreadsheeteditor/embed") base.delete_dir(out_dir + "/desktop/web-apps/apps/spreadsheeteditor/mobile") 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") base.copy_file( base_dir + "/../desktop-apps/common/loginpage/deploy/index.html", out_dir + "/desktop/index.html") # mobile if config.check_option("module", "mobile"): build_sdk_native(base_dir + "/../sdkjs/build") base.create_dir(out_dir + "/mobile") base.create_dir(out_dir + "/mobile/sdkjs") vendor_dir_src = base_dir + "/../web-apps/vendor/" sdk_dir_src = base_dir + "/../sdkjs/deploy/sdkjs/" # banners base.join_scripts([ vendor_dir_src + "xregexp/xregexp-all-min.js", vendor_dir_src + "underscore/underscore-min.js", sdk_dir_src + "common/Native/native.js", sdk_dir_src + "../../common/Native/Wrappers/common.js", sdk_dir_src + "common/Native/jquery_native.js" ], out_dir + "/mobile/sdkjs/banners.js") base.create_dir(out_dir + "/mobile/sdkjs/word") base.join_scripts([ out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js" ], out_dir + "/mobile/sdkjs/word/script.bin") base.create_dir(out_dir + "/mobile/sdkjs/cell") base.join_scripts([ out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js" ], out_dir + "/mobile/sdkjs/cell/script.bin") base.create_dir(out_dir + "/mobile/sdkjs/slide") base.join_scripts([ out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js" ], out_dir + "/mobile/sdkjs/slide/script.bin") base.delete_file(out_dir + "/mobile/sdkjs/banners.js") return
def make(): base_dir = base.get_script_dir() + "/../out" git_dir = base.get_script_dir() + "/../.." core_dir = git_dir + "/core" branding = config.branding() platforms = config.option("platform").split() for native_platform in platforms: if not native_platform in config.platforms: continue root_dir = base_dir + ( "/" + native_platform + "/" + branding + ("/DesktopEditors" if base.is_windows() else "/desktopeditors")) if (base.is_dir(root_dir)): base.delete_dir(root_dir) base.create_dir(root_dir) qt_dir = base.qt_setup(native_platform) # check platform on xp isWindowsXP = False if (-1 == native_platform.find("_xp")) else True platform = native_platform[0:-3] if isWindowsXP else native_platform apps_postfix = "build" + base.qt_dst_postfix() if ("" != config.option("branding")): apps_postfix += ("/" + config.option("branding")) apps_postfix += "/" apps_postfix += platform if isWindowsXP: apps_postfix += "/xp" core_build_dir = core_dir + "/build" if ("" != config.option("branding")): core_build_dir += ("/" + config.option("branding")) platform_postfix = platform + base.qt_dst_postfix() # x2t base.create_dir(root_dir + "/converter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "kernel") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "UnicodeConverter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "graphics") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfWriter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfReader") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "DjVuFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "XpsFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlRenderer") if ("ios" == platform): base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "x2t") else: base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "x2t") # 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") 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") # doctrenderer if isWindowsXP: base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir + "/converter", "doctrenderer") base.copy_files( core_dir + "/Common/3dParty/v8/v8_xp/" + platform + "/release/icudt*.dll", root_dir + "/converter/") else: 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: 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") base.copy_dir(git_dir + "/desktop-apps/common/converter/empty", root_dir + "/converter/empty") if (False == isWindowsXP) and (0 != platform.find("mac")) and ( 0 != platform.find("ios")): base.copy_exe(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlFileInternal") # dictionaries base.create_dir(root_dir + "/dictionaries") base.copy_dir_content(git_dir + "/dictionaries", root_dir + "/dictionaries", "", ".git") base.copy_dir(git_dir + "/desktop-apps/common/package/fonts", root_dir + "/fonts") base.copy_file( git_dir + "/desktop-apps/common/package/license/3dparty/3DPARTYLICENSE", root_dir + "/3DPARTYLICENSE") # cef if not isWindowsXP: base.copy_files( core_dir + "/Common/3dParty/cef/" + platform + "/build/*", root_dir) else: base.copy_files( core_dir + "/Common/3dParty/cef/" + native_platform + "/build/*", root_dir) isUseQt = True if (0 == platform.find("mac")) or (0 == platform.find("ios")): isUseQt = False # libraries base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "hunspell") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "ooxmlsignature") base.copy_lib( core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "ascdocumentscore") if (0 != platform.find("mac")): base.copy_lib( core_build_dir + "/lib/" + platform_postfix + ("/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("Qt5Multimedia", root_dir) base.qt_copy_lib("Qt5MultimediaWidgets", root_dir) base.qt_copy_lib("Qt5Network", root_dir) base.qt_copy_lib("Qt5OpenGL", root_dir) base.qt_copy_plugin("bearer", root_dir) base.qt_copy_plugin("iconengines", root_dir) 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("mediaservice", root_dir) base.qt_copy_plugin("playlistformats", root_dir) base.qt_copy_plugin("platformthemes", root_dir) base.qt_copy_plugin("xcbglintegrations", root_dir) base.qt_copy_plugin("styles", root_dir) if (0 == platform.find("linux")): base.qt_copy_lib("Qt5DBus", root_dir) base.qt_copy_lib("Qt5X11Extras", root_dir) base.qt_copy_lib("Qt5XcbQpa", root_dir) base.qt_copy_icu(root_dir) base.copy_files( base.get_env("QT_DEPLOY") + "/../lib/libqgsttools_p.so*", root_dir) if (0 == platform.find("win")): base.copy_file( git_dir + "/desktop-apps/win-linux/extras/projicons/" + apps_postfix + "/projicons.exe", root_dir + "/DesktopEditors.exe") base.copy_file( git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors.exe", root_dir + "/editors.exe") base.copy_file( git_dir + "/desktop-apps/win-linux/res/icons/desktopeditors.ico", root_dir + "/app.ico") elif (0 == platform.find("linux")): base.copy_file( git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors", root_dir + "/DesktopEditors") base.create_dir(root_dir + "/editors") base.copy_dir(base_dir + "/js/" + branding + "/desktop/sdkjs", root_dir + "/editors/sdkjs") base.copy_dir(base_dir + "/js/" + branding + "/desktop/web-apps", root_dir + "/editors/web-apps") base.copy_dir( git_dir + "/desktop-sdk/ChromiumBasedEditors/resources/local", root_dir + "/editors/sdkjs/common/Images/local") base.create_dir(root_dir + "/editors/sdkjs-plugins") base.copy_file(git_dir + "/sdkjs-plugins/LICENSE.txt", root_dir + "/editors/sdkjs-plugins/LICENSE.txt") base.copy_file(git_dir + "/sdkjs-plugins/README.md", root_dir + "/editors/sdkjs-plugins/README.md") base.copy_file(git_dir + "/sdkjs-plugins/plugins.css", root_dir + "/editors/sdkjs-plugins/plugins.css") base.copy_file(git_dir + "/sdkjs-plugins/pluginBase.js", root_dir + "/editors/sdkjs-plugins/pluginBase.js") base.copy_dir( git_dir + "/sdkjs-plugins/youtube", root_dir + "/editors/sdkjs-plugins/{38E022EA-AD92-45FC-B22B-49DF39746DB4}") base.copy_dir( git_dir + "/sdkjs-plugins/ocr", root_dir + "/editors/sdkjs-plugins/{440EBF13-9B19-4BD8-8621-05200E58140B}") base.copy_dir( git_dir + "/sdkjs-plugins/translate", root_dir + "/editors/sdkjs-plugins/{7327FC95-16DA-41D9-9AF2-0E7F449F687D}") base.copy_dir( git_dir + "/sdkjs-plugins/synonim", root_dir + "/editors/sdkjs-plugins/{BE5CBF95-C0AD-4842-B157-AC40FEDD9840}") base.copy_dir( git_dir + "/sdkjs-plugins/code", root_dir + "/editors/sdkjs-plugins/{BE5CBF95-C0AD-4842-B157-AC40FEDD9841}") base.copy_dir( git_dir + "/sdkjs-plugins/photoeditor", root_dir + "/editors/sdkjs-plugins/{07FD8DFA-DFE0-4089-AL24-0730933CC80A}") base.copy_dir( git_dir + "/sdkjs-plugins/macros", root_dir + "/editors/sdkjs-plugins/{E6978D28-0441-4BD7-8346-82FAD68BCA3B}") base.copy_dir( git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/{8D67F3C5-7736-4BAE-A0F2-8C7127DC4BB8}", root_dir + "/editors/sdkjs-plugins/{8D67F3C5-7736-4BAE-A0F2-8C7127DC4BB8}") #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}") if (0 != platform.find("mac")): base.copy_dir( git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/{060E6A7D-2766-44E8-A0EE-9A8CB9DB00D1}", root_dir + "/editors/sdkjs-plugins/{060E6A7D-2766-44E8-A0EE-9A8CB9DB00D1}" ) base.copy_dir( git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/{B509123E-6335-40BD-B965-91EB799346E3}", root_dir + "/editors/sdkjs-plugins/{B509123E-6335-40BD-B965-91EB799346E3}" ) base.copy_dir( git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/{F7E59EB4-317E-4E0B-AB2C-58E038A59EE2}", root_dir + "/editors/sdkjs-plugins/{F7E59EB4-317E-4E0B-AB2C-58E038A59EE2}" ) base.copy_file(base_dir + "/js/" + branding + "/desktop/index.html", root_dir + "/index.html") base.copy_file( git_dir + "/desktop-apps/common/loginpage/addon/externalcloud.json", root_dir + "/editors/externalcloud.json") if (0 == platform.find("win")): base.copy_lib( git_dir + "/desktop-apps/win-linux/3dparty/WinSparkle/" + platform, root_dir, "WinSparkle") base.delete_file(root_dir + "/cef_sandbox.lib") base.delete_file(root_dir + "/libcef.lib") # 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")): base.mac_correct_rpath_desktop(root_dir) 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.delete_exe(root_dir + "/converter/allfontsgen") base.delete_exe(root_dir + "/converter/allthemesgen") base.delete_file(root_dir + "/converter/AllFonts.js") base.delete_file(root_dir + "/converter/font_selection.bin") base.delete_file(root_dir + "/editors/sdkjs/slide/sdk-all.cache") return
if (True != check_nodejs_version()): exit(0) platform = base.host_platform() if ("windows" == platform): restart_win_rabbit() elif ("mac" == platform): start_mac_services() base.print_info('Build modules') base.cmd_in_dir('../build_tools', 'python', ['configure.py', '--branch', 'develop', '--module', 'develop', '--update', '1', '--update-light', '1', '--clean', '0', '--sdkjs-addon', 'comparison', '--sdkjs-addon', 'content-controls', '--web-apps-addon', 'mobile', '--sdkjs-addon', 'sheet-views']) base.cmd_in_dir('../build_tools', 'python', ['make.py']) run_integration_example() base.create_dir('App_Data') install_module('DocService') install_module('Common') install_module('FileConverter') install_module('SpellChecker') base.set_env('NODE_ENV', 'development-' + platform) base.set_env('NODE_CONFIG_DIR', '../../Common/config') if ("mac" == platform): base.set_env('DYLD_LIBRARY_PATH', '../../FileConverter/bin/') elif ("linux" == platform): base.set_env('LD_LIBRARY_PATH', '../../FileConverter/bin/') run_module('DocService/sources', ['server.js'])
def make(): base_dir = base.get_script_dir() + "/../out" git_dir = base.get_script_dir() + "/../.." core_dir = git_dir + "/core" branding = config.branding() platforms = config.option("platform").split() for native_platform in platforms: if not native_platform in config.platforms: continue root_dir = base_dir + ( "/" + native_platform + "/" + branding + ("/DesktopEditors" if base.is_windows() else "/desktopeditors")) if (base.is_dir(root_dir)): base.delete_dir(root_dir) base.create_dir(root_dir) qt_dir = base.qt_setup(native_platform) # check platform on xp isWindowsXP = False if (-1 == native_platform.find("_xp")) else True platform = native_platform[0:-3] if isWindowsXP else native_platform apps_postfix = "build" + base.qt_dst_postfix() if ("" != config.option("branding")): apps_postfix += ("/" + config.option("branding")) apps_postfix += "/" apps_postfix += platform if isWindowsXP: apps_postfix += "/xp" core_build_dir = core_dir + "/build" if ("" != config.option("branding")): core_build_dir += ("/" + config.option("branding")) platform_postfix = platform + base.qt_dst_postfix() # x2t base.create_dir(root_dir + "/converter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "kernel") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "UnicodeConverter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "graphics") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfWriter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfReader") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "DjVuFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "XpsFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlFile2") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlRenderer") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "Fb2File") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "EpubFile") if ("ios" == platform): base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "x2t") else: base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "x2t") # 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") 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") # doctrenderer if isWindowsXP: base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir + "/converter", "doctrenderer") base.copy_files( core_dir + "/Common/3dParty/v8/v8_xp/" + platform + "/release/icudt*.dll", root_dir + "/converter/") else: 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: 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") base.copy_dir(git_dir + "/desktop-apps/common/converter/empty", root_dir + "/converter/empty") # dictionaries base.create_dir(root_dir + "/dictionaries") base.copy_dir_content(git_dir + "/dictionaries", root_dir + "/dictionaries", "", ".git") base.copy_dir(git_dir + "/desktop-apps/common/package/fonts", root_dir + "/fonts") base.copy_file( git_dir + "/desktop-apps/common/package/license/3dparty/3DPARTYLICENSE", root_dir + "/3DPARTYLICENSE") # cef if not isWindowsXP: base.copy_files( core_dir + "/Common/3dParty/cef/" + platform + "/build/*", root_dir) else: base.copy_files( core_dir + "/Common/3dParty/cef/" + native_platform + "/build/*", root_dir) isUseQt = True if (0 == platform.find("mac")) or (0 == platform.find("ios")): isUseQt = False # libraries base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "hunspell") base.copy_lib( core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "ooxmlsignature") base.copy_lib( core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "ascdocumentscore") if (0 != platform.find("mac")): base.copy_lib( core_build_dir + "/lib/" + platform_postfix + ("/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("Qt5Multimedia", root_dir) base.qt_copy_lib("Qt5MultimediaWidgets", root_dir) base.qt_copy_lib("Qt5Network", root_dir) base.qt_copy_lib("Qt5OpenGL", root_dir) base.qt_copy_plugin("bearer", root_dir) base.qt_copy_plugin("iconengines", root_dir) 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("mediaservice", root_dir) base.qt_copy_plugin("playlistformats", root_dir) base.qt_copy_plugin("platformthemes", root_dir) base.qt_copy_plugin("xcbglintegrations", root_dir) base.qt_copy_plugin("styles", root_dir) if (0 == platform.find("linux")): base.qt_copy_lib("Qt5DBus", root_dir) base.qt_copy_lib("Qt5X11Extras", root_dir) base.qt_copy_lib("Qt5XcbQpa", root_dir) base.qt_copy_icu(root_dir) base.copy_files( base.get_env("QT_DEPLOY") + "/../lib/libqgsttools_p.so*", root_dir) if (0 == platform.find("win")): base.copy_file( git_dir + "/desktop-apps/win-linux/extras/projicons/" + apps_postfix + "/projicons.exe", root_dir + "/DesktopEditors.exe") base.copy_file( git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors.exe", root_dir + "/editors.exe") base.copy_file( git_dir + "/desktop-apps/win-linux/res/icons/desktopeditors.ico", root_dir + "/app.ico") elif (0 == platform.find("linux")): base.copy_file( git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors", root_dir + "/DesktopEditors") base.copy_lib( core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "videoplayer") base.create_dir(root_dir + "/editors") base.copy_dir(base_dir + "/js/" + branding + "/desktop/sdkjs", root_dir + "/editors/sdkjs") base.copy_dir(base_dir + "/js/" + branding + "/desktop/web-apps", root_dir + "/editors/web-apps") base.copy_dir( git_dir + "/desktop-sdk/ChromiumBasedEditors/resources/local", root_dir + "/editors/sdkjs/common/Images/local") base.create_dir(root_dir + "/editors/sdkjs-plugins") base.copy_sdkjs_plugins(root_dir + "/editors/sdkjs-plugins", True, True) # remove some default plugins if base.is_dir(root_dir + "/editors/sdkjs-plugins/speech"): base.delete_dir(root_dir + "/editors/sdkjs-plugins/speech") # io base.create_dir(root_dir + "/editors/sdkjs-plugins/v1") base.download( "https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js", root_dir + "/editors/sdkjs-plugins/v1/plugins.js") base.download( "https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", root_dir + "/editors/sdkjs-plugins/v1/plugins-ui.js") base.download( "https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", root_dir + "/editors/sdkjs-plugins/v1/plugins.css") base.support_old_versions_plugins(root_dir + "/editors/sdkjs-plugins") base.copy_sdkjs_plugin( git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "manager", True) base.copy_sdkjs_plugin( git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt", root_dir + "/editors/sdkjs-plugins", "advanced2", True) #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}") if (0 != platform.find("mac")): base.copy_sdkjs_plugin( git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "sendto", True) base.copy_file(base_dir + "/js/" + branding + "/desktop/index.html", root_dir + "/index.html") base.copy_dir(git_dir + "/desktop-apps/common/loginpage/providers", root_dir + "/providers") isUseJSC = False if (0 == platform.find("mac")): file_size_doctrenderer = os.path.getsize( root_dir + "/converter/libdoctrenderer.dylib") print("file_size_doctrenderer: " + str(file_size_doctrenderer)) if (file_size_doctrenderer < 5 * 1024 * 1024): isUseJSC = True if isUseJSC: base.delete_file(root_dir + "/converter/icudtl.dat") if (0 == platform.find("win")): base.copy_lib( git_dir + "/desktop-apps/win-linux/3dparty/WinSparkle/" + platform, root_dir, "WinSparkle") base.delete_file(root_dir + "/cef_sandbox.lib") base.delete_file(root_dir + "/libcef.lib") # 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")): base.mac_correct_rpath_desktop(root_dir) 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.delete_exe(root_dir + "/converter/allfontsgen") base.delete_exe(root_dir + "/converter/allthemesgen") base.delete_file(root_dir + "/converter/AllFonts.js") base.delete_file(root_dir + "/converter/font_selection.bin") if not isUseJSC: base.delete_file(root_dir + "/editors/sdkjs/slide/sdk-all.cache") return
def make(): if not base.is_dir(current_dir): base.create_dir(current_dir) print("[fetch & build]: ixwebsocket") current_dir_old = os.getcwd() os.chdir(current_dir) if not base.is_dir(current_dir + "/IXWebSocket"): base.cmd("git", ["clone", "https://github.com/machinezone/IXWebSocket"]) # build for platform if (-1 != config.option("platform").find("android")): if base.is_dir(current_dir + "/IXWebSocket/build/android"): os.chdir(current_dir_old) return os.chdir(current_dir + "/IXWebSocket") global CMAKE CMAKE_TOOLCHAIN_FILE = base.get_env( "ANDROID_NDK_ROOT") + "/build/cmake/android.toolchain.cmake" CMAKE_DIR = base.get_android_sdk_home() + "/cmake/" CMAKE = CMAKE_DIR + find_last_version(os.listdir(CMAKE_DIR), CMAKE_DIR) + "/bin/cmake" def param_android(arch, api): return [ "-G", "Unix Makefiles", "-DANDROID_NATIVE_API_LEVEL=" + api, "-DANDROID_ABI=" + arch, "-DANDROID_TOOLCHAIN=clang", "-DANDROID_NDK=" + base.get_env("ANDROID_NDK_ROOT"), "-DCMAKE_TOOLCHAIN_FILE=" + CMAKE_TOOLCHAIN_FILE, "-DCMAKE_MAKE_PROGRAM=make" ] build_arch("android", "arm64-v8a", param_android("arm64-v8a", "21")) build_arch("android", "armeabi-v7a", param_android("armeabi-v7a", "16")) build_arch("android", "x86_64", param_android("x86_64", "21")) build_arch("android", "x86", param_android("x86", "16")) elif (-1 != config.option("platform").find("ios") or -1 != config.option("platform").find("mac")): platform = "ios" if -1 != config.option("platform").find( "ios") else "mac" if base.is_dir(current_dir + "/IXWebSocket/build/" + platform): os.chdir(current_dir_old) return if not base.is_dir(current_dir + "/ios-cmake"): base.cmd("git", ["clone", "https://github.com/leetal/ios-cmake"]) CMAKE_TOOLCHAIN_FILE = current_dir + "/ios-cmake/ios.toolchain.cmake" os_cmd = 'cmake' if os.system(os_cmd) != 0: base.cmd("brew install", ["cmake"]) os.chdir(current_dir + "/IXWebSocket") def param_apple(platform, arch): return [ "-G", "Xcode", "-DDEPLOYMENT_TARGET=10", "-DENABLE_BITCODE=1", "-DPLATFORM=" + platform, "-DARCHS=" + arch, "-DCMAKE_TOOLCHAIN_FILE=" + CMAKE_TOOLCHAIN_FILE ] if (platform == "ios"): build_arch("ios", "armv7", param_apple("OS", "armv7")) build_arch("ios", "arm64", param_apple("OS64", "arm64")) build_arch("ios", "i386", param_apple("SIMULATOR", "i386")) build_arch("ios", "x86_64", param_apple("SIMULATOR64", "x86_64")) else: build_arch("mac", "mac_arm64", param_apple("MAC_ARM64", "arm64")) build_arch("mac", "mac_64", param_apple("MAC", "x86_64")) os.chdir(current_dir) if (platform == "ios"): base.create_dir( current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal/include") base.create_dir(current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal/lib") #copy include prefix_dir = current_dir + "/IXWebSocket/build/ios/" postfix_dir = "" if base.is_dir(prefix_dir + "armv7/usr"): postfix_dir = "/usr" if base.is_dir(prefix_dir + "armv7" + postfix_dir + "/include"): base.cmd("cp", [ "-r", prefix_dir + "armv7" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal" ]) elif base.is_dir(prefix_dir + "armv64" + postfix_dir + "/include"): base.cmd("cp", [ "-r", prefix_dir + "armv64" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal" ]) elif base.is_dir(prefix_dir + "i386" + postfix_dir + "/include"): base.cmd("cp", [ "-r", prefix_dir + "i386" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal" ]) elif base.is_dir(prefix_dir + "x86_64" + postfix_dir + "/include"): base.cmd("cp", [ "-r", prefix_dir + "x86_64" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal" ]) # Create fat lib base.cmd("lipo", [ "IXWebSocket/build/ios/armv7" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/arm64" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/i386" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/x86_64" + postfix_dir + "/lib/libixwebsocket.a", "-create", "-output", "IXWebSocket/build/ios/ixwebsocket-universal/lib/libixwebsocket.a" ]) elif (-1 != config.option("platform").find("linux")): if base.is_dir(current_dir + "/IXWebSocket/build/linux"): os.chdir(current_dir_old) return #will support when openssl x86 will support #if (-1 != config.option("platform").find("linux_32")): #build_arch("linux", "linux_32", ["-G","Unix Makefiles", "-DCMAKE_MAKE_PROGRAM=make", "-DCMAKE_C_FLAGS=-m32", "-DCMAKE_CXX_FLAGS=-m32"]) if (-1 != config.option("platform").find("linux_64")): build_arch("linux", "linux_64", ["-G", "Unix Makefiles", "-DCMAKE_MAKE_PROGRAM=make"]) elif ("windows" == base.host_platform()): if base.is_dir(current_dir + "/IXWebSocket/build/windows"): os.chdir(current_dir_old) return if (-1 != config.option("platform").find("win_32")): build_arch("windows", "win_32", ["-G", "Visual Studio 14 2015", "-A", "Win32"]) build_arch("windows_debug", "win_32", ["-G", "Visual Studio 14 2015", "-A", "Win32"], True) if (-1 != config.option("platform").find("win_64")): build_arch("windows", "win_64", ["-G", "Visual Studio 14 2015 Win64"]) build_arch("windows_debug", "win_64", ["-G", "Visual Studio 14 2015 Win64"], True) os.chdir(current_dir_old) return
"./src/hunspell/filemgr.hxx", "#include <fstream>", "#include <fstream>\n#ifdef HUNSPELL_WASM_MODULE\n#include \"string_buffer_stream.h\"\n#endif\n" ) base.replaceInFile("./src/hunspell/csutil.cxx", "void free_utf_tbl() {", "void free_utf_tbl() { \n return;\n") # bug fix, we need to keep this utf table # free_utf_tbl doesnt delete anything so we can destroy huspell object os.chdir("../") 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("../") #fetch libhunspell HEAD = open("HEAD", "r") last_stable_commit = HEAD.read().split('\n')[ 0] # workaround to delete \n in the end of the line
#!/usr/bin/env python import sys sys.path.append('../..') import config import base import os import subprocess base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8_87" if not base.is_dir(base_dir): base.create_dir(base_dir) os.chdir(base_dir) if not base.is_dir("depot_tools"): base.cmd("git", [ "clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git" ]) os.environ[ "PATH"] = base_dir + "/depot_tools" + os.pathsep + os.environ["PATH"] if not base.is_dir("v8"): base.cmd("./depot_tools/fetch", ["v8"], True) base.cmd("./depot_tools/gclient", ["sync", "-r", "8.7.220.25"], True) base.cmd("gclient", ["sync", "--force"], True) os.chdir("v8") gn_args = [
def make(): print("[fetch & build]: cef") base_dir = base.get_script_dir() + "/../../core/Common/3dParty/cef" 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"] url = "http://d2ettrnqo7v976.cloudfront.net/cef/3770/" for platform in platforms: if not config.check_option("platform", platform): continue url += (platform + "/cef_binary.7z") if not base.is_dir(platform): base.create_dir(platform) os.chdir(platform) data_url = base.get_file_last_modified_url(url) old_data_url = base.readFile("./cef_binary.7z.data") if (data_url != old_data_url): if base.is_file("./cef_binary.7z"): base.delete_file("./cef_binary.7z") if base.is_dir("build"): base.delete_dir("build") if base.is_dir("build"): continue # download if not base.is_file("./cef_binary.7z"): base.download(url, "./cef_binary.7z") # extract base.extract("./cef_binary.7z", "./") base.delete_file("./cef_binary.7z.data") base.writeFile("./cef_binary.7z.data", data_url) base.create_dir("./build") # deploy if ("mac_64" != platform): base.copy_files("cef_binary/Release/*", "build/") base.copy_files("cef_binary/Resources/*", "build/") if (0 == platform.find("linux")): base.cmd("chmod", ["a+xr", "build/locales"]) if ("mac_64" == platform): base.cmd("mv", ["Chromium Embedded Framework.framework", "build/Chromium Embedded Framework.framework"]) os.chdir(base_dir) os.chdir(old_cur) return
def make(): base_dir = base.get_script_dir() + "/../out" git_dir = base.get_script_dir() + "/../.." core_dir = git_dir + "/core" branding = config.branding() platforms = config.option("platform").split() for native_platform in platforms: if not native_platform in config.platforms: continue root_dir = base_dir + "/" + native_platform + "/" + branding + "/mobile" if base.get_env("DESTDIR_BUILD_OVERRIDE") != "": return if (base.is_dir(root_dir)): base.delete_dir(root_dir) base.create_dir(root_dir) qt_dir = base.qt_setup(native_platform) platform = native_platform core_build_dir = core_dir + "/build" if ("" != config.option("branding")): core_build_dir += ("/" + config.option("branding")) platform_postfix = platform + base.qt_dst_postfix() # x2t base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "UnicodeConverter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "graphics") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfWriter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfReader") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DjVuFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "XpsFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlRenderer") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "doctrenderer") 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") # js base.copy_dir(base_dir + "/js/" + branding + "/mobile/sdkjs", root_dir + "/sdkjs") # correct ios frameworks if ("ios" == platform): base.generate_plist(root_dir) if (0 == platform.find("mac")): base.mac_correct_rpath_x2t(root_dir) for native_platform in platforms: if native_platform == "android": # make full version root_dir = base_dir + "/android/" + branding + "/mobile" if (base.is_dir(root_dir)): base.delete_dir(root_dir) base.create_dir(root_dir) # js base.copy_dir(base_dir + "/js/" + branding + "/mobile/sdkjs", root_dir + "/sdkjs") # app base.generate_doctrenderer_config( root_dir + "/DoctRenderer.config", "./", "builder") base.copy_dir(git_dir + "/DocumentBuilder/empty", root_dir + "/empty") 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") base.create_dir(libs_dir + "/armeabi-v7a") base.copy_files( base_dir + "/android_armv7/" + branding + "/mobile/*.so", libs_dir + "/armeabi-v7a") base.create_dir(libs_dir + "/x86") base.copy_files( base_dir + "/android_x86/" + branding + "/mobile/*.so", libs_dir + "/x86") base.create_dir(libs_dir + "/x86_64") base.copy_files( base_dir + "/android_x86_64/" + branding + "/mobile/*.so", libs_dir + "/x86_64") break return
def make_xp(): if not is_xp_platform(): return print("[fetch & build]: v8_xp") old_env = dict(os.environ) base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8/v8_xp" old_cur = os.getcwd() os.chdir(base_dir) if ("windows" == base.host_platform()): base.set_env("DEPOT_TOOLS_WIN_TOOLCHAIN", "0") base.set_env("GYP_MSVS_VERSION", "2015") base.common_check_version("v8", "1", clean) if not base.is_dir("win_64") and not base.is_dir("win_32"): clean() if not base.is_dir("depot_tools"): base.cmd( "git", ["clone", "http://120.92.49.206:3232/chromiumsrc/depot_tools.git"]) if ("windows" == base.host_platform()): # hack for 32 bit system!!! if base.is_file("depot_tools/cipd.ps1"): base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64") os.environ["PATH"] = os.pathsep.join([ base_dir + "/depot_tools", base_dir + "/depot_tools/win_tools-2_7_13_chromium7_bin/python/bin", config.option("vs-path") + "/../Common7/IDE", os.environ["PATH"] ]) # -------------------------------------------------------------------------- # fetch if not base.is_dir("v8"): base.cmd("./depot_tools/fetch", ["v8"], True) base.cmd("./depot_tools/gclient", ["sync", "-r", "4.10.253"], True) base.delete_dir_with_access_error("v8/buildtools/win") base.cmd("git", ["config", "--system", "core.longpaths", "true"]) base.cmd("gclient", ["sync", "--force"], True) # save common py script base.save_as_script("v8/build/common_xp.py", [ "import os", "def replaceInFile(path, text, textReplace):", " filedata = '';", " with open(path, 'r') as file:", " filedata = file.read()", " filedata = filedata.replace(text, textReplace)", " os.remove(path)", " with open(path, 'w') as file:", " file.write(filedata)", " return", "", "projects = ['v8/tools/gyp/v8_base_0.vcxproj', 'v8/tools/gyp/v8_base_1.vcxproj', 'v8/tools/gyp/v8_base_2.vcxproj', 'v8/tools/gyp/v8_base_3.vcxproj',", "'v8/tools/gyp/v8_libbase.vcxproj', 'v8/tools/gyp/v8_libplatform.vcxproj', 'v8/tools/gyp/v8_nosnapshot.vcxproj', 'v8/tools/gyp/mksnapshot.vcxproj',", "'v8/third_party/icu/icui18n.vcxproj', 'v8/third_party/icu/icuuc.vcxproj']", "", "for file in projects:", " replaceInFile(file, '<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>', '<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>')", " replaceInFile(file, '<RuntimeLibrary>MultiThreaded</RuntimeLibrary>', '<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>')", ]) if config.check_option("platform", "win_64_xp"): if not base.is_dir("win_64/release"): base.run_as_bat([ "call python v8/build/gyp_v8 -Dtarget_arch=x64", "call python v8/build/common_xp.py", "call devenv v8/tools/gyp/v8.sln /Rebuild Release" ]) base.create_dir("win_64/release") base.copy_files("v8/build/Release/lib/*", "win_64/release/") base.copy_file("v8/build/Release/icudt.dll", "win_64/release/icudt.dll") if (-1 != config.option("config").lower().find("debug") ) and not base.is_dir("win_64/debug"): base.run_as_bat([ "call python v8/build/gyp_v8 -Dtarget_arch=x64", "call python v8/build/common_xp.py", "call devenv v8/tools/gyp/v8.sln /Rebuild Debug" ]) base.create_dir("win_64/debug") base.copy_files("v8/build/Debug/lib/*", "win_64/debug/") base.copy_file("v8/build/Debug/icudt.dll", "win_64/debug/icudt.dll") if config.check_option("platform", "win_32_xp"): if not base.is_dir("win_32/release"): base.run_as_bat([ "call python v8/build/gyp_v8", "call python v8/build/common_xp.py", "call devenv v8/tools/gyp/v8.sln /Rebuild Release" ]) base.create_dir("win_32/release") base.copy_files("v8/build/Release/lib/*", "win_32/release/") base.copy_file("v8/build/Release/icudt.dll", "win_32/release/icudt.dll") if (-1 != config.option("config").lower().find("debug") ) and not base.is_dir("win_32/debug"): base.run_as_bat([ "call python v8/build/gyp_v8", "call python v8/build/common_xp.py", "call devenv v8/tools/gyp/v8.sln /Rebuild Debug" ]) base.create_dir("win_32/debug") base.copy_files("v8/build/Debug/lib/*", "win_32/debug/") base.copy_file("v8/build/Debug/icudt.dll", "win_32/debug/icudt.dll") os.chdir(old_cur) os.environ.clear() os.environ.update(old_env) return
import config import base import os import build_js # parse configuration config.parse() config.extend_option("jsminimize", "0") branding = config.option("branding-name") if ("" == branding): branding = "onlyoffice" base_dir = base.get_script_dir() + "/.." out_dir = base_dir + "/../native-sdk/examples/win-linux-mac/build/sdkjs" base.create_dir(out_dir) build_js.build_sdk_native(base_dir + "/../sdkjs/build") vendor_dir_src = base_dir + "/../web-apps/vendor/" sdk_dir_src = base_dir + "/../sdkjs/deploy/sdkjs/" base.join_scripts([ vendor_dir_src + "xregexp/xregexp-all-min.js", vendor_dir_src + "underscore/underscore-min.js", base_dir + "/../sdkjs/common/externs/jszip-utils.js", base_dir + "/../sdkjs/common/Native/native.js", base_dir + "/../sdkjs/common/Native/Wrappers/common.js", base_dir + "/../sdkjs/common/Native/jquery_native.js" ], out_dir + "/banners_word.js") base.join_scripts([