Example #1
0
def correct_install_includes_win(base_dir, platform):
  build_dir = base_dir + "/build/" + platform + "/include"
  if base.is_dir(build_dir + "/boost-1_72") and base.is_dir(build_dir + "/boost-1_72/boost"):
    base.copy_dir(build_dir + "/boost-1_72/boost", build_dir + "/boost")
    base.delete_dir(build_dir + "/boost-1_72")
  return
Example #2
0
def make():
    if not is_main_platform():
        make_xp()
        return

    if ("ios" == config.option("platform")):
        return

    print("[fetch & build]: v8")

    base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8"
    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("v8/out.gn"):
        clean()

    if not base.is_dir("depot_tools"):
        base.cmd("git", [
            "clone",
            "https://chromium.googlesource.com/chromium/tools/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"] = base_dir + "/depot_tools" + os.pathsep + os.environ["PATH"]

    if not base.is_dir("v8/out.gn"):
        base.cmd("gclient")

    # --------------------------------------------------------------------------
    # fetch
    if not base.is_dir("v8"):
        base.cmd("./depot_tools/fetch", ["v8"], True)
        os.chdir(base_dir + "/v8")
        base.cmd("git", ["checkout", "-b", "6.0", "branch-heads/6.0"], True)
        os.chdir(base_dir)

    # --------------------------------------------------------------------------
    # correct
    if not base.is_dir("v8/out.gn"):

        # windows hack (delete later) ----------------------
        if ("windows" == base.host_platform()):
            base.delete_dir_with_access_error("v8/buildtools/win")
            base.cmd("gclient", ["sync", "--force"], True)
        else:
            base.cmd("gclient", ["sync"], True)

        # normal version !!!
        #base.cmd("gclient", ["sync"], True)
        # --------------------------------------------------

        if ("linux" == base.host_platform()):
            if base.is_dir("v8/third_party/binutils/Linux_x64/Release"):
                base.delete_dir("v8/third_party/binutils/Linux_x64/Release")
            if base.is_dir("v8/third_party/binutils/Linux_ia32/Release"):
                base.delete_dir("v8/third_party/binutils/Linux_ia32/Release")

            base.cmd("gclient", ["sync", "--no-history"])

            if base.is_dir("v8/third_party/binutils/Linux_x64/Release/bin"):
                for file in os.listdir(
                        "v8/third_party/binutils/Linux_x64/Release/bin"):
                    name = file.split("/")[-1]
                    if ("ld.gold" != name):
                        base.cmd("mv", [
                            "v8/third_party/binutils/Linux_x64/Release/bin/" +
                            name,
                            "v8/third_party/binutils/Linux_x64/Release/bin/old_"
                            + name
                        ])
                        base.cmd("ln", [
                            "-s", "/usr/bin/" + name,
                            "v8/third_party/binutils/Linux_x64/Release/bin/" +
                            name
                        ])

            if base.is_dir("v8/third_party/binutils/Linux_ia32/Release/bin"):
                for file in os.listdir(
                        "v8/third_party/binutils/Linux_ia32/Release/bin"):
                    name = file.split("/")[-1]
                    if ("ld.gold" != name):
                        base.cmd("mv", [
                            "v8/third_party/binutils/Linux_ia32/Release/bin/" +
                            name,
                            "v8/third_party/binutils/Linux_ia32/Release/bin/old_"
                            + name
                        ])
                        base.cmd("ln", [
                            "-s", "/usr/bin/" + name,
                            "v8/third_party/binutils/Linux_ia32/Release/bin/" +
                            name
                        ])

        if ("windows" == base.host_platform()):
            base.replaceInFile("v8/build/config/win/BUILD.gn", ":static_crt",
                               ":dynamic_crt")
        if ("mac" == base.host_platform()):
            base.replaceInFile(
                "v8/build/config/mac/mac_sdk.gni",
                "if (mac_sdk_version != mac_sdk_min_build_override",
                "if (false && mac_sdk_version != mac_sdk_min_build_override")

    # --------------------------------------------------------------------------
    # build
    os.chdir("v8")

    base_args64 = "target_cpu=\\\"x64\\\" v8_target_cpu=\\\"x64\\\" v8_static_library=true is_component_build=false v8_use_snapshot=false"
    base_args32 = "target_cpu=\\\"x86\\\" v8_target_cpu=\\\"x86\\\" v8_static_library=true is_component_build=false v8_use_snapshot=false"

    if config.check_option("platform", "linux_64"):
        base.cmd2("gn", [
            "gen", "out.gn/linux_64", "--args=\"is_debug=false " +
            base_args64 + " is_clang=" + is_use_clang() +
            " use_sysroot=false treat_warnings_as_errors=false\""
        ])
        base.cmd("ninja", ["-C", "out.gn/linux_64"])

    if config.check_option("platform", "linux_32"):
        base.cmd2("gn", [
            "gen", "out.gn/linux_32", "--args=\"is_debug=false " +
            base_args32 + " is_clang=" + is_use_clang() +
            " use_sysroot=false treat_warnings_as_errors=false\""
        ])
        base.cmd("ninja", ["-C", "out.gn/linux_32"])

    if config.check_option("platform", "mac_64"):
        base.cmd2("gn", [
            "gen", "out.gn/mac_64",
            "--args=\"is_debug=false " + base_args64 + "\""
        ])
        base.cmd("ninja", ["-C", "out.gn/mac_64"])

    if config.check_option("platform", "win_64"):
        if (-1 != config.option("config").lower().find("debug")):
            base.cmd2("gn", [
                "gen", "out.gn/win_64/debug",
                "--args=\"is_debug=true " + base_args64 + " is_clang=false\""
            ])
            base.cmd("ninja", ["-C", "out.gn/win_64/debug"])

        base.cmd2("gn", [
            "gen", "out.gn/win_64/release",
            "--args=\"is_debug=false " + base_args64 + " is_clang=false\""
        ])
        base.cmd("ninja", ["-C", "out.gn/win_64/release"])

    if config.check_option("platform", "win_32"):
        if (-1 != config.option("config").lower().find("debug")):
            base.cmd2("gn", [
                "gen", "out.gn/win_32/debug",
                "--args=\"is_debug=true " + base_args32 + " is_clang=false\""
            ])
            base.cmd("ninja", ["-C", "out.gn/win_32/debug"])

        base.cmd2("gn", [
            "gen", "out.gn/win_32/release",
            "--args=\"is_debug=false " + base_args32 + " is_clang=false\""
        ])
        base.cmd("ninja", ["-C", "out.gn/win_32/release"])

    os.chdir(old_cur)

    make_xp()

    return
Example #3
0
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")):
      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() + "/../.."
    branding = config.branding()

    platforms = config.option("platform").split()
    for native_platform in platforms:
        if not native_platform in config.platforms:
            continue

        isWindowsXP = False if (-1 == native_platform.find("_xp")) else True
        platform = native_platform[0:-3] if isWindowsXP else native_platform

        if (0 == platform.find("mac")):
            macos_dir = git_dir + "/desktop-apps/macos"
            update_dir = macos_dir + "/build/update"

            isX86 = True if ("" != base.get_env("_X86")) else False

            target = "release" if not isX86 else "release_x86"
            base.cmd_in_dir(macos_dir, "bundler",
                            ["exec", "fastlane", target, "skip_git_bump:true"])

            package = "ONLYOFFICE" if not isX86 else "ONLYOFFICE-x86"
            app_version = base.run_command("mdls -name kMDItemVersion -raw " +
                                           macos_dir +
                                           "/build/ONLYOFFICE.app")['stdout']
            macos_zip = macos_dir + "/build/" + package + "-" + app_version + ".zip"
            update_storage = base.get_env(
                "ARCHIVES_DIR") + "/" + package + "/_updates"
            changes_dir = macos_dir + "/ONLYOFFICE/update/updates/ONLYOFFICE/changes/" + app_version
            base.delete_dir(update_dir)
            base.delete_dir(
                os.path.expanduser(
                    "~/Library/Caches/Sparkle_generate_appcast"))
            base.create_dir(update_dir)
            base.copy_dir_content(update_storage, update_dir, ".zip")
            base.copy_file(macos_zip, update_dir)
            for file in os.listdir(update_dir):
                if file.endswith(".zip"):
                    base.copy_file(
                        changes_dir + "/ReleaseNotes.html",
                        update_dir + "/" + os.path.splitext(file)[0] + ".html")
                    base.copy_file(
                        changes_dir + "/ReleaseNotesRU.html", update_dir +
                        "/" + os.path.splitext(file)[0] + ".ru.html")

            base.cmd(macos_dir + "/Vendor/Sparkle/bin/generate_appcast",
                     [update_dir])

            base_url = "https://download.onlyoffice.com/install/desktop/editors/mac"
            changes_url = base_url + "/updates/onlyoffice/changes"
            update_url = base_url + ("/updates/onlyoffice"
                                     if not isX86 else "/x86")

            base.replaceInFileRE(
                update_dir + "/onlyoffice.xml",
                r"(<sparkle:releaseNotesLink>)(?:.+ONLYOFFICE(?:|-x86)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
                "\\1" + changes_url + "/\\2/ReleaseNotes.html\\3")
            base.replaceInFileRE(
                update_dir + "/onlyoffice.xml",
                r"(<sparkle:releaseNotesLink xml:lang=\"ru\">)(?:ONLYOFFICE(?:|-x86)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
                "\\1" + changes_url + "/\\2/ReleaseNotesRU.html\\3")
            base.replaceInFileRE(update_dir + "/onlyoffice.xml",
                                 r"(url=\")(?:.+/)(ONLYOFFICE.+\")",
                                 "\\1" + update_url + "/\\2")

            for file in os.listdir(update_dir):
                if -1 == file.find(app_version) and (file.endswith(".zip") or
                                                     file.endswith(".html")):
                    base.delete_dir(update_dir + "/" + file)

    return
Example #5
0
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", "mac_arm64"
    ]

    url = "http://d2ettrnqo7v976.cloudfront.net/cef/4280/"

    for platform in platforms:
        if not config.check_option("platform", platform):
            continue

        url_platform = (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_platform)
        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"):
            os.chdir(base_dir)
            continue

        # download
        if not base.is_file("./cef_binary.7z"):
            base.download(url_platform, "./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 (0 != platform.find("mac")):
            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 (0 == platform.find("mac")):
            base.cmd("mv", [
                "Chromium Embedded Framework.framework",
                "build/Chromium Embedded Framework.framework"
            ])

        os.chdir(base_dir)

    os.chdir(old_cur)
    return
Example #6
0
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 not base.is_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
Example #7
0
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,
                      "kernel_network")
        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,
                      "doctrenderer")
        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 (0 == platform.find("win") or 0 == platform.find("linux")
                or 0 == platform.find("mac")):
            base.copy_exe(core_build_dir + "/bin/" + platform_postfix,
                          root_dir, "x2t")
        else:
            base.copy_lib(core_build_dir + "/lib/" + platform_postfix,
                          root_dir, "x2t")

        if ("ios" == platform) and config.check_option(
                "config", "bundle_dylibs") and config.check_option(
                    "config", "simulator"):
            exclude_arch(root_dir, [
                "kernel", "kernel_network", "UnicodeConverter", "graphics",
                "PdfWriter", "PdfReader", "DjVuFile", "XpsFile", "HtmlFile2",
                "HtmlRenderer", "doctrenderer", "Fb2File", "EpubFile", "x2t"
            ])

        # icu
        if (0 == platform.find("win")):
            base.copy_file(
                core_dir + "/Common/3dParty/icu/" + platform +
                "/build/icudt58.dll", root_dir + "/icudt58.dll")
            base.copy_file(
                core_dir + "/Common/3dParty/icu/" + platform +
                "/build/icuuc58.dll", root_dir + "/icuuc58.dll")

        if (0 == platform.find("linux")):
            base.copy_file(
                core_dir + "/Common/3dParty/icu/" + platform +
                "/build/libicudata.so.58", root_dir + "/libicudata.so.58")
            base.copy_file(
                core_dir + "/Common/3dParty/icu/" + platform +
                "/build/libicuuc.so.58", root_dir + "/libicuuc.so.58")

        if (0 == platform.find("mac")):
            base.copy_file(
                core_dir + "/Common/3dParty/icu/" + platform +
                "/build/libicudata.58.dylib",
                root_dir + "/libicudata.58.dylib")
            base.copy_file(
                core_dir + "/Common/3dParty/icu/" + platform +
                "/build/libicuuc.58.dylib", root_dir + "/libicuuc.58.dylib")

        if (0 == platform.find("android")):
            #base.copy_file(core_dir + "/Common/3dParty/icu/android/build/" + platform[8:] + "/libicudata.so", root_dir + "/libicudata.so")
            #base.copy_file(core_dir + "/Common/3dParty/icu/android/build/" + platform[8:] + "/libicuuc.so", root_dir + "/libicuuc.so")
            base.copy_file(
                core_dir + "/Common/3dParty/icu/android/build/" +
                platform[8:] + "/icudt58l.dat", root_dir + "/icudt58l.dat")

        # 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")
            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.copy_files(
                base_dir + "/android_arm64_v8a/" + branding + "/mobile/*.so.*",
                libs_dir + "/arm64-v8a")
            base.copy_files(
                base_dir + "/android_arm64_v8a/" + branding + "/mobile/*.dat",
                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.copy_files(
                base_dir + "/android_armv7/" + branding + "/mobile/*.so.*",
                libs_dir + "/armeabi-v7a")
            base.copy_files(
                base_dir + "/android_armv7/" + branding + "/mobile/*.dat",
                libs_dir + "/armeabi-v7a")
            base.create_dir(libs_dir + "/x86")
            base.copy_files(
                base_dir + "/android_x86/" + branding + "/mobile/*.so",
                libs_dir + "/x86")
            base.copy_files(
                base_dir + "/android_x86/" + branding + "/mobile/*.so.*",
                libs_dir + "/x86")
            base.copy_files(
                base_dir + "/android_x86/" + branding + "/mobile/*.dat",
                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")
            base.copy_files(
                base_dir + "/android_x86_64/" + branding + "/mobile/*.so.*",
                libs_dir + "/x86_64")
            base.copy_files(
                base_dir + "/android_x86_64/" + branding + "/mobile/*.dat",
                libs_dir + "/x86_64")
            break

    return
Example #8
0
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\""
    ])

    #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
    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