Beispiel #1
0
def check_compiler(platform):
  compiler = {}
  compiler["compiler"] = option("compiler")
  compiler["compiler_64"] = compiler["compiler"] + "_64"

  if ("" != compiler["compiler"]):
    if ("ios" == platform):
      compiler["compiler_64"] = compiler["compiler"]
    return compiler

  if (0 == platform.find("win")):
    compiler["compiler"] = "msvc2015"
    compiler["compiler_64"] = "msvc2015_64"
  elif (0 == platform.find("linux")):
    compiler["compiler"] = "gcc"
    compiler["compiler_64"] = "gcc_64"
  elif (0 == platform.find("mac")):
    compiler["compiler"] = "clang"
    compiler["compiler_64"] = "clang_64"
  elif ("ios" == platform):
    compiler["compiler"] = "ios"
    compiler["compiler_64"] = "ios"
  elif (0 == platform.find("android")):
    compiler["compiler"] = platform
    compiler["compiler_64"] = platform

  if base.host_platform() == "mac":
    if not base.is_dir(options["qt-dir"] + "/" + compiler["compiler_64"]):
      if base.is_dir(options["qt-dir"] + "/macos"):
        compiler["compiler"] = "macos"
        compiler["compiler_64"] = "macos"

  return compiler
def make():
  #check server module to build
  if(not config.check_option("module", "server")):
    return

  server_dir = base.get_script_dir() + "/../../server"

  base.cmd_in_dir(server_dir, "npm", ["install"])
  base.cmd_in_dir(server_dir, "grunt", ["--no-color", "-v"] + base.server_addons_param())

    #env variables
  product_version = base.get_env('PRODUCT_VERSION')
  if(not product_version):
    product_version = "0.0.0"

  build_number = base.get_env('BUILD_NUMBER')
  if(not build_number):
    build_number = "0"

  cur_date = datetime.date.today().strftime("%m/%d/%Y")

  server_build_dir = server_dir + "/build/server"

  base.replaceInFileRE(server_build_dir + "/Common/sources/commondefines.js", "const buildNumber = [0-9]*", "const buildNumber = " + build_number)
  base.replaceInFileRE(server_build_dir + "/Common/sources/license.js", "const buildDate = '[0-9-/]*'", "const buildDate = '" + cur_date + "'")
  base.replaceInFileRE(server_build_dir + "/Common/sources/commondefines.js", "const buildVersion = '[0-9.]*'", "const buildVersion = '" + product_version + "'")

  pkg_target = "node10"

  if ("linux" == base.host_platform()):
    pkg_target += "-linux"

  if ("windows" == base.host_platform()):
    pkg_target += "-win"

  base.cmd_in_dir(server_build_dir + "/DocService", "pkg", [".", "-t", pkg_target, "--options", "max_old_space_size=4096", "-o", "docservice"])
  base.cmd_in_dir(server_build_dir + "/FileConverter", "pkg", [".", "-t", pkg_target, "-o", "converter"])
  base.cmd_in_dir(server_build_dir + "/Metrics", "pkg", [".", "-t", pkg_target, "-o", "metrics"])
  base.cmd_in_dir(server_build_dir + "/SpellChecker", "pkg", [".", "-t", pkg_target, "-o", "spellchecker"])

  example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs"
  base.cmd_in_dir(example_dir, "npm", ["install"])
  base.cmd_in_dir(example_dir, "pkg", [".", "-t", pkg_target, "-o", "example"])
