Ejemplo n.º 1
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")
Ejemplo n.º 2
0
def make():
    print("[fetch & build]: icu")

    if (-1 != config.option("platform").find("android")):
        icu_android.make()

    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",
            "--non-interactive", "--trust-server-cert"
        ])

    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)
                compile_bat = []
                compile_bat.append("setlocal")
                compile_bat.append(
                    "call \"" + config.option("vs-path") +
                    "/vcvarsall.bat\" " +
                    ("x86" if base.platform_is_32(platform) else "x64"))
                compile_bat.append(
                    "call MSBuild.exe icu/source/allinone/allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="
                    + ("Win32" if base.platform_is_32(platform) else "X64"))
                compile_bat.append("endlocal")
                base.run_as_bat(compile_bat)
                #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/")
        os.chdir(old_cur)
        return

    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"])
        if ("" == old_dest_dir):
            os.environ.pop("DESTDIR")
        else:
            base.set_env("DEST_DIR", 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
Ejemplo n.º 3
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("------------------------------------------")

        # 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", "all", "-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:
            old_env = os.environ.copy()
            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 all -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
Ejemplo n.º 4
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