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 return compiler
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 androidRuntime(self): try: SDK_ROOT = os.environ['ANDROID_SDK_ROOT'] except Exception: print ("ANDROID_SDK_ROOT not defined.\ Please define ANDROID_SDK_ROOT in your environment") return False try: NDK_ROOT = os.environ['NDK_ROOT'] except Exception: print ("NDK_ROOT not defined.\ Please define NDK_ROOT in your environment") return False platformsPath = os.path.join(SDK_ROOT,"platforms") if not os.path.isdir(platformsPath): print ("Can't find android platforms") return False projectProperties = os.path.join(self.projectPath, "project.properties") androidVersion = None if os.path.isfile(projectProperties): f = file(projectProperties, 'r') while True: line = f.readline() if "target=" in line and not "#" in line: androidVersion = line[line.find('-')+1:] break if len(line) == 0: break if androidVersion is None: platforms = os.listdir(platformsPath) versions = [] for platform in platforms: if "android-" in platform: version = platform[platform.find('-')+1:] versions.append(version) versions = [x for x in map(float, versions) if x > 10.0] if len(versions) == 0: print ("Please update your android sdk") return False androidVersion = min(versions) if androidVersion is None or int(androidVersion) < 10: print ("Please update your android sdk or reset android sdk version in the project.properties file") return False buildNative = os.path.join(self.projectPath, "build_native.py") if not os.path.isdir(self.projectPath) or not os.path.isfile(buildNative): print ("Can't find the build_native.py") return False sys.path.append(self.projectPath) from build_native import build build(None, str(int(androidVersion)), None, self.pure)
def qt_setup(platform): compiler = config.check_compiler(platform) qt_dir = config.option("qt-dir") if ( -1 == platform.find("_xp")) else config.option("qt-dir-xp") qt_dir = (qt_dir + "/" + compiler["compiler"]) if platform_is_32(platform) else ( qt_dir + "/" + compiler["compiler_64"]) set_env("QT_DEPLOY", qt_dir + "/bin") return qt_dir
def qt_config(platform): config_param = config.option("module") + " " + config.option("config") config_param_lower = config_param.lower() if (-1 != platform.find("xp")): config_param += " build_xp" if ("ios" == platform): set_env("BITCODE_GENERATION_MODE", "bitcode") set_env("ENABLE_BITCODE", "YES") config_param = config_param.replace("desktop", "") config_param += " iphoneos device" if (-1 == config_param_lower.find("debug")): config_param += " release" return config_param
def auto_os_app_proxy_config(host, port): """根据不同的操作系统自动配置应用代理 :param host: :param port: :return: """ if platform.find("win32") > -1: _config_windows_app_proxy(host, port) return if platform.find("darwin") > -1: _config_osx_app_proxy(host, port) return if platform.find("linux") > -1: _config_linux_app_proxy(host, port) return if platform.find("freebsd") > -1: _config_freebsd_app_proxy(host, port) return
def PlatformRequires(pkg): platform = pkg.find('platform') if platform is None: return True exclude = platform.find('exclude') if matchDistributions(exclude): print( "INFO: skip %s by excludes for %s" % \ (pkg.find('name').text), PlatformInfo()) return False include = platform.find('include') if include and len(include) > 0: # if include set than apply only if it is included # explicetely if not matchDistributions(include): print( "INFO: skip %s as not explicetly included for %s" % \ (pkg.find('name').text, PlatformInfo())) return False return True
def PlatformRequires(pkg): platform = pkg.find('platform') if platform is None: return True info = PlatformInfo() exclude = platform.find('exclude') for distro in exclude.iterchildren('distribution'): name = distro.find('name') version = distro.find('version') if PlatformMatch(info, (name, version)): return False return True
def PlatformRequires(pkg): platform = pkg.find('platform') if platform is None: return True info = PlatformInfo() exclude = platform.find('exclude') for distro in exclude.findall('distribution'): name = distro.find('name').text version = distro.find('version').text if PlatformMatch(info, (name, version)): return False return True
def qt_config(platform): config_param = config.option("module") + " " + config.option( "config") + " " + config.option("features") config_param_lower = config_param.lower() if (-1 != platform.find("xp")): config_param += " build_xp" if ("ios" == platform): set_env("BITCODE_GENERATION_MODE", "bitcode") set_env("ENABLE_BITCODE", "YES") config_param = config_param.replace("desktop", "") config_param += " iphoneos device" if (-1 == config_param_lower.find("debug")): config_param += " release" if ("mac_arm64" == platform): config_param += " apple_silicon use_javascript_core" if config.check_option("module", "mobile"): config_param += " support_web_socket" return config_param
def androidRuntime(self): try: SDK_ROOT = os.environ['ANDROID_SDK_ROOT'] except Exception: print("ANDROID_SDK_ROOT not defined.\ Please define ANDROID_SDK_ROOT in your environment") return False try: NDK_ROOT = os.environ['NDK_ROOT'] except Exception: print("NDK_ROOT not defined.\ Please define NDK_ROOT in your environment") return False platformsPath = os.path.join(SDK_ROOT, "platforms") if not os.path.isdir(platformsPath): print("Can't find android platforms") return False platforms = os.listdir(platformsPath) versions = [] for platform in platforms: if "android-" in platform: version = platform[platform.find('-') + 1:] versions.append(version) maxVersion = max(map(float, versions)) if maxVersion <= 10.0: print("Update android sdk please") return False buildNative = os.path.join(self.projectPath, "build_native.py") if not os.path.isdir( self.projectPath) or not os.path.isfile(buildNative): print("Can't find the build_native.py") return False sys.path.append(self.projectPath) from build_native import build build(None, str(int(maxVersion)), None, self.pure)
def androidRuntime(self): try: SDK_ROOT = os.environ['ANDROID_SDK_ROOT'] except Exception: print ("ANDROID_SDK_ROOT not defined.\ Please define ANDROID_SDK_ROOT in your environment") return False try: NDK_ROOT = os.environ['NDK_ROOT'] except Exception: print ("NDK_ROOT not defined.\ Please define NDK_ROOT in your environment") return False platformsPath = os.path.join(SDK_ROOT,"platforms") if not os.path.isdir(platformsPath): print ("Can't find android platforms") return False platforms = os.listdir(platformsPath) versions = [] for platform in platforms: if "android-" in platform: version = platform[platform.find('-')+1:] versions.append(version) maxVersion = max(map(float, versions)) if maxVersion <= 10.0: print ("Update android sdk please") return False buildNative = os.path.join(self.projectPath, "build_native.py") if not os.path.isdir(self.projectPath) or not os.path.isfile(buildNative): print ("Can't find the build_native.py") return False sys.path.append(self.projectPath) from build_native import build build(None, str(int(maxVersion)), None, self.pure)
def readSteamLibraryFolders(dbPath): g_dbg.push('readSteamLibraryFolders("{}")'.format(dbPath)) folders = [] with open(dbPath, 'r') as f: while True: line = f.readline() if len(line) == 0: g_dbg.pop("numExternalLibrariesFound({})".format(len(folders))) return folders line = line.rstrip('\n') m = re.match(r'^\s*"\d+"\s+"([^"]+)"\s*$', line) if m: p = m.group(1).replace(r'\\', '/') if g_platform == 'cyg': i = p.find(':/') if i == 1: drive = p[:1] p = p.replace(p[:2], '/cygdrive/' + drive.lower(), 1) path = os.path.join(os.path.normpath(p), 'steamapps') g_dbg.trace('maybeExternalLibrary("{}")'.format(path)) if os.path.exists(path): g_dbg.trace('externalLibraryExists("{}")'.format(path)) folders.append(path)
def readSteamLibraryFolders(dbPath): g_dbg.push('read_steam_master_library_db("{}")'.format(dbPath)) p_library = re.compile(r'^\s*"\d+"\s+"([^"]+)"\s*$') folders = [] with open(dbPath, 'rb') as f: while True: line = f.readline() if len(line) == 0: g_dbg.pop("num_external_libraries_found({})".format(len(folders))) return folders line = line.rstrip('\r\n') m = p_library.match(line) if m: p = m.group(1).replace('\\\\', '/') if g_platform == 'cyg': i = p.find(':/') if i == 1: drive = p[:1] p = p.replace(p[:2], '/cygdrive/' + drive.lower(), 1) path = os.path.join(os.path.normpath(p), 'steamapps') g_dbg.trace('external_library("{}")'.format(path)) if os.path.exists(path): folders.append(path)
router_hardware_type="RouterOP" # select the type of hardware router_hardware_fw_version="5.14" gui_webserver_port=80 service_webserver_port=81 onos_center_internal_ip='192.168.101.1' # the ip of the lan , the one where all nodes are attached service_webserver_delay=1 # seconds of delay between each answer node_webserver_port=9000 # the web server port used on remote nodes router_read_pin_frequency=20 #seconds between a pin read in the router hardware last_pin_read_time=0 platform=platform.node() base_cfg_path="" # if (os.path.exists("/sys/class/gpio")==1) : #if the directory exist ,then the hardware has embedded IO pins if (platform.find("Orange")!=-1)or(platform.find("orange")!=-1)or(platform.find("RouterOP")!=-1): #found uname with orange pi name or RouterOP router_sn=platform[0:12] # get the serial number from /etc/hostname router_hardware_type="RouterOP" enable_usb_serial_port=1 base_cfg_path="/bin/onos/scripts_folder/" baseRoomPath="/bin/onos/scripts_folder/zones/" else: # disable serial port router_sn=platform[0:12] # get the serial number from /etc/hostname router_hardware_type="RouterPC" enable_usb_serial_port=0 base_cfg_path="" baseRoomPath=os.getcwd()+"/zones/" # you musn't have spaces on the path..
def androidRuntime(self): try: SDK_ROOT = os.environ['ANDROID_SDK_ROOT'] except Exception: print("ANDROID_SDK_ROOT not defined.\ Please define ANDROID_SDK_ROOT in your environment") return False try: NDK_ROOT = os.environ['NDK_ROOT'] except Exception: print("NDK_ROOT not defined.\ Please define NDK_ROOT in your environment") return False platformsPath = os.path.join(SDK_ROOT, "platforms") if not os.path.isdir(platformsPath): print("Can't find android platforms") return False projectProperties = os.path.join(self.projectPath, "project.properties") androidVersion = None if os.path.isfile(projectProperties): f = file(projectProperties, 'r') while True: line = f.readline() if "target=" in line and not "#" in line: androidVersion = line[line.find('-') + 1:] break if len(line) == 0: break if androidVersion is None: platforms = os.listdir(platformsPath) versions = [] for platform in platforms: if "android-" in platform: version = platform[platform.find('-') + 1:] versions.append(version) versions = [x for x in map(float, versions) if x > 10.0] if len(versions) == 0: print("Please update your android sdk") return False androidVersion = min(versions) if androidVersion is None or int(androidVersion) < 10: print( "Please update your android sdk or reset android sdk version in the project.properties file" ) return False buildNative = os.path.join(self.projectPath, "build_native.py") if not os.path.isdir( self.projectPath) or not os.path.isfile(buildNative): print("Can't find the build_native.py") return False sys.path.append(self.projectPath) from build_native import build build(None, str(int(androidVersion)), None, self.pure)
def make(): base_dir = base.get_script_dir() + "/../out" git_dir = base.get_script_dir() + "/../.." core_dir = git_dir + "/core" branding = config.branding() platforms = config.option("platform").split() for native_platform in platforms: if not native_platform in config.platforms: continue root_dir = base_dir + ( "/" + native_platform + "/" + branding + ("/DesktopEditors" if base.is_windows() else "/desktopeditors")) if (base.is_dir(root_dir)): base.delete_dir(root_dir) base.create_dir(root_dir) qt_dir = base.qt_setup(native_platform) # check platform on xp isWindowsXP = False if (-1 == native_platform.find("_xp")) else True platform = native_platform[0:-3] if isWindowsXP else native_platform apps_postfix = "build" + base.qt_dst_postfix() if ("" != config.option("branding")): apps_postfix += ("/" + config.option("branding")) apps_postfix += "/" apps_postfix += platform if isWindowsXP: apps_postfix += "/xp" core_build_dir = core_dir + "/build" if ("" != config.option("branding")): core_build_dir += ("/" + config.option("branding")) platform_postfix = platform + base.qt_dst_postfix() # x2t base.create_dir(root_dir + "/converter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "kernel") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "kernel_network") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "UnicodeConverter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "graphics") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfWriter") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfReader") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "DjVuFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "XpsFile") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlFile2") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlRenderer") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "Fb2File") base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "EpubFile") if ("ios" == platform): base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "x2t") else: base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "x2t") # icu if (0 == platform.find("win")): base.copy_file( core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/converter/icudt58.dll") base.copy_file( core_dir + "/Common/3dParty/icu/" + platform + "/build/icuuc58.dll", root_dir + "/converter/icuuc58.dll") if (0 == platform.find("linux")): base.copy_file( core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", root_dir + "/converter/libicudata.so.58") base.copy_file( core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.so.58", root_dir + "/converter/libicuuc.so.58") if (0 == platform.find("mac")): base.copy_file( core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.58.dylib", root_dir + "/converter/libicudata.58.dylib") base.copy_file( core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.58.dylib", root_dir + "/converter/libicuuc.58.dylib") # doctrenderer if isWindowsXP: base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir + "/converter", "doctrenderer") base.copy_files( core_dir + "/Common/3dParty/v8/v8_xp/" + platform + "/release/icudt*.dll", root_dir + "/converter/") else: base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "doctrenderer") if (0 == platform.find("win")): base.copy_files( core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/converter/") elif (-1 == config.option("config").find("use_javascript_core")): base.copy_file( core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/converter/icudtl.dat") base.generate_doctrenderer_config( root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop") base.copy_dir(git_dir + "/document-templates/new", root_dir + "/converter/empty") # dictionaries base.create_dir(root_dir + "/dictionaries") base.copy_dir_content(git_dir + "/dictionaries", root_dir + "/dictionaries", "", ".git") base.copy_dir(git_dir + "/desktop-apps/common/package/fonts", root_dir + "/fonts") base.copy_file( git_dir + "/desktop-apps/common/package/license/3dparty/3DPARTYLICENSE", root_dir + "/3DPARTYLICENSE") # cef if not isWindowsXP: base.copy_files( core_dir + "/Common/3dParty/cef/" + platform + "/build/*", root_dir) else: base.copy_files( core_dir + "/Common/3dParty/cef/" + native_platform + "/build/*", root_dir) isUseQt = True if (0 == platform.find("mac")) or (0 == platform.find("ios")): isUseQt = False # libraries base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "hunspell") base.copy_lib( core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "ooxmlsignature") base.copy_lib( core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "ascdocumentscore") if (0 != platform.find("mac")): base.copy_lib( core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "qtascdocumentscore") if (0 == platform.find("mac")): base.copy_dir( core_build_dir + "/bin/" + platform_postfix + "/editors_helper.app", root_dir + "/editors_helper.app") else: base.copy_exe( core_build_dir + "/bin/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "editors_helper") if isUseQt: base.qt_copy_lib("Qt5Core", root_dir) base.qt_copy_lib("Qt5Gui", root_dir) base.qt_copy_lib("Qt5PrintSupport", root_dir) base.qt_copy_lib("Qt5Svg", root_dir) base.qt_copy_lib("Qt5Widgets", root_dir) base.qt_copy_lib("Qt5Multimedia", root_dir) base.qt_copy_lib("Qt5MultimediaWidgets", root_dir) base.qt_copy_lib("Qt5Network", root_dir) base.qt_copy_lib("Qt5OpenGL", root_dir) base.qt_copy_plugin("bearer", root_dir) base.qt_copy_plugin("iconengines", root_dir) base.qt_copy_plugin("imageformats", root_dir) base.qt_copy_plugin("platforms", root_dir) base.qt_copy_plugin("platforminputcontexts", root_dir) base.qt_copy_plugin("printsupport", root_dir) base.qt_copy_plugin("mediaservice", root_dir) base.qt_copy_plugin("playlistformats", root_dir) base.qt_copy_plugin("platformthemes", root_dir) base.qt_copy_plugin("xcbglintegrations", root_dir) base.qt_copy_plugin("styles", root_dir) if (0 == platform.find("linux")): base.qt_copy_lib("Qt5DBus", root_dir) base.qt_copy_lib("Qt5X11Extras", root_dir) base.qt_copy_lib("Qt5XcbQpa", root_dir) base.qt_copy_icu(root_dir) base.copy_files( base.get_env("QT_DEPLOY") + "/../lib/libqgsttools_p.so*", root_dir) if (0 == platform.find("win")): base.copy_file( git_dir + "/desktop-apps/win-linux/extras/projicons/" + apps_postfix + "/projicons.exe", root_dir + "/DesktopEditors.exe") base.copy_file( git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors.exe", root_dir + "/editors.exe") base.copy_file( git_dir + "/desktop-apps/win-linux/res/icons/desktopeditors.ico", root_dir + "/app.ico") elif (0 == platform.find("linux")): base.copy_file( git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors", root_dir + "/DesktopEditors") base.copy_lib( core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "videoplayer") base.create_dir(root_dir + "/editors") base.copy_dir(base_dir + "/js/" + branding + "/desktop/sdkjs", root_dir + "/editors/sdkjs") base.copy_dir(base_dir + "/js/" + branding + "/desktop/web-apps", root_dir + "/editors/web-apps") base.copy_dir( git_dir + "/desktop-sdk/ChromiumBasedEditors/resources/local", root_dir + "/editors/sdkjs/common/Images/local") base.create_dir(root_dir + "/editors/sdkjs-plugins") base.copy_sdkjs_plugins(root_dir + "/editors/sdkjs-plugins", True, True) # remove some default plugins if base.is_dir(root_dir + "/editors/sdkjs-plugins/speech"): base.delete_dir(root_dir + "/editors/sdkjs-plugins/speech") # io base.create_dir(root_dir + "/editors/sdkjs-plugins/v1") base.download( "https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js", root_dir + "/editors/sdkjs-plugins/v1/plugins.js") base.download( "https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", root_dir + "/editors/sdkjs-plugins/v1/plugins-ui.js") base.download( "https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", root_dir + "/editors/sdkjs-plugins/v1/plugins.css") base.support_old_versions_plugins(root_dir + "/editors/sdkjs-plugins") base.copy_sdkjs_plugin( git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "manager", True) base.copy_sdkjs_plugin( git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt", root_dir + "/editors/sdkjs-plugins", "advanced2", True) #base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt/ui/common/{14A8FC87-8E26-4216-B34E-F27F053B2EC4}", root_dir + "/editors/sdkjs-plugins/{14A8FC87-8E26-4216-B34E-F27F053B2EC4}") #base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt/ui/engine/database/{9AB4BBA8-A7E5-48D5-B683-ECE76A020BB1}", root_dir + "/editors/sdkjs-plugins/{9AB4BBA8-A7E5-48D5-B683-ECE76A020BB1}") base.copy_sdkjs_plugin( git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "sendto", True) base.copy_file(base_dir + "/js/" + branding + "/desktop/index.html", root_dir + "/index.html") base.copy_dir(git_dir + "/desktop-apps/common/loginpage/providers", root_dir + "/providers") isUseJSC = False if (0 == platform.find("mac")): file_size_doctrenderer = os.path.getsize( root_dir + "/converter/libdoctrenderer.dylib") print("file_size_doctrenderer: " + str(file_size_doctrenderer)) if (file_size_doctrenderer < 5 * 1024 * 1024): isUseJSC = True if isUseJSC: base.delete_file(root_dir + "/converter/icudtl.dat") if (0 == platform.find("win")): base.copy_lib( git_dir + "/desktop-apps/win-linux/3dparty/WinSparkle/" + platform, root_dir, "WinSparkle") base.delete_file(root_dir + "/cef_sandbox.lib") base.delete_file(root_dir + "/libcef.lib") isMacArmPlaformOnIntel = False if (platform == "mac_arm64") and not base.is_os_arm(): isMacArmPlaformOnIntel = True # all themes generate ---- base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "allfontsgen") base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "allthemesgen") if (0 == platform.find("mac")): base.mac_correct_rpath_desktop(root_dir) if isMacArmPlaformOnIntel: sdkjs_dir = root_dir + "/editors/sdkjs" end_find_platform = sdkjs_dir.rfind("/mac_arm64/") sdkjs_dir_mac64 = sdkjs_dir[ 0:end_find_platform] + "/mac_64/" + sdkjs_dir[ end_find_platform + 11:] base.delete_dir(sdkjs_dir) base.copy_dir(sdkjs_dir_mac64, sdkjs_dir) else: themes_params = [] if ("" != config.option("themesparams")): themes_params = [ "--params=\"" + config.option("themesparams") + "\"" ] base.cmd_exe(root_dir + "/converter/allfontsgen", [ "--use-system=\"1\"", "--input=\"" + root_dir + "/fonts\"", "--input=\"" + git_dir + "/core-fonts\"", "--allfonts=\"" + root_dir + "/converter/AllFonts.js\"", "--selection=\"" + root_dir + "/converter/font_selection.bin\"" ]) base.cmd_exe(root_dir + "/converter/allthemesgen", [ "--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\"" ] + themes_params) base.delete_file(root_dir + "/converter/AllFonts.js") base.delete_file(root_dir + "/converter/font_selection.bin") base.delete_exe(root_dir + "/converter/allfontsgen") base.delete_exe(root_dir + "/converter/allthemesgen") if not isUseJSC: base.delete_file(root_dir + "/editors/sdkjs/slide/sdk-all.cache") return
def platform_is_32(platform): if (-1 != platform.find("_32")): return True return False
import platform import subprocess class EnvInfo: def __init__(self, type, name): self.os_type = type self.os_name = name os_type = 'unknow' os_name = 'unknow' python_ver = 'unknow' # confirm env info # --------------------------------------------------- envinfo = EnvInfo('unknow', 'unknow') platform = platform.platform() if -1 != platform.find('Darwin'): envinfo.os_type = 'mac' elif -1 != platform.find('Linux'): envinfo.os_type = 'linux' if -1 != platform.find('Kali'): envinfo.os_name = 'kali' elif -1 != platform.find('Windows'): envinfo.os_name = 'windows' python_ver = sys.version.split('.') python_ver = python_ver[0] + '.' + python_ver[1] envinfo.python_ver = python_ver # delete # --------------------------------------------------- os.system('sudo rm -rf /opt/bin/vimstudio')
class EnvInfo: def __init__(self, type, name): self.os_type = type self.os_name = name os_type = 'unknow' os_name = 'unknow' python_ver = 'unknow' # confirm env info # --------------------------------------------------- envinfo = EnvInfo('unknow', 'unknow') platform = platform.platform() if -1 != platform.find('Darwin'): envinfo.os_type = 'mac' elif -1 != platform.find('Linux'): envinfo.os_type = 'linux' if -1 != platform.find('Kali'): envinfo.os_name = 'kali' elif -1 != platform.find('Windows'): envinfo.os_name = 'windows' python_ver = sys.version.split('.') python_ver = python_ver[0] + '.' + python_ver[1] envinfo.python_ver = python_ver # delete # --------------------------------------------------- os.system('sudo rm -rf /opt/bin/vimstudio')