Beispiel #3
0
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...")
Beispiel #4
0
def make():
    if ("windows" == 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")
    if not base.is_file("Makefile"):
        base.cmd("./config", ["no-shared", "no-asm"])

    if base.is_file("./libssl.a") and base.is_file("./libcrypto.a"):
        os.chdir(old_cur)
        return

    if ("linux" == base.host_platform()):
        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", ["build_libs"])

    os.chdir(old_cur)
    return
Beispiel #5
0
def make():
  if (config.check_option("platform", "android")) and (base.host_platform() == "mac") and (base.is_os_arm()):
    for toolchain in glob.glob(base.get_env("ANDROID_NDK_ROOT") + "/toolchains/*"):
      if base.is_dir(toolchain):
        check_android_ndk_macos_arm(toolchain + "/prebuilt")

  boost.make()
  cef.make()
  icu.make()
  openssl.make()
  v8.make()
  html2.make()
  hunspell.make(False)
  glew.make()
  if config.check_option("module", "mobile"):
    curl.make()
    websocket.make()
  return
Beispiel #6
0
def make():
    if ("windows" != base.host_platform()):
        return

    if not config.check_option("module", "mobile"):
        return

    print("[fetch & build]: glew")
    base_dir = base.get_script_dir() + "/../../core/Common/3dParty/glew"
    old_cur = os.getcwd()
    os.chdir(base_dir)

    base.common_check_version("glew", "1", clean)

    if not base.is_dir("glew-2.1.0"):
        base.download(
            "https://deac-ams.dl.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0-win32.zip",
            "./archive.zip")
        base.extract("./archive.zip", "./")
        base.delete_file("./archive.zip")

    os.chdir(old_cur)
    return
Beispiel #7
0
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
Beispiel #8
0
# developing...
if ("develop" == config.option("module")):
    build_js.build_js_develop(base_dir + "/..")
    deploy.make()
    exit(0)

# check only js builds
if ("1" == base.get_env("OO_ONLY_BUILD_JS")):
    build_js.make()
    exit(0)

# core 3rdParty
make_common.make()

# build updmodule for desktop (only for windows version)
if ("windows" == base.host_platform()) and (config.check_option(
        "module", "desktop")):
    config.extend_option("config", "updmodule")
    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",
Beispiel #9
0
def make():
    is_no_brandind_build = base.is_file("config")

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

        print("------------------------------------------")
        print("BUILD_PLATFORM: " + platform)
        print("------------------------------------------")
        old_env = os.environ.copy()

        isAndroid = False if (-1 == platform.find("android")) else True
        if isAndroid:
            toolchain_platform = "linux-x86_64"
            if ("mac" == base.host_platform()):
                toolchain_platform = "darwin-x86_64"
            base.set_env("ANDROID_NDK_HOST", toolchain_platform)
            old_path = base.get_env("PATH")
            new_path = base.qt_setup(platform) + "/bin:"
            new_path += (base.get_env("ANDROID_NDK_ROOT") +
                         "/toolchains/llvm/prebuilt/" + toolchain_platform +
                         "/bin:")
            new_path += old_path
            base.set_env("PATH", new_path)
            if ("android_arm64_v8a" == platform):
                base.set_env("ANDROID_NDK_PLATFORM", "android-21")
            else:
                base.set_env("ANDROID_NDK_PLATFORM", "android-16")

        # makefile suffix
        file_suff = platform
        if (config.check_option("config", "debug")):
            file_suff += "_debug_"
        file_suff += config.option("branding")

        # setup qt
        qt_dir = base.qt_setup(platform)
        base.set_env("OS_DEPLOY", platform)

        # qmake CONFIG+=...
        config_param = base.qt_config(platform)

        # qmake ADDON
        qmake_addon = []
        if ("" != config.option("qmake_addon")):
            qmake_addon.append(config.option("qmake_addon"))

        # non windows platform
        if not base.is_windows():
            if ("1" == config.option("clean")):
                base.cmd(
                    base.app_make(),
                    ["clean", "-f", "makefiles/build.makefile_" + file_suff],
                    True)
                base.cmd(base.app_make(), [
                    "distclean", "-f", "makefiles/build.makefile_" + file_suff
                ], True)

            if base.is_file("makefiles/build.makefile_" + file_suff):
                base.delete_file("makefiles/build.makefile_" + file_suff)
            base.cmd(qt_dir + "/bin/qmake",
                     ["-nocache", "build.pro", "CONFIG+=" + config_param] +
                     qmake_addon)
            base.cmd(base.app_make(),
                     ["-f", "makefiles/build.makefile_" + file_suff])
        else:
            qmake_bat = []
            qmake_bat.append(
                "call \"" + config.option("vs-path") + "/vcvarsall.bat\" " +
                ("x86" if base.platform_is_32(platform) else "x64"))
            if ("1" == config.option("clean")):
                qmake_bat.append(
                    "call nmake clean -f makefiles/build.makefile_" +
                    file_suff)
                qmake_bat.append(
                    "call nmake distclean -f makefiles/build.makefile_" +
                    file_suff)
            qmake_addon_string = ""
            if ("" != config.option("qmake_addon")):
                qmake_addon_string = " \"" + config.option(
                    "qmake_addon") + "\""
            qmake_bat.append("if exist ./makefiles/build.makefile_" +
                             file_suff +
                             " del /F ./makefiles/build.makefile_" + file_suff)
            qmake_bat.append("call \"" + qt_dir +
                             "/bin/qmake\" -nocache build.pro \"CONFIG+=" +
                             config_param + "\"" + qmake_addon_string)
            qmake_bat.append("call nmake -f makefiles/build.makefile_" +
                             file_suff)
            base.run_as_bat(qmake_bat)

        os.environ = old_env.copy()

        base.delete_file(".qmake.stash")

    if config.check_option(
            "module",
            "builder") and base.is_windows() and is_no_brandind_build:
        base.bash("../core/DesktopEditor/doctrenderer/docbuilder.com/build")

    return
Beispiel #10
0
def make():
    if not is_main_platform():
        make_xp()
        return

    base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8"
    if ("ios" == config.option("platform")):
        return

    if (-1 != config.option("platform").find("android")):
        base.cmd_in_dir(base_dir + "/android", "python", ["./make.py"])
        if (-1 == config.option("platform").find("linux")) and (
                -1 == config.option("platform").find("mac")) and (
                    -1 == config.option("platform").find("win")):
            return

    print("[fetch & build]: v8")
    old_env = dict(os.environ)

    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", "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")
        if base.is_file("depot_tools/fetch_configs/v8.py"):
            base.replaceInFile("depot_tools/fetch_configs/v8.py",
                               "https://chromium.googlesource.com/v8/v8.git",
                               "https://gitee.com/mirrors/V8.git")

    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("git", ["config", "--system", "core.longpaths", "true"])
            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")
            base.replaceInFile("v8/build/mac/find_sdk.py",
                               "^MacOSX(10\\.\\d+)\\.sdk$",
                               "^MacOSX(1\\d\\.\\d+)\\.sdk$")

    # --------------------------------------------------------------------------
    # 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)
    os.environ.clear()
    os.environ.update(old_env)

    make_xp()
    return
Beispiel #11
0
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
Beispiel #12
0
def make():
    print("[fetch & build]: boost")

    base_dir = base.get_script_dir() + "/../../core/Common/3dParty/boost"
    old_cur = os.getcwd()
    os.chdir(base_dir)

    # download
    #url = "https://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.7z"
    #if not base.is_file("boost_1_58_0.7z"):
    #  base.download("https://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.7z", "boost_1_58_0.7z")
    #if not base.is_dir("boost_1_58_0"):
    #  base.extract("boost_1_58_0.7z", "./")

    base.common_check_version("boost", "5", clean)

    if not base.is_dir("boost_1_72_0"):
        base.cmd("git", [
            "clone", "--recursive", "--depth=1",
            "https://github.com/boostorg/boost.git", "boost_1_72_0", "-b"
            "boost-1.72.0"
        ])

    os.chdir("boost_1_72_0")

    # build
    if ("windows" == base.host_platform()):
        win_toolset = "msvc-14.0"
        if (-1 != config.option("platform").find("win_64")
            ) and not base.is_dir("../build/win_64"):
            base.cmd("bootstrap.bat")
            base.cmd("b2.exe", ["headers"])
            base.cmd("b2.exe", ["--clean"])
            base.cmd("b2.exe", [
                "--prefix=./../build/win_64", "link=static",
                "--with-filesystem", "--with-system", "--with-date_time",
                "--with-regex", "--toolset=" + win_toolset, "address-model=64",
                "install"
            ])
        if (-1 != config.option("platform").find("win_32")
            ) and not base.is_dir("../build/win_32"):
            base.cmd("bootstrap.bat")
            base.cmd("b2.exe", ["headers"])
            base.cmd("b2.exe", ["--clean"])
            base.cmd("b2.exe", [
                "--prefix=./../build/win_32", "link=static",
                "--with-filesystem", "--with-system", "--with-date_time",
                "--with-regex", "--toolset=" + win_toolset, "address-model=32",
                "install"
            ])
        correct_install_includes_win(base_dir, "win_64")
        correct_install_includes_win(base_dir, "win_32")

    if (-1 != config.option("platform").find("linux")
        ) and not base.is_dir("../build/linux_64"):
        base.cmd("./bootstrap.sh",
                 ["--with-libraries=filesystem,system,date_time,regex"])
        base.cmd("./b2", ["headers"])
        base.cmd("./b2", ["--clean"])
        base.cmd("./b2", [
            "--prefix=./../build/linux_64", "link=static", "cxxflags=-fPIC",
            "install"
        ])
        # TODO: support x86

    if (-1 != config.option("platform").find("mac")
        ) and not base.is_dir("../build/mac_64"):
        clang_correct()
        base.cmd("./bootstrap.sh",
                 ["--with-libraries=filesystem,system,date_time,regex"])
        base.cmd("./b2", ["headers"])
        base.cmd("./b2", ["--clean"])
        base.cmd("./b2",
                 ["--prefix=./../build/mac_64", "link=static", "install"])

    if (-1 != config.option("platform").find("ios")
        ) and not base.is_dir("../build/ios"):
        clang_correct()
        os.chdir("../")
        base.bash("./boost_ios")

    if (-1 != config.option("platform").find("android")):
        platforms = config.option("platform").split()
        for platform in platforms:
            if not platform in config.platforms:
                continue
            if (0 != platform.find("android")):
                continue
            if (base.is_dir("../build/" + platform)):
                continue
            boost_android.make(platform[8:])

    os.chdir(old_cur)
    return
Beispiel #13
0
def make():
    #check server module to build
    if (not config.check_option("module", "server")):
        return

    git_dir = base.get_script_dir() + "/../.."
    server_dir = base.get_script_dir() + "/../../server"
    branding_dir = server_dir + "/branding"

    if ("" != config.option("branding")):
        branding_dir = git_dir + '/' + config.option("branding") + '/server'

    base.cmd_in_dir(server_dir, "npm", ["install"])
    base.cmd_in_dir(server_dir, "grunt",
                    ["--no-color", "-v"] + base.server_addons_param())

    #env variables
    product_version = base.get_env('PRODUCT_VERSION')
    if (not product_version):
        product_version = "0.0.0"

    build_number = base.get_env('BUILD_NUMBER')
    if (not build_number):
        build_number = "0"

    license_connections = base.get_env('LICENSE_CONNECTIONS')
    if (not license_connections):
        license_connections = "99999"

    cur_date = datetime.date.today().strftime("%m/%d/%Y")

    server_build_dir = server_dir + "/build/server"

    base.replaceInFileRE(server_build_dir + "/Common/sources/commondefines.js",
                         "const buildNumber = [0-9]*",
                         "const buildNumber = " + build_number)
    base.replaceInFileRE(server_build_dir + "/Common/sources/license.js",
                         "const buildDate = '[0-9-/]*'",
                         "const buildDate = '" + cur_date + "'")
    base.replaceInFileRE(server_build_dir + "/Common/sources/commondefines.js",
                         "const buildVersion = '[0-9.]*'",
                         "const buildVersion = '" + product_version + "'")
    base.replaceInFileRE(
        server_build_dir + "/Common/sources/constants.js",
        "exports.LICENSE_CONNECTIONS = '[0-9]*'",
        "exports.LICENSE_CONNECTIONS = '" + license_connections + "'")

    custom_public_key = branding_dir + '/debug.js'

    if (base.is_exist(custom_public_key)):
        base.copy_file(custom_public_key, server_build_dir + '/Common/sources')

    pkg_target = "node10"

    if ("linux" == base.host_platform()):
        pkg_target += "-linux"

    if ("windows" == base.host_platform()):
        pkg_target += "-win"

    base.cmd_in_dir(server_build_dir + "/DocService", "pkg", [
        ".", "-t", pkg_target, "--options", "max_old_space_size=4096", "-o",
        "docservice"
    ])
    base.cmd_in_dir(server_build_dir + "/FileConverter", "pkg",
                    [".", "-t", pkg_target, "-o", "converter"])
    base.cmd_in_dir(server_build_dir + "/Metrics", "pkg",
                    [".", "-t", pkg_target, "-o", "metrics"])
    base.cmd_in_dir(server_build_dir + "/SpellChecker", "pkg",
                    [".", "-t", pkg_target, "-o", "spellchecker"])

    example_dir = base.get_script_dir(
    ) + "/../../document-server-integration/web/documentserver-example/nodejs"
    base.delete_dir(example_dir + "/node_modules")
    base.cmd_in_dir(example_dir, "npm", ["install"])
    sync_rpc_lib_dir = example_dir + "/node_modules/sync-rpc/lib"
    patch_file = base.get_script_dir() + "/../tools/linux/sync-rpc.patch"
    if ("linux" == base.host_platform()):
        base.cmd_in_dir(sync_rpc_lib_dir, "patch", ["-N", "-i", patch_file])
    if ("windows" == base.host_platform()):
        patch_exe_dir = base.git_dir() + "/usr/bin"
        base.cmd_in_dir(patch_exe_dir, "patch.exe",
                        ["-N", "-d", sync_rpc_lib_dir, "-i", patch_file])
    base.cmd_in_dir(example_dir, "pkg",
                    [".", "-t", pkg_target, "-o", "example"])
Beispiel #14
0
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)
Beispiel #15
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\""
    ])

    # 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
