def _run_configure_and_build(self, bento_info, install_prefix): top_node = self.top_node create_fake_package_from_bento_info(top_node, bento_info) context = GlobalContext(None) options = PackageOptions.from_string(bento_info) context.register_package_options(options) cmd_argv = [ "--prefix=%s" % install_prefix, "--exec-prefix=%s" % install_prefix ] conf, configure = prepare_configure(top_node, bento_info, ConfigureYakuContext, cmd_argv) context.register_command("configure", configure) options_context = OptionsContext.from_command(configure) if not context.is_options_context_registered("configure"): context.register_options_context("configure", options_context) context.save_command_argv("configure", cmd_argv) run_command_in_context(conf, configure) bld, build = prepare_build(top_node, bento_info) run_command_in_context(bld, build) return context, conf, configure, bld, build
def _run_configure_and_build(self, bento_info, install_prefix): top_node = self.top_node create_fake_package_from_bento_info(top_node, bento_info) context = GlobalContext(None) options = PackageOptions.from_string(bento_info) context.register_package_options(options) cmd_argv = ["--prefix=%s" % install_prefix, "--exec-prefix=%s" % install_prefix] conf, configure = prepare_configure(top_node, bento_info, ConfigureYakuContext, cmd_argv) context.register_command("configure", configure) options_context = OptionsContext.from_command(configure) if not context.is_options_context_registered("configure"): context.register_options_context("configure", options_context) context.save_command_argv("configure", cmd_argv) run_command_in_context(conf, configure) bld, build = prepare_build(top_node, bento_info) run_command_in_context(bld, build) return context, conf, configure, bld, build
def create_global_context(package, package_options, backend=None): if backend is None: backend = YakuBackend() global_context = GlobalContext(None) global_context.register_package_options(package_options) if backend: global_context.backend = backend build = BuildCommand() configure = ConfigureCommand() commands = (("configure", configure), ("build", build)) for cmd_name, cmd in commands: global_context.register_command(cmd_name, cmd) options_context = OptionsContext.from_command(cmd) global_context.register_options_context(cmd_name, options_context) global_context.backend.register_command_contexts(global_context) global_context.backend.register_options_contexts(global_context) return global_context