def setup(install_root, relocate=True): layout = sdk.get_layout(install_root) if relocate: relocate_qt(layout) relocate_sip(layout) setup_environment(layout)
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 main(): args = parse_command_line() # Load build profile with open(args.profile, 'r') as profile_json: profile = json.load(profile_json) # Autodiscover source directories, if possible. args.with_icu_sources = args.with_icu_sources or find_source_dir('icu*') args.with_qt_sources = args.with_qt_sources or find_source_dir('qt-everywhere-*') args.with_sip_sources = args.with_sip_sources or find_source_dir('sip-*') args.with_pyqt_sources = args.with_pyqt_sources or find_source_dir('PyQt-*') # Prepare the build plan # plan :: (component_name, build_function, abs_source_directory_path) plan = [] 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: plan = [entry for entry in plan if entry[0] in args.packages] # Determine install root if args.install_root: install_root = args.install_root else: qt_version = extract_version(args.with_qt_sources) sip_version = extract_version(args.with_sip_sources) pyqt_version = extract_version(args.with_pyqt_sources) plat = sys.platform arch = platform.architecture()[0] build_type = 'debug' if args.debug else 'release' install_root = os.path.join(HERE, '_out', 'qt-%s-sip-%s-pyqt-%s-%s-%s-%s' % (qt_version, sip_version, pyqt_version, plat, arch, build_type)) # Get this installation's layout layout = sdk.get_layout(install_root) # Build prep(layout) build(plan, layout, args.debug, profile) if args.make_package: install_scripts(install_root) package(install_root, '%s.tar.gz' % (os.path.basename(install_root)))
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)