Beispiel #16
0
def get_core_url(arch, branch):
    return "http://repo-doc-onlyoffice-com.s3.amazonaws.com/" + base.host_platform(
    ) + "/core/" + branch + "/latest/" + arch + "/core.7z"
Beispiel #17
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 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
Beispiel #18
0
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
 import curl
 import websocket
 import v8
 import html2
-import hunspell
+#import hunspell
 import glew
 
 def check_android_ndk_macos_arm(dir):
@@ -32,13 +32,15 @@ def make():
       if base.is_dir(toolchain):
         check_android_ndk_macos_arm(toolchain + "/prebuilt")
 
-  boost.make()
-  cef.make()
-  icu.make()
-  openssl.make()
+  if base.host_platform() != 'freebsd' :
+    boost.make()
+    cef.make()
+    icu.make()
+    openssl.make()
+
   v8.make()
   html2.make()
-  hunspell.make(False)
+#  hunspell.make(False)
   glew.make()
   if config.check_option("module", "mobile"):
     curl.make()
Beispiel #20
0
                       "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
HEAD.close()

if not base.is_dir("hunspell"):
    get_hunspell(last_stable_commit)
Beispiel #21
0
def make():
  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")

  if not base.is_dir("depot_tools"):
    base.cmd("git", ["clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"])
  else:
    os.chdir(base_dir + "/depot_tools")
    base.cmd("git", ["reset", "--hard"])
    os.chdir(base_dir)

  os.environ["PATH"] = base_dir + "/depot_tools" + os.pathsep + os.environ["PATH"]

  if not base.is_dir("v8/out.gn"):
    base.delete_file("./.gclient")
    base.delete_file("./.gclient_entries")
    base.delete_dir("./.cipd")
    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"):
    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=false use_sysroot=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=false use_sysroot=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)

  if config.check_option("platform", "win_64_xp") or config.check_option("platform", "win_32_xp"):
    make_xp()

  return
