def install_qt(): # qt if not base.is_file("./qt_source_5.9.9.tar.xz"): base.download( "https://download.qt.io/archive/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz", "./qt_source_5.9.9.tar.xz") if not base.is_dir("./qt-everywhere-opensource-src-5.9.9"): base.cmd("tar", ["-xf", "./qt_source_5.9.9.tar.xz"]) qt_params = [ "-opensource", "-confirm-license", "-release", "-shared", "-accessibility", "-prefix", "./../qt_build/Qt-5.9.9/gcc_64", "-qt-zlib", "-qt-libpng", "-qt-libjpeg", "-qt-xcb", "-qt-pcre", "-no-sql-sqlite", "-no-qml-debug", "-gstreamer", "1.0", "-nomake", "examples", "-nomake", "tests", "-skip", "qtenginio", "-skip", "qtlocation", "-skip", "qtserialport", "-skip", "qtsensors", "-skip", "qtxmlpatterns", "-skip", "qt3d", "-skip", "qtwebview", "-skip", "qtwebengine" ] base.cmd_in_dir("./qt-everywhere-opensource-src-5.9.9", "./configure", qt_params) base.cmd_in_dir("./qt-everywhere-opensource-src-5.9.9", "make", ["-j", "4"]) base.cmd_in_dir("./qt-everywhere-opensource-src-5.9.9", "make", ["install"]) return
def exclude_arch(directory, frameworks): for lib in frameworks: base.cmd("lipo", [ "-remove", "arm64", directory + "/" + lib + ".framework/" + lib, "-o", directory + "/" + lib + ".framework/" + lib ]) return
def build_js_develop(root_dir): #_run_npm_cli(root_dir + "/sdkjs/build") external_folder = config.option("--external-folder") if (external_folder != ""): external_folder = "/" + external_folder _run_npm(root_dir + external_folder + "/sdkjs/build") _run_grunt(root_dir + external_folder + "/sdkjs/build", get_build_param(False) + base.sdkjs_addons_param()) _run_grunt(root_dir + external_folder + "/sdkjs/build", ["develop"] + base.sdkjs_addons_param()) _run_npm(root_dir + external_folder + "/web-apps/build") _run_npm(root_dir + external_folder + "/web-apps/build/sprites") _run_grunt(root_dir + external_folder + "/web-apps/build/sprites", []) old_cur = os.getcwd() old_product_version = base.get_env("PRODUCT_VERSION") base.set_env("PRODUCT_VERSION", old_product_version + "d") os.chdir(root_dir + external_folder + "/web-apps/vendor/framework7-react") base.cmd("npm", ["install"]) base.cmd("npm", ["run", "deploy-word"]) base.cmd("npm", ["run", "deploy-cell"]) base.cmd("npm", ["run", "deploy-slide"]) base.set_env("PRODUCT_VERSION", old_product_version) os.chdir(old_cur) return
def build_arch(arch, api_version): print("icu build: " + arch + " ----------------------------------------") if base.is_dir(current_dir + "/icu/" + arch): base.delete_dir(current_dir + "/icu/" + arch) base.create_dir(current_dir + "/icu/" + arch) os.chdir(current_dir + "/icu/" + arch) base.cmd( base.get_env("ANDROID_NDK_ROOT") + "/build/tools/make-standalone-toolchain.sh", [ "--platform=android-" + api_version, "--install-dir=" + current_dir + "/toolchain/" + arch, "--toolchain=" + platforms[arch]["arch"], "--force" ]) base.set_env("PATH", current_dir + "/toolchain/" + arch + "/bin:" + current_path) command_args = "--prefix=" + current_dir + "/build_tmp/" + arch + " --host=!!!MASK!!! --with-cross-build=" + current_dir + "/icu/cross_build CFLAGS=-Os CXXFLAGS=--std=c++11 CC=!!!MASK!!!-clang CXX=!!!MASK!!!-clang++ AR=!!!MASK!!!-ar RANLIB=!!!MASK!!!-ranlib" if not icu_is_shared: command_args += " --enable-static --enable-shared=no --with-data-packaging=archive CFLAGS=-fPIC CXXFLAGS=-fPIC" command_args = command_args.replace("!!!MASK!!!", platforms[arch]["bin"]) base.cmd("../source/configure", command_args.split()) base.cmd("make", ["-j4"]) base.cmd("make", ["install"]) base.set_env("PATH", current_path) os.chdir(current_dir) return
def buildIOS(): # Build for iphone base.cmd("xcodebuild", [ "-sdk", "iphoneos", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release" ]) # Build for simulator base.cmd("xcodebuild", [ "-sdk", "iphonesimulator", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release" ]) # Remove arm64 for simulator for SDK 14 base.cmd("lipo", [ "-remove", "arm64", "-output", "build/Release-iphonesimulator/libSocketRocket.a", "build/Release-iphonesimulator/libSocketRocket.a" ]) base.create_dir(current_dir + "/build/ios/lib") # Create fat lib base.cmd("lipo", [ "./build/Release-iphonesimulator/libSocketRocket.a", "./build/Release-iphoneos/libSocketRocket.a", "-create", "-output", "./build/ios/lib/libSoсketRocket.a" ]) return
def check_dependencies(): if (host_platform == 'windows' and not check_vc_components()): return False if (host_platform == 'mac'): return True checksResult = CDependencies() checksResult.append(check_git()) checksResult.append(check_nodejs()) if (host_platform == 'linux'): checksResult.append(check_npm()) checksResult.append(check_curl()) checksResult.append(check_7z()) checksResult.append(check_java()) checksResult.append(check_erlang()) checksResult.append(check_rabbitmq()) checksResult.append(check_gruntcli()) if (host_platform == 'windows'): checksResult.append(check_buildTools()) if (config.option("sql-type") == 'mysql'): checksResult.append(check_mysqlServer()) else: checksResult.append(check_postgreSQL()) server_addons = [] if (config.option("server-addons") != ""): server_addons = config.option("server-addons").rsplit(", ") if ("server-lockstorage" in server_addons): checksResult.append(check_redis()) if (len(checksResult.install) > 0): install_args = ['install.py'] install_args += checksResult.get_uninstall() install_args += checksResult.get_removepath() install_args += checksResult.get_install() install_args[0] = './scripts/develop/' + install_args[0] if (host_platform == 'windows'): code = libwindows.sudo(unicode(sys.executable), install_args) elif (host_platform == 'linux'): base.cmd('python', install_args, False) get_updates() check_npmPath() if (config.option("sql-type") == 'mysql'): return check_MySQLConfig(checksResult.sqlPath) return check_postgreConfig(checksResult.sqlPath)
def get_hunspell(last_stable_commit): 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\nstring_buffer_stream memin;\n#endif" ) #custon filemgr support watch filemgr_wrapper_new.cxx base.replaceInFile( "./src/hunspell/filemgr.hxx", "#include <fstream>", "#include <fstream>\n#ifdef HUNSPELL_WASM_MODULE\n#include \"string_buffer_stream.h\"\n#endif\n" ) base.replaceInFile("./src/hunspell/csutil.cxx", "void free_utf_tbl() {", "void free_utf_tbl() { \n return;\n") # bug fix, we need to keep this utf table # free_utf_tbl doesnt delete anything so we can destroy huspell object os.chdir("../")
def make(src_dir, modules): old_cur = os.getcwd() print("boost-headers...") base.cmd("./bootstrap.sh", ["--with-libraries=system"]) base.cmd("./b2", ["--prefix=./../build/android", "headers", "install"]) for module in modules: print("boost-module: " + module + " ...") module_dir = src_dir + "/libs/" + module os.chdir(module_dir) pro_file_content = [] pro_file_content.append("QT -= core gui") pro_file_content.append("TARGET = boost_" + module) pro_file_content.append("TEMPLATE = lib") pro_file_content.append("CONFIG += staticlib") pro_file_content.append("") pro_file_content.append("CORE_ROOT_DIR = $$PWD/../../../../../..") pro_file_content.append("PWD_ROOT_DIR = $$PWD") pro_file_content.append("include($$PWD/../../../../../base.pri)") pro_file_content.append("") pro_file_content.append("MAKEFILE=$$PWD/makefiles/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX") pro_file_content.append("core_debug:MAKEFILE=$$join(MAKEFILE, MAKEFILE, \"\", \"_debug_\")") pro_file_content.append("build_xp:MAKEFILE=$$join(MAKEFILE, MAKEFILE, \"\", \"_xp\")") pro_file_content.append("OO_BRANDING_SUFFIX = $$(OO_BRANDING)") pro_file_content.append("!isEmpty(OO_BRANDING_SUFFIX):MAKEFILE=$$join(MAKEFILE, MAKEFILE, \"\", \"$$OO_BRANDING_SUFFIX\")") pro_file_content.append("") pro_file_content.append("BOOST_SOURCES=$$PWD/../..") pro_file_content.append("INCLUDEPATH += $$BOOST_SOURCES") pro_file_content.append("INCLUDEPATH += $$PWD/include") pro_file_content.append("") pro_file_content.append("SOURCES += $$files($$PWD/src/*.cpp, true)") pro_file_content.append("") pro_file_content.append("DESTDIR = $$BOOST_SOURCES/../build/android/lib/$$CORE_BUILDS_PLATFORM_PREFIX") base.save_as_script(module_dir + "/" + module + ".pro", pro_file_content) build.make_pro_file(module_dir + "/makefiles", module_dir + "/" + module + ".pro") os.chdir(old_cur) return
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
def buildMacOS(): # Build for iphone base.cmd("xcodebuild", [ "-sdk", "macosx", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release" ]) base.create_dir(current_dir + "/build/mac_64/lib") base.create_dir(current_dir + "/build/mac_arm64/lib") base.cmd("lipo", [ "build/Release/libSocketRocket.a", "-thin", "x86_64", "-output", "build/mac_64/lib/libSoсketRocket.a" ]) base.cmd("lipo", [ "build/Release/libSocketRocket.a", "-thin", "arm64", "-output", "build/mac_arm64/lib/libSoсketRocket.a" ]) base.delete_file("build/Release/libSocketRocket.a") return
def run(*args, **kwargs): cmd(bin, *args, **kwargs)
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
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
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
# 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) # version check
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
def build_arch(platform, arch, params, is_debug=False): print("ixwebsocket build: " + platform + "....." + arch + " ----------------------------------------") if base.is_dir(current_dir + "/IXWebSocket/build/" + platform + "/" + arch): base.delete_dir(current_dir + "/IXWebSocket/build/" + platform + "/" + arch) base.create_dir(current_dir + "/IXWebSocket/build/" + platform + "/" + arch) cache_dir = current_dir + "/IXWebSocket/build/" + platform + "/cache" base.create_dir(cache_dir) os.chdir(cache_dir) libext = "a" prefix = "/" zlib = "1" if (0 == platform.find("windows")): zlib = "0" libext = "lib" prefix = cache_dir + "/../" + arch path = platform if (platform == "ios" or platform == "android"): path += "/" else: path = "" base.cmd(CMAKE, [ "../../..", "-DUSE_WS=0", "-DUSE_ZLIB=" + zlib, "-DUSE_TLS=1", "-DUSE_OPEN_SSL=1", "-DOPENSSL_ROOT_DIR=" + cache_dir + "/../../../../../openssl/build/" + path + arch, "-DOPENSSL_INCLUDE_DIR=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/include", "-DOPENSSL_CRYPTO_LIBRARY=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/lib/libcrypto." + libext, "-DOPENSSL_SSL_LIBRARY=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/lib/libssl." + libext, "-DCMAKE_INSTALL_PREFIX:PATH=" + prefix ] + params) if (-1 != platform.find("ios") or -1 != platform.find("mac")): base.cmd(CMAKE, ["--build", ".", "--config", "Release"]) base.cmd(CMAKE, [ "--install", ".", "--config", "Release", "--prefix", cache_dir + "/../" + arch ]) elif (-1 != platform.find("android") or -1 != platform.find("linux")): base.cmd("make", ["-j4"]) base.cmd("make", ["DESTDIR=" + cache_dir + "/../" + arch, "install"]) elif (-1 != platform.find("windows")): conf = "Debug" if is_debug else "Release" base.cmd(CMAKE, ["--build", ".", "--target", "install", "--config", conf]) base.delete_dir(cache_dir) os.chdir(current_dir) return
def make(): 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
def make(): print("[fetch & build]: icu") base_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu" old_cur = os.getcwd() os.chdir(base_dir) icu_major = "58" icu_minor = "2" if not base.is_dir("icu"): base.cmd("svn", ["export", "https://github.com/unicode-org/icu/tags/release-" + icu_major + "-" + icu_minor + "/icu4c", "./icu"]) if ("windows" == base.host_platform()): need_platforms = [] if (-1 != config.option("platform").find("win_64")): need_platforms.append("win_64") if (-1 != config.option("platform").find("win_32")): need_platforms.append("win_32") for platform in need_platforms: if not config.check_option("platform", platform) and not config.check_option("platform", platform + "_xp"): continue if not base.is_dir(platform + "/build"): base.create_dir(platform) base.vcvarsall_start("x64" if ("win_64" == platform) else "x86") base.cmd("MSBuild.exe", ["icu/source/allinone/allinone.sln", "/p:Configuration=Release", "/p:PlatformToolset=v140", "/p:Platform=" + ("X64" if ("win_64" == platform) else "Win32")]) base.vcvarsall_end() bin_dir = "icu/bin64/" if ("win_64" == platform) else "icu/bin/" lib_dir = "icu/lib64/" if ("win_64" == platform) else "icu/lib/" base.create_dir(platform + "/build") base.copy_file(bin_dir + "icudt" + icu_major + ".dll", platform + "/build/") base.copy_file(bin_dir + "icuuc" + icu_major + ".dll", platform + "/build/") base.copy_file(lib_dir + "icudt.lib", platform + "/build/") base.copy_file(lib_dir + "icuuc.lib", platform + "/build/") platform = "" if ("linux" == base.host_platform()): platform = "linux_64" if not base.is_dir(platform + "/build"): base.replaceInFile("./icu/source/i18n/digitlst.cpp", "xlocale", "locale") if ("mac" == base.host_platform()): platform = "mac_64" if not base.is_dir(platform + "/build"): base.replaceInFile("./icu/source/tools/pkgdata/pkgdata.cpp", "cmd, \"%s %s -o %s%s %s %s%s %s %s\",", "cmd, \"%s %s -o %s%s %s %s %s %s %s\",") if (-1 != config.option("platform").find("ios")): if not base.is_dir("build"): base.bash("./icu_ios") elif ("" != platform) and not base.is_dir(platform + "/build"): base.create_dir(platform) os.chdir("icu/source") base.cmd("./runConfigureICU", ["Linux" if "linux" == base.host_platform() else "MacOSX"]) old_dest_dir = base.get_env("DESTDIR") base.set_env("DESTDIR", base_dir + "/" + platform) base.cmd("make", ["install"]) base.set_env("DESTDIR", old_dest_dir) os.chdir("../..") base.create_dir(platform + "/build") if ("linux_64" == platform): base.copy_file("icu/source/lib/libicudata.so." + icu_major + "." + icu_minor, platform + "/build/libicudata.so." + icu_major) base.copy_file("icu/source/lib/libicuuc.so." + icu_major + "." + icu_minor, platform + "/build/libicuuc.so." + icu_major) elif ("mac_64" == platform): base.copy_file("icu/source/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", platform + "/build/libicudata." + icu_major + ".dylib") base.copy_file("icu/source/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", platform + "/build/libicuuc." + icu_major + ".dylib") os.chdir(old_cur) return
def make(): print("[fetch & build]: cef") base_dir = base.get_script_dir() + "/../../core/Common/3dParty/cef" old_cur = os.getcwd() os.chdir(base_dir) platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32", "mac_64"] url = "http://d2ettrnqo7v976.cloudfront.net/cef/3770/" for platform in platforms: if not config.check_option("platform", platform): continue url += (platform + "/cef_binary.7z") if not base.is_dir(platform): base.create_dir(platform) os.chdir(platform) data_url = base.get_file_last_modified_url(url) old_data_url = base.readFile("./cef_binary.7z.data") if (data_url != old_data_url): if base.is_file("./cef_binary.7z"): base.delete_file("./cef_binary.7z") if base.is_dir("build"): base.delete_dir("build") if base.is_dir("build"): continue # download if not base.is_file("./cef_binary.7z"): base.download(url, "./cef_binary.7z") # extract base.extract("./cef_binary.7z", "./") base.delete_file("./cef_binary.7z.data") base.writeFile("./cef_binary.7z.data", data_url) base.create_dir("./build") # deploy if ("mac_64" != platform): base.copy_files("cef_binary/Release/*", "build/") base.copy_files("cef_binary/Resources/*", "build/") if (0 == platform.find("linux")): base.cmd("chmod", ["a+xr", "build/locales"]) if ("mac_64" == platform): base.cmd("mv", ["Chromium Embedded Framework.framework", "build/Chromium Embedded Framework.framework"]) os.chdir(base_dir) os.chdir(old_cur) return
def make(): 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
import sys sys.path.append('../..') import config import base import os import subprocess base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8_87" if not base.is_dir(base_dir): base.create_dir(base_dir) os.chdir(base_dir) if not base.is_dir("depot_tools"): base.cmd("git", [ "clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git" ]) os.environ[ "PATH"] = base_dir + "/depot_tools" + os.pathsep + os.environ["PATH"] if not base.is_dir("v8"): base.cmd("./depot_tools/fetch", ["v8"], True) base.cmd("./depot_tools/gclient", ["sync", "-r", "8.7.220.25"], True) base.cmd("gclient", ["sync", "--force"], True) os.chdir("v8") gn_args = [ "target_cpu=\\\"x64\\\"", "v8_target_cpu=\\\"x64\\\"", "v8_static_library=true", "is_component_build=false", "v8_monolithic=true",
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
icu_major = "58" icu_minor = "2" current_dir_old = os.getcwd() current_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu" os.chdir(current_dir) if not base.is_dir(current_dir + "/mac_cross_64"): base.create_dir(current_dir + "/mac_cross_64") os.chdir(current_dir + "/mac_cross_64") base.cmd("../icu/source/runConfigureICU", [ "MacOSX", "--prefix=" + current_dir + "/mac_cross_64", "CFLAGS=-Os CXXFLAGS=--std=c++11" ]) change_icu_defs(current_dir + "/mac_cross_64", "x86_64") base.cmd("make", ["-j4"]) base.cmd("make", ["install"], True) restore_icu_defs(current_dir + "/mac_cross_64") os.chdir(current_dir) os.chdir(current_dir + "/icu/source") base.cmd("./configure", [ "--prefix=" + current_dir + "/mac_arm_64",
def install_module(): base.print_info('Install') base.cmd('npm', ['install'])
config.parse() base_dir = base.get_script_dir(__file__) base.set_env("BUILD_PLATFORM", config.option("platform")) # branding if ("1" != base.get_env("OO_RUNNING_BRANDING")) and ( "" != config.option("branding")): branding_dir = base_dir + "/../" + config.option("branding") if ("1" == config.option("update")): is_exist = True if not base.is_dir(branding_dir): is_exist = False base.cmd( "git", ["clone", config.option("branding-url"), branding_dir]) base.cmd_in_dir(branding_dir, "git", ["fetch"], True) if not is_exist or ("1" != config.option("update-light")): base.cmd_in_dir( branding_dir, "git", ["checkout", "-f", config.option("branch")]) base.cmd_in_dir(branding_dir, "git", ["pull"], True) if base.is_file(branding_dir + "/build_tools/make.py"): base.check_build_version(branding_dir + "/build_tools") base.set_env("OO_RUNNING_BRANDING", "1") base.set_env("OO_BRANDING", config.option("branding"))
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
def install_deps(): # dependencies packages = [ "apt-transport-https", "autoconf2.13", "build-essential", "ca-certificates", "cmake", "curl", "git", "glib-2.0-dev", "libglu1-mesa-dev", "libgtk-3-dev", "libpulse-dev", "libtool", "p7zip-full", "subversion", "gzip", "libasound2-dev", "libatspi2.0-dev", "libcups2-dev", "libdbus-1-dev", "libicu-dev", "libglu1-mesa-dev", "libgstreamer1.0-dev", "libgstreamer-plugins-base1.0-dev", "libx11-xcb-dev", "libxcb*", "libxi-dev", "libxrender-dev", "libxss1" ] base.cmd("sudo", ["apt-get", "install", "-y"] + packages) # nodejs if not base.is_file("./node_js_setup_10.x"): if "ppc64le" not in platform.machine(): base.download("https://deb.nodesource.com/setup_10.x", "./node_js_setup_10.x") base.cmd("sudo", ["bash", "./node_js_setup_10.x"]) base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"]) base.cmd("sudo", ["npm", "install", "-g", "npm"]) base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"]) base.cmd("sudo", ["npm", "install", "-g", "pkg"]) # java base.cmd("sudo", ["apt-get", "-y", "install", "software-properties-common"]) base.cmd("sudo", ["add-apt-repository", "-y", "ppa:openjdk-r/ppa"]) base.cmd("sudo", ["apt-get", "update"]) base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"]) base.cmd("sudo", ["update-alternatives", "--config", "java"]) base.cmd("sudo", ["update-alternatives", "--config", "javac"]) return
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")
def install_deps(): if base.is_file("./packages_complete"): return # dependencies packages = [ "apt-transport-https", "autoconf2.13", "build-essential", "ca-certificates", "cmake", "curl", "git", "glib-2.0-dev", "libglu1-mesa-dev", "libgtk-3-dev", "libpulse-dev", "libtool", "p7zip-full", "subversion", "gzip", "libasound2-dev", "libatspi2.0-dev", "libcups2-dev", "libdbus-1-dev", "libicu-dev", "libglu1-mesa-dev", "libgstreamer1.0-dev", "libgstreamer-plugins-base1.0-dev", "libx11-xcb-dev", "libxcb*", "libxi-dev", "libxrender-dev", "libxss1", "libncurses5" ] base.cmd("sudo", ["apt-get", "install", "-y"] + packages) # nodejs base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"]) nodejs_cur = 0 try: nodejs_version = base.run_command('node -v')['stdout'] nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:]) nodejs_cur_version_minor = int(nodejs_version.split('.')[1]) nodejs_cur = nodejs_cur_version_major * 1000 + nodejs_cur_version_minor print("Installed Node.js version: " + str(nodejs_cur_version_major) + "." + str(nodejs_cur_version_minor)) except: nodejs_cur = 1 if (nodejs_cur < 10020): print("Node.js version cannot be less 10.20") print("Reinstall") if (base.is_dir("./node_js_setup_10.x")): base.delete_dir("./node_js_setup_10.x") base.cmd("sudo", ["apt-get", "remove", "--purge", "-y", "nodejs"]) base.download("https://deb.nodesource.com/setup_10.x", "./node_js_setup_10.x") base.cmd( 'curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -' ) base.cmd("sudo", ["bash", "./node_js_setup_10.x"]) base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"]) base.cmd("sudo", ["npm", "install", "-g", "npm@6"]) else: print("OK") base.cmd("sudo", ["apt-get", "-y", "install", "npm", "yarn"], True) base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"]) base.cmd("sudo", ["npm", "install", "-g", "pkg"]) # java java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-11-jdk"], True) if (0 != java_error): java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"], True) if (0 != java_error): base.cmd("sudo", ["apt-get", "-y", "install", "software-properties-common"]) base.cmd("sudo", ["add-apt-repository", "-y", "ppa:openjdk-r/ppa"]) base.cmd("sudo", ["apt-get", "update"]) base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"]) base.cmd("sudo", ["update-alternatives", "--config", "java"]) base.cmd("sudo", ["update-alternatives", "--config", "javac"]) base.writeFile("./packages_complete", "complete") return