def setup(install_root, relocate=True): # FIXME: preserve API with existing clients but should be removed to provide a cleaner one. if install_root in ('static', 'dynamic'): print('WARNING: Legacy code-path, please update your script.') build_type = install_root layout = sdk.get_layout(sdk.platform_root(HERE, build_type)) if os.path.isdir(os.path.join(HERE, '.svn')): svn_update_current_platform(layout['root']) else: layout = sdk.get_layout(sdk.platform_root(install_root)) if relocate: relocate_qt(layout) relocate_sip(layout) setup_environment(layout)
def check_source_dir(glob_pattern): sdk.print_box("Sources discovery for %r..." % glob_pattern) sources_pattern = os.path.join(HERE, 'sources', glob_pattern) sources_pattern_platform = os.path.join(sdk.platform_root('sources'), glob_pattern) globs = glob.glob(sources_pattern) + glob.glob(sources_pattern_platform) candidates = [d for d in globs if os.path.isdir(d)] if len(candidates) == 1: return candidates[0] elif len(candidates) > 1: argparse.ArgumentTypeError( "Too many candidates for %s: %s" % (glob_pattern, ", ".join(candidates))) else: argparse.ArgumentTypeError("%r not found, provide an existing folder" % glob_pattern)
def check_source_dir(glob_pattern): sdk.print_box("Sources discovery for %r..." % glob_pattern) sources_pattern = os.path.join(HERE, 'sources', glob_pattern) sources_pattern_platform = os.path.join(sdk.platform_root('sources'), glob_pattern) globs = glob.glob(sources_pattern) + glob.glob( sources_pattern_platform) candidates = [d for d in globs if os.path.isdir(d)] if len(candidates) == 1: return candidates[0] elif len(candidates) > 1: argparse.ArgumentTypeError("Too many candidates for %s: %s" % (glob_pattern, ", ".join(candidates))) else: argparse.ArgumentTypeError( "%r not found, provide an existing folder" % glob_pattern)
def main(): args = parse_command_line() # Prepare the build plan # plan :: (component_name, build_function, abs_source_directory_path) plan = [] def add_to_plan(plan, component_name, build_f, source_directory): plan.append((component_name, build_f, source_directory)) add_to_plan(plan, 'icu', build_icu, args.with_icu_sources) add_to_plan(plan, 'qt', build_qt, args.with_qt_sources) add_to_plan(plan, 'sip', build_sip, args.with_sip_sources) add_to_plan(plan, 'pyqt', build_pyqt, args.with_pyqt_sources) # If user specified some packages on the command line, build only those if args.packages != 'all': plan = [entry for entry in plan if entry[0] in args.packages] # Get this installation's layout layout = sdk.get_layout(sdk.platform_root(args.install_root)) # Setup build environment prep(layout) # --only-merge stops the build here. if args.only_merge: merge(layout) return # --shell stops the build here. if args.shell: sdk.start_subshell() return # --only-scripts stops the build here. if args.only_scripts: install_scripts(args.install_root) return # Build build(plan, layout, args.debug, args.profile) merge(layout) install_scripts(args.install_root)