Beispiel #22
0
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
Beispiel #23
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!!!
      base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64")

  os.environ["PATH"] = base_dir + "/depot_tools" + os.pathsep + os.environ["PATH"]

  if "ppc64" in platform.machine():
    os.environ["VPYTHON_BYPASS"] = "******"

  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"):
    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_ppc64/Release"):
        base.delete_dir("v8/third_party/binutils/Linux_ppc64/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_ppc64/Release/bin"):
        for file in os.listdir("v8/third_party/binutils/Linux_ppc64/Release/bin"):
          name = file.split("/")[-1]
          if ("ld.gold" != name):
            base.cmd("mv", ["v8/third_party/binutils/Linux_ppc64/Release/bin/" + name, "v8/third_party/binutils/Linux_ppc64/Release/bin/old_" + name])
            base.cmd("ln", ["-s", "/usr/bin/" + name, "v8/third_party/binutils/Linux_ppc64/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")  

  if "ppc64" in platform.machine():
    # Google's gn and ninja binaries won't work, they're x86 only by Google fiat.
    # Remove them and use the system binaries...
    try:
      os.remove(base_dir + "/depot_tools/gn")
    except:
      pass
    try:
      os.remove(base_dir + "/depot_tools/ninja")
    except:
      pass

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

  if "ppc64le" in platform.machine():
    base_args64 = "target_cpu=\\\"ppc64\\\" v8_target_cpu=\\\"ppc64\\\" v8_static_library=true is_component_build=false v8_use_snapshot=false"
  else:
    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=false 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=false use_sysroot=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
Beispiel #24
0
def parse():
    configfile = open(base.get_script_dir() + "/../config", "r")
    configOptions = {}
    for line in configfile:
        name, value = line.partition("=")[::2]
        k = name.strip()
        v = value.strip(" '\"\r\n")
        if ("true" == v.lower()):
            v = "1"
        if ("false" == v.lower()):
            v = "0"
        configOptions[k] = v
        os.environ["OO_" + k.upper().replace("-", "_")] = v

    # export options
    global options
    options = configOptions

    # all platforms
    global platforms
    platforms = [
        "win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32",
        "mac_64", "ios", "android_arm64_v8a", "android_armv7", "android_x86",
        "android_x86_64"
    ]

    # correction
    host_platform = base.host_platform()

    # platform
    if check_option("platform", "all"):
        if ("windows" == host_platform):
            options["platform"] += " win_64 win_32"
        elif ("linux" == host_platform):
            options["platform"] += " linux_64 linux_32"
        else:
            options["platform"] += " mac_64"

    if check_option("platform", "native"):
        bits = "32"
        if platform.machine().endswith('64'):
            bits = "64"
        if ("windows" == host_platform):
            options["platform"] += (" win_" + bits)
        elif ("linux" == host_platform):
            options["platform"] += (" linux_" + bits)
        else:
            options["platform"] += (" mac_" + bits)

    if check_option("platform", "xp") and ("windows" == host_platform):
        options["platform"] += " win_64_xp win_32_xp"

    if check_option("platform", "android"):
        options[
            "platform"] += " android_arm64_v8a android_armv7 android_x86 android_x86_64"

    # check vs-path
    if ("windows" == host_platform):
        options["vs-path"] = base.get_env(
            "ProgramFiles") + "/Microsoft Visual Studio 14.0/VC"
        if ("" != base.get_env("ProgramFiles(x86)")):
            options["vs-path"] = base.get_env(
                "ProgramFiles(x86)") + "/Microsoft Visual Studio 14.0/VC"

    # check sdkjs-plugins
    if not "sdkjs-plugin" in options:
        options["sdkjs-plugin"] = "default"
    if not "sdkjs-plugin-server" in options:
        options["sdkjs-plugin-server"] = "default"

    global sdkjs_addons
    sdkjs_addons = {}
    sdkjs_addons["comparison"] = "sdkjs-comparison"
    sdkjs_addons["content-controls"] = "sdkjs-content-controls"
    sdkjs_addons["pivot-tables"] = "sdkjs-pivot-tables"

    global sdkjs_addons_desktop
    sdkjs_addons_desktop = {}
    sdkjs_addons_desktop["disable-features"] = "sdkjs-disable-features"

    global server_addons
    server_addons = {}
    server_addons["license"] = "server-license"
    server_addons["lockstorage"] = "server-lockstorage"

    global web_apps_addons
    web_apps_addons = {}
    web_apps_addons["mobile"] = "web-apps-mobile"

    return
Beispiel #25
0
#!/usr/bin/env python
import sys
sys.path.append('../../../../build_tools/scripts')
import os
import base


def install_module():
    base.print_info('Install')
    base.cmd('npm', ['install'])


def run_integration_example():
    install_module()
    base.set_env('NODE_CONFIG_DIR', './config')
    base.print_info('run integration example')
    base.run_nodejs(['bin/www'])


base.set_env('NODE_ENV', 'development-' + base.host_platform())

run_integration_example()
def make():
    if not base.is_dir(current_dir):
        base.create_dir(current_dir)

    if base.is_dir(current_dir + "/build"):
        return

    current_dir_old = os.getcwd()

    print("[fetch & build]: icu_android")
    os.chdir(current_dir)

    if not base.is_dir("icu"):
        base.cmd("svn", [
            "export", "https://github.com/unicode-org/icu/tags/release-" +
            icu_major + "-" + icu_minor + "/icu4c", "./icu",
            "--non-interactive", "--trust-server-cert"
        ])
        if ("linux" == base.host_platform()):
            base.replaceInFile(current_dir + "/icu/source/i18n/digitlst.cpp",
                               "xlocale", "locale")
        #if ("mac" == base.host_platform()):
        #  base.replaceInFile(current_dir + "/icu/source/tools/pkgdata/pkgdata.cpp", "cmd, \"%s %s -o %s%s %s %s%s %s %s\",", "cmd, \"%s %s -o %s%s %s %s %s %s %s\",")

    if not base.is_dir(current_dir + "/icu/cross_build"):
        base.create_dir(current_dir + "/icu/cross_build")
        os.chdir(current_dir + "/icu/cross_build")
        base.cmd("../source/runConfigureICU", [
            "Linux" if "linux" == base.host_platform() else "MacOSX",
            "--prefix=" + current_dir + "/icu/cross_build",
            "CFLAGS=-Os CXXFLAGS=--std=c++11"
        ])
        base.cmd("make", ["-j4"])
        base.cmd("make", ["install"], True)

    os.chdir(current_dir)

    build_arch("arm64", "21")
    build_arch("arm", "16")
    build_arch("x86_64", "21")
    build_arch("x86", "16")

    os.chdir(current_dir)

    base.create_dir(current_dir + "/build")
    base.copy_dir(current_dir + "/build_tmp/arm64/include",
                  current_dir + "/build/include")

    if icu_is_shared:
        base.create_dir(current_dir + "/build/arm64_v8a")
        base.copy_file(
            current_dir + "/build_tmp/arm64/lib/libicudata.so." + icu_major +
            "." + icu_minor, current_dir + "/build/arm64_v8a/libicudata.so")
        base.copy_file(
            current_dir + "/build_tmp/arm64/lib/libicuuc.so." + icu_major +
            "." + icu_minor, current_dir + "/build/arm64_v8a/libicuuc.so")

        base.create_dir(current_dir + "/build/armv7")
        base.copy_file(
            current_dir + "/build_tmp/arm/lib/libicudata.so." + icu_major +
            "." + icu_minor, current_dir + "/build/armv7/libicudata.so")
        base.copy_file(
            current_dir + "/build_tmp/arm/lib/libicuuc.so." + icu_major + "." +
            icu_minor, current_dir + "/build/armv7/libicuuc.so")

        base.create_dir(current_dir + "/build/x86_64")
        base.copy_file(
            current_dir + "/build_tmp/x86_64/lib/libicudata.so." + icu_major +
            "." + icu_minor, current_dir + "/build/x86_64/libicudata.so")
        base.copy_file(
            current_dir + "/build_tmp/x86_64/lib/libicuuc.so." + icu_major +
            "." + icu_minor, current_dir + "/build/x86_64/libicuuc.so")

        base.create_dir(current_dir + "/build/x86")
        base.copy_file(
            current_dir + "/build_tmp/x86/lib/libicudata.so." + icu_major +
            "." + icu_minor, current_dir + "/build/x86/libicudata.so")
        base.copy_file(
            current_dir + "/build_tmp/x86/lib/libicuuc.so." + icu_major + "." +
            icu_minor, current_dir + "/build/x86/libicuuc.so")

        # patch elf information
        os.chdir(current_dir + "/build")
        base.cmd("git", ["clone", "https://github.com/NixOS/patchelf.git"])
        os.chdir("./patchelf")
        base.cmd("./bootstrap.sh")
        base.cmd("./configure",
                 ["--prefix=" + current_dir + "/build/patchelf/usr"])
        base.cmd("make")
        base.cmd("make", ["install"])

        base.cmd(
            "./usr/bin/patchelf",
            ["--set-soname", "libicudata.so", "./../arm64_v8a/libicudata.so"])
        base.cmd("./usr/bin/patchelf",
                 ["--set-soname", "libicuuc.so", "./../arm64_v8a/libicuuc.so"])
        base.cmd("./usr/bin/patchelf", [
            "--replace-needed", "libicudata.so." + icu_major, "libicudata.so",
            "./../arm64_v8a/libicuuc.so"
        ])

        base.cmd("./usr/bin/patchelf",
                 ["--set-soname", "libicudata.so", "./../armv7/libicudata.so"])
        base.cmd("./usr/bin/patchelf",
                 ["--set-soname", "libicuuc.so", "./../armv7/libicuuc.so"])
        base.cmd("./usr/bin/patchelf", [
            "--replace-needed", "libicudata.so." + icu_major, "libicudata.so",
            "./../armv7/libicuuc.so"
        ])

        base.cmd(
            "./usr/bin/patchelf",
            ["--set-soname", "libicudata.so", "./../x86_64/libicudata.so"])
        base.cmd("./usr/bin/patchelf",
                 ["--set-soname", "libicuuc.so", "./../x86_64/libicuuc.so"])
        base.cmd("./usr/bin/patchelf", [
            "--replace-needed", "libicudata.so." + icu_major, "libicudata.so",
            "./../x86_64/libicuuc.so"
        ])

        base.cmd("./usr/bin/patchelf",
                 ["--set-soname", "libicudata.so", "./../x86/libicudata.so"])
        base.cmd("./usr/bin/patchelf",
                 ["--set-soname", "libicuuc.so", "./../x86/libicuuc.so"])
        base.cmd("./usr/bin/patchelf", [
            "--replace-needed", "libicudata.so." + icu_major, "libicudata.so",
            "./../x86/libicuuc.so"
        ])

        base.delete_dir(current_dir + "/build/patchelf")

    if not icu_is_shared:
        base.create_dir(current_dir + "/build/arm64_v8a")
        base.copy_file(current_dir + "/build_tmp/arm64/lib/libicudata.a",
                       current_dir + "/build/arm64_v8a/libicudata.a")
        base.copy_file(current_dir + "/build_tmp/arm64/lib/libicuuc.a",
                       current_dir + "/build/arm64_v8a/libicuuc.a")
        base.copy_file(current_dir + "/icu/arm64/data/out/icudt58l.dat",
                       current_dir + "/build/arm64_v8a/icudt58l.dat")

        base.create_dir(current_dir + "/build/armv7")
        base.copy_file(current_dir + "/build_tmp/arm/lib/libicudata.a",
                       current_dir + "/build/armv7/libicudata.a")
        base.copy_file(current_dir + "/build_tmp/arm/lib/libicuuc.a",
                       current_dir + "/build/armv7/libicuuc.a")
        base.copy_file(current_dir + "/icu/arm/data/out/icudt58l.dat",
                       current_dir + "/build/armv7/icudt58l.dat")

        base.create_dir(current_dir + "/build/x86_64")
        base.copy_file(current_dir + "/build_tmp/x86_64/lib/libicudata.a",
                       current_dir + "/build/x86_64/libicudata.a")
        base.copy_file(current_dir + "/build_tmp/x86_64/lib/libicuuc.a",
                       current_dir + "/build/x86_64/libicuuc.a")
        base.copy_file(current_dir + "/icu/x86_64/data/out/icudt58l.dat",
                       current_dir + "/build/x86_64/icudt58l.dat")

        base.create_dir(current_dir + "/build/x86")
        base.copy_file(current_dir + "/build_tmp/x86/lib/libicudata.a",
                       current_dir + "/build/x86/libicudata.a")
        base.copy_file(current_dir + "/build_tmp/x86/lib/libicuuc.a",
                       current_dir + "/build/x86/libicuuc.a")
        base.copy_file(current_dir + "/icu/x86/data/out/icudt58l.dat",
                       current_dir + "/build/x86/icudt58l.dat")

    os.chdir(current_dir_old)
    return
Beispiel #27
0
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
Beispiel #28
0
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
Beispiel #29
0
def make_pro_file(makefiles_dir, pro_file):
    platforms = config.option("platform").split()
    for platform in platforms:
        if not platform in config.platforms:
            continue

        print("------------------------------------------")
        print("BUILD_PLATFORM: " + platform)
        print("------------------------------------------")
        old_env = os.environ.copy()

        # if you need change output libraries path - set the env variable
        # base.set_env("DESTDIR_BUILD_OVERRIDE", os.getcwd() + "/out/android/" + config.branding() + "/mobile")

        isAndroid = False if (-1 == platform.find("android")) else True
        if isAndroid:
            toolchain_platform = "linux-x86_64"
            if ("mac" == base.host_platform()):
                toolchain_platform = "darwin-x86_64"
            base.set_env("ANDROID_NDK_HOST", toolchain_platform)
            old_path = base.get_env("PATH")
            new_path = base.qt_setup(platform) + "/bin:"
            new_path += (base.get_env("ANDROID_NDK_ROOT") +
                         "/toolchains/llvm/prebuilt/" + toolchain_platform +
                         "/bin:")
            new_path += old_path
            base.set_env("PATH", new_path)
            if ("android_arm64_v8a" == platform):
                base.set_env("ANDROID_NDK_PLATFORM", "android-21")
            else:
                base.set_env("ANDROID_NDK_PLATFORM", "android-16")

        if (-1 != platform.find("ios")):
            base.hack_xcode_ios()

        # makefile suffix
        file_suff = platform
        if (config.check_option("config", "debug")):
            file_suff += "_debug_"
        file_suff += config.option("branding")

        # setup qt
        qt_dir = base.qt_setup(platform)
        base.set_env("OS_DEPLOY", platform)

        # qmake CONFIG+=...
        config_param = base.qt_config(platform)

        # qmake ADDON
        qmake_addon = []
        if ("" != config.option("qmake_addon")):
            qmake_addon.append(config.option("qmake_addon"))

        if not base.is_file(qt_dir + "/bin/qmake") and not base.is_file(
                qt_dir + "/bin/qmake.exe"):
            print("THIS PLATFORM IS NOT SUPPORTED")
            continue

        # non windows platform
        if not base.is_windows():
            if ("1" == config.option("clean")):
                base.cmd(base.app_make(), [
                    "clean", "-f",
                    makefiles_dir + "/build.makefile_" + file_suff
                ], True)
                base.cmd(base.app_make(), [
                    "distclean", "-f",
                    makefiles_dir + "/build.makefile_" + file_suff
                ], True)

            if base.is_file(makefiles_dir + "/build.makefile_" + file_suff):
                base.delete_file(makefiles_dir + "/build.makefile_" +
                                 file_suff)
            base.cmd(qt_dir + "/bin/qmake",
                     ["-nocache", pro_file, "CONFIG+=" + config_param] +
                     qmake_addon)
            base.cmd(base.app_make(),
                     ["-f", makefiles_dir + "/build.makefile_" + file_suff])
        else:
            qmake_bat = []
            qmake_bat.append(
                "call \"" + config.option("vs-path") + "/vcvarsall.bat\" " +
                ("x86" if base.platform_is_32(platform) else "x64"))
            if ("1" == config.option("clean")):
                qmake_bat.append("call nmake clean -f " + makefiles_dir +
                                 "/build.makefile_" + file_suff)
                qmake_bat.append("call nmake distclean -f " + makefiles_dir +
                                 "/build.makefile_" + file_suff)
            qmake_addon_string = ""
            if ("" != config.option("qmake_addon")):
                qmake_addon_string = " \"" + config.option(
                    "qmake_addon") + "\""
            qmake_bat.append("if exist ./" + makefiles_dir +
                             "/build.makefile_" + file_suff + " del /F ./" +
                             makefiles_dir + "/build.makefile_" + file_suff)
            qmake_bat.append("call \"" + qt_dir + "/bin/qmake\" -nocache " +
                             pro_file + " \"CONFIG+=" + config_param + "\"" +
                             qmake_addon_string)
            qmake_bat.append("call nmake -f " + makefiles_dir +
                             "/build.makefile_" + file_suff)
            base.run_as_bat(qmake_bat)

        os.environ = old_env.copy()

        base.delete_file(".qmake.stash")
Beispiel #30
0

def protect_brunch(branch, repo, strict=False):
    team = '' if strict else 'dep-application-development-leads'
    command = 'echo {"required_status_checks": null,"enforce_admins":true,"required_pull_request_reviews": null,"restrictions": {"users":[],"teams":["'
    command += team + '"]}} | gh api -X PUT repos/ONLYOFFICE/' + repo + '/branches/' + branch + '/protection --input -'
    result = base.run_command(command)
    if ('' != result['stderr']):
        print(result['stderr'])
    return


branch_from = 'release/v6.2.0'
branches_to = ['develop']

platform = base.host_platform()
if ("windows" == platform):
    dependence.check_pythonPath()
    dependence.check_gitPath()

if (dependence.check_gh() != True or dependence.check_gh_auth() != True):
    sys.exit(0)

base.cmd_in_dir('../../', 'python', [
    'configure.py', '--branding', 'onlyoffice', '--branding-url',
    'https://github.com/ONLYOFFICE/onlyoffice.git', '--branch', branch_from,
    '--module', 'core desktop builder server mobile', '--update', '1',
    '--update-light', '1', '--clean', '0'
])

# parse configuration