def fetch_repogen_tools(tools_uri): global REPOGEN_TOOL executable_suffix = bldinstallercommon.get_executable_suffix() # first check if we have existing copy of the tool if os.path.exists(REPOGEN_TOOLS_DIR): tool = bldinstallercommon.locate_executable(REPOGEN_TOOLS_DIR, REPOGEN_TOOL + executable_suffix) if os.path.isfile(tool): REPOGEN_TOOL = tool print('Found existing repogen tool: {0}'.format(REPOGEN_TOOL)) return else: # remove the bogus directory bldinstallercommon.remove_tree(REPOGEN_TOOLS_DIR) # create dirs bldinstallercommon.create_dirs(REPOGEN_TOOLS_DIR) # fetch print('Fetch repogen tools') if bldinstallercommon.is_content_url_valid(tools_uri): package_save_as_temp = os.path.normpath(os.path.join(ROOT_DIR, os.path.basename(tools_uri))) bldinstallercommon.retrieve_url(tools_uri, package_save_as_temp) bldinstallercommon.extract_file(package_save_as_temp, REPOGEN_TOOLS_DIR) print('Trying to locate repogen tool: {0}'.format(REPOGEN_TOOL + executable_suffix)) tool = bldinstallercommon.locate_executable(REPOGEN_TOOLS_DIR, REPOGEN_TOOL + executable_suffix) if not os.path.isfile(tool): raise IOError('Unable to locate repogen tool [%s] under directory: %s' % (REPOGEN_TOOL + executable_suffix, REPOGEN_TOOLS_DIR)) else: REPOGEN_TOOL = tool else: raise IOError('Invalid url: %s' % tools_uri) # found the tool print('Using repogen tool: {0}'.format(REPOGEN_TOOL))
def fetch_repogen_tools(tools_uri): global REPOGEN_TOOL executable_suffix = bldinstallercommon.get_executable_suffix() # first check if we have existing copy of the tool if os.path.exists(REPOGEN_TOOLS_DIR): tool = bldinstallercommon.locate_executable( REPOGEN_TOOLS_DIR, REPOGEN_TOOL + executable_suffix) if os.path.isfile(tool): REPOGEN_TOOL = tool print('Found existing repogen tool: {0}'.format(REPOGEN_TOOL)) return else: # remove the bogus directory bldinstallercommon.remove_tree(REPOGEN_TOOLS_DIR) # create dirs bldinstallercommon.create_dirs(REPOGEN_TOOLS_DIR) # fetch print('Fetch repogen tools') if bldinstallercommon.is_content_url_valid(tools_uri): package_save_as_temp = os.path.normpath( os.path.join(ROOT_DIR, os.path.basename(tools_uri))) bldinstallercommon.retrieve_url(tools_uri, package_save_as_temp) bldinstallercommon.extract_file(package_save_as_temp, REPOGEN_TOOLS_DIR) print('Trying to locate repogen tool: {0}'.format(REPOGEN_TOOL + executable_suffix)) tool = bldinstallercommon.locate_executable( REPOGEN_TOOLS_DIR, REPOGEN_TOOL + executable_suffix) if not os.path.isfile(tool): raise IOError( 'Unable to locate repogen tool [%s] under directory: %s' % (REPOGEN_TOOL + executable_suffix, REPOGEN_TOOLS_DIR)) else: REPOGEN_TOOL = tool else: raise IOError('Invalid url: %s' % tools_uri) # found the tool print('Using repogen tool: {0}'.format(REPOGEN_TOOL))
def qmake_binary(qt5_path): return os.path.abspath( os.path.join(qt5_path, 'bin', 'qmake' + bldinstallercommon.get_executable_suffix()))
def save_original_qt_prfxpath(): print_wrap('---------------- Saving original qt_prfxpath -----------------------') global ORIGINAL_QMAKE_QT_PRFXPATH qmake_executable_path = bldinstallercommon.locate_executable(QT_SOURCE_DIR, 'qmake' + bldinstallercommon.get_executable_suffix()) if not qmake_executable_path: print_wrap('*** Error! qmake executable not found? Looks like the build has failed in previous step? Aborting..') sys.exit(-1) ORIGINAL_QMAKE_QT_PRFXPATH = patch_qmake_qt_key.fetch_key(os.path.normpath(qmake_executable_path), 'qt_prfxpath') print_wrap(' ===> Original qt_prfxpath: ' + ORIGINAL_QMAKE_QT_PRFXPATH) if not ORIGINAL_QMAKE_QT_PRFXPATH: print_wrap('*** Could not find original qt_prfxpath from qmake executable?!') print_wrap('*** Abort!') sys.exit(-1) print_wrap('--------------------------------------------------------------------')
def save_install_prefix(): print_wrap('---------------- Saving install prefix -----------------------------') global INSTALL_PREFIX qmake_executable_path = bldinstallercommon.locate_executable(QT_SOURCE_DIR, 'qmake' + bldinstallercommon.get_executable_suffix()) if not qmake_executable_path: print_wrap('*** Error! qmake executable not found? Looks like the build has failed in previous step?') exit_script() query_args = qmake_executable_path + ' -query' dummy, output = bldinstallercommon.do_execute_sub_process(query_args.split(' '), '.', get_output=True) data = output.split('\n') for line in data: if 'QT_INSTALL_PREFIX' in line: splitted = line.split(':') #windows has different syntax in qmake -query if bldinstallercommon.is_win_platform(): INSTALL_PREFIX = splitted[2] else: INSTALL_PREFIX = splitted[1] INSTALL_PREFIX = INSTALL_PREFIX.strip() print_wrap('INSTALL_PREFIX = ' + INSTALL_PREFIX) break print_wrap('--------------------------------------------------------------------')
def qmake_binary(qt5_path): return os.path.abspath(os.path.join(qt5_path, 'bin', 'qmake' + bldinstallercommon.get_executable_suffix()))