def init_build_icu(icu_src, icu_version='', archive_icu=False, environment=dict(os.environ)): # clean up first cleanup_icu() icu_src_dir = os.path.join(SCRIPT_ROOT_DIR, ICU_SRC_DIR_NAME) # what to do if not icu_src: print( '*** Error! You asked to build the ICU but did not tell from where to find the sources?' ) sys.exit(-1) if icu_src.endswith('git'): if not icu_version: print( '*** Error! You asked to clone ICU sources from git repository but did not tell from which branch/tag/sha?' ) sys.exit(-1) bldinstallercommon.clone_repository(icu_src, icu_version, icu_src_dir) else: if not bldinstallercommon.is_content_url_valid(icu_src): print('*** Error! The given URL for ICU sources is not valid: {0}'. format(icu_src)) sys.exit(-1) package_save_as_temp = os.path.join(SCRIPT_ROOT_DIR, os.path.basename(icu_src)) bldinstallercommon.create_dirs(icu_src_dir) print('Downloading ICU src package: ' + icu_src) bldinstallercommon.retrieve_url(icu_src, package_save_as_temp) bldinstallercommon.extract_file(package_save_as_temp, icu_src_dir) # now build the icu icu_configuration = None if bldinstallercommon.is_linux_platform(): icu_configuration = build_icu_linux( environment, os.path.join(SCRIPT_ROOT_DIR, icu_src_dir), archive_icu) elif bldinstallercommon.is_mac_platform(): print('*** ICU build for macOS not implemented yet!') elif bldinstallercommon.is_win_platform(): icu_configuration = build_icu_win( environment, os.path.join(SCRIPT_ROOT_DIR, icu_src_dir), archive_icu) else: print('*** Unsupported platform') # set options for Qt5 build extra_qt_configure_args = ' -L' + icu_configuration.icu_lib_path extra_qt_configure_args += ' -I' + icu_configuration.icu_include_path icu_configuration.qt_configure_extra_args = extra_qt_configure_args icu_configuration.environment = get_icu_env( icu_configuration.icu_lib_path, icu_configuration.icu_include_path) return icu_configuration
def prepare_installer_framework(options): if options.incremental_mode and os.path.exists(options.installer_framework_source_dir): return print('--------------------------------------------------------------------') print('Prepare Installer Framework source') #create dirs bldinstallercommon.create_dirs(options.installer_framework_build_dir) if options.qt_installer_framework_uri.endswith('.git'): # clone repos bldinstallercommon.clone_repository(options.qt_installer_framework_uri, options.qt_installer_framework_branch, options.installer_framework_source_dir) else: # fetch src package prepare_src_package(options.qt_installer_framework_uri, options.qt_installer_framework_uri_saveas, options.installer_framework_source_dir)
def init_build_icu(icu_src, icu_version = '', archive_icu = False, environment = dict(os.environ)): # clean up first cleanup_icu() icu_src_dir = os.path.join(SCRIPT_ROOT_DIR, ICU_SRC_DIR_NAME) # what to do if not icu_src: print('*** Error! You asked to build the ICU but did not tell from where to find the sources?') sys.exit(-1) if icu_src.endswith('git'): if not icu_version: print('*** Error! You asked to clone ICU sources from git repository but did not tell from which branch/tag/sha?') sys.exit(-1) bldinstallercommon.clone_repository(icu_src, icu_version, icu_src_dir) else: if not bldinstallercommon.is_content_url_valid(icu_src): print('*** Error! The given URL for ICU sources is not valid: {0}'.format(icu_src)) sys.exit(-1) package_save_as_temp = os.path.join(SCRIPT_ROOT_DIR, os.path.basename(icu_src)) bldinstallercommon.create_dirs(icu_src_dir) print('Downloading ICU src package: ' + icu_src) bldinstallercommon.retrieve_url(icu_src, package_save_as_temp) bldinstallercommon.extract_file(package_save_as_temp, icu_src_dir) # now build the icu icu_configuration = None if bldinstallercommon.is_linux_platform(): icu_configuration = build_icu_linux(environment, os.path.join(SCRIPT_ROOT_DIR, icu_src_dir), archive_icu) elif bldinstallercommon.is_mac_platform(): print('*** ICU build for macOS not implemented yet!') elif bldinstallercommon.is_win_platform(): icu_configuration = build_icu_win(environment, os.path.join(SCRIPT_ROOT_DIR, icu_src_dir), archive_icu) else: print('*** Unsupported platform') # set options for Qt5 build extra_qt_configure_args = ' -L' + icu_configuration.icu_lib_path extra_qt_configure_args += ' -I' + icu_configuration.icu_include_path icu_configuration.qt_configure_extra_args = extra_qt_configure_args icu_configuration.environment = get_icu_env(icu_configuration.icu_lib_path, icu_configuration.icu_include_path) return icu_configuration
if callerArguments.qt5path != os.path.abspath(callerArguments.qt5path): print("changing the value of --qt5path from {0} to {1}".format( callerArguments.qt5path, os.path.abspath(callerArguments.qt5path))) callerArguments.qt5path = os.path.abspath(callerArguments.qt5path) if not callerArguments.module_name: callerArguments.module_name = os.environ['MODULE_NAME'] tempPath = os.path.abspath(os.path.join(os.path.dirname(__file__), 'temp')) # clone module repo if callerArguments.module_url != '': bldinstallercommon.init_common_module(os.getcwd()) bldinstallercommon.create_dirs(MODULE_SRC_DIR) bldinstallercommon.clone_repository( callerArguments.module_url, callerArguments.module_branch, os.path.join(os.path.dirname(__file__), MODULE_SRC_DIR_NAME)) qtModuleSourceDirectory = MODULE_SRC_DIR elif callerArguments.module7z != '': bldinstallercommon.create_dirs(MODULE_SRC_DIR) myGetQtModule = ThreadedWork("get and extract module src") myGetQtModule.addTaskObject( bldinstallercommon.create_download_extract_task( callerArguments.module7z, MODULE_SRC_DIR, tempPath, callerArguments)) myGetQtModule.run() qtModuleSourceDirectory = MODULE_SRC_DIR else: print(("Using local copy of {0}").format(callerArguments.module_name)) qtModuleSourceDirectory = callerArguments.module_dir
stripVars(callerArguments, "\"") if callerArguments.qt5path != os.path.abspath(callerArguments.qt5path): print("changing the value of --qt5path from {0} to {1}".format(callerArguments.qt5path, os.path.abspath(callerArguments.qt5path))) callerArguments.qt5path = os.path.abspath(callerArguments.qt5path) if not callerArguments.module_name: callerArguments.module_name = os.environ['MODULE_NAME'] tempPath = os.path.abspath(os.path.join(os.path.dirname(__file__), 'temp')) # clone module repo if callerArguments.module_url != '': bldinstallercommon.init_common_module(os.getcwd()) bldinstallercommon.create_dirs(MODULE_SRC_DIR) bldinstallercommon.clone_repository(callerArguments.module_url, callerArguments.module_branch, os.path.join(os.path.dirname(__file__), MODULE_SRC_DIR_NAME)) qtModuleSourceDirectory = MODULE_SRC_DIR elif callerArguments.module7z != '': bldinstallercommon.create_dirs(MODULE_SRC_DIR) myGetQtModule = ThreadedWork("get and extract module src") myGetQtModule.addTaskObject(bldinstallercommon.create_download_extract_task(callerArguments.module7z, MODULE_SRC_DIR, tempPath, callerArguments)) myGetQtModule.run() qtModuleSourceDirectory = MODULE_SRC_DIR else: print(("Using local copy of {0}").format(callerArguments.module_name)) qtModuleSourceDirectory = callerArguments.module_dir # install directory qtModuleInstallDirectory = qtModuleSourceDirectory + '_install' if bldinstallercommon.is_win_platform(): # rip out drive letter from path on Windows