Exemple #1
0
    def start(self):
        # Use a common prefix for the build tools for all the configurations
        # so that it can be reused
        config = Config()
        os.environ.clear()
        os.environ.update(self.config._pre_environ)
        config.prefix = self.config.build_tools_prefix
        config.home_dir = self.config.home_dir
        config.load()
        config.variants.python3 = False

        config.prefix = self.config.build_tools_prefix
        config.build_tools_prefix = self.config.build_tools_prefix
        config.sources = self.config.build_tools_sources
        config.build_tools_sources = self.config.build_tools_sources
        config.cache_file = self.config.build_tools_cache
        config.build_tools_cache = self.config.build_tools_cache
        config.external_recipes = self.config.external_recipes

        if not os.path.exists(config.prefix):
            os.makedirs(config.prefix)
        if not os.path.exists(config.sources):
            os.makedirs(config.sources)

        config.do_setup_env()
        cookbook = CookBook(config)
        recipes = self.BUILD_TOOLS
        recipes += self.PLAT_BUILD_TOOLS.get(self.config.platform, [])
        oven = Oven(recipes, cookbook)
        oven.start_cooking()
        self.config.do_setup_env()
Exemple #2
0
    def start(self):
        # Use a common prefix for the build tools for all the configurations
        # so that it can be reused
        config = Config()
        os.environ.clear()
        os.environ.update(self.config._pre_environ)
        config.prefix = self.config.build_tools_prefix
        config.home_dir = self.config.home_dir
        config.load()

        config.prefix = self.config.build_tools_prefix
        config.build_tools_prefix = self.config.build_tools_prefix
        config.sources = self.config.build_tools_sources
        config.build_tools_sources = self.config.build_tools_sources
        config.cache_file = self.config.build_tools_cache
        config.build_tools_cache = self.config.build_tools_cache
        config.external_recipes = self.config.external_recipes

        if config.toolchain_prefix and not os.path.exists(config.toolchain_prefix):
            raise ConfigurationError(_("Please run bootstrap without any '-c' arguments first to setup build-tools for this machine"))
        if not os.path.exists(config.prefix):
            os.makedirs(config.prefix)
        if not os.path.exists(config.sources):
            os.makedirs(config.sources)

        config.do_setup_env()
        cookbook = CookBook(config)
        recipes = self.BUILD_TOOLS
        recipes += self.PLAT_BUILD_TOOLS.get(self.config.platform, [])
        oven = Oven(recipes, cookbook)
        oven.start_cooking()
        self.config.do_setup_env()
    def start(self):
        # Use a common prefix for the build tools for all the configurations
        # so that it can be reused
        config = Config()
        os.environ.clear()
        os.environ.update(self.config._pre_environ)
        config.prefix = self.config.build_tools_prefix
        config.home_dir = self.config.home_dir
        config.load()
        config.variants.python3 = False

        config.prefix = self.config.build_tools_prefix
        config.build_tools_prefix = self.config.build_tools_prefix
        config.sources = self.config.build_tools_sources
        config.build_tools_sources = self.config.build_tools_sources
        config.cache_file = self.config.build_tools_cache
        config.build_tools_cache = self.config.build_tools_cache
        config.external_recipes = self.config.external_recipes

        if not os.path.exists(config.prefix):
            os.makedirs(config.prefix)
        if not os.path.exists(config.sources):
            os.makedirs(config.sources)

        config.do_setup_env()
        cookbook = CookBook(config)
        recipes = self.BUILD_TOOLS
        recipes += self.PLAT_BUILD_TOOLS.get(self.config.platform, [])
        oven = Oven(recipes, cookbook)
        oven.start_cooking()
        self.config.do_setup_env()
Exemple #4
0
    def start(self):
        # Use a common prefix for the build tools for all the configurations
        # so that it can be reused
        config = Config()
        os.environ.clear()
        os.environ.update(self.config._pre_environ)
        config.prefix = self.config.build_tools_prefix
        config.home_dir = self.config.home_dir
        config.load()

        config.prefix = self.config.build_tools_prefix
        config.build_tools_prefix = self.config.build_tools_prefix
        config.sources = self.config.build_tools_sources
        config.build_tools_sources = self.config.build_tools_sources
        config.cache_file = self.config.build_tools_cache
        config.build_tools_cache = self.config.build_tools_cache
        config.external_recipes = self.config.external_recipes

        if config.toolchain_prefix and not os.path.exists(
                config.toolchain_prefix):
            raise ConfigurationError(
                _("Please run bootstrap without any '-c' arguments first to setup build-tools for this machine"
                  ))
        if not os.path.exists(config.prefix):
            os.makedirs(config.prefix)
        if not os.path.exists(config.sources):
            os.makedirs(config.sources)

        config.do_setup_env()
        cookbook = CookBook(config)
        recipes = self.BUILD_TOOLS
        recipes += self.PLAT_BUILD_TOOLS.get(self.config.platform, [])
        oven = Oven(recipes, cookbook)
        oven.start_cooking()
        self.config.do_setup_env()
Exemple #5
0
    def start(self, jobs=0):
        self.insert_python_site()

        # Check and these at the last minute because we may have installed them
        # in system bootstrap
        self.recipes += self.check_build_tools()
        oven = Oven(self.recipes, self.cookbook, jobs=jobs)
        oven.start_cooking()
Exemple #6
0
    def runargs(self, config, recipes, missing_files=False, force=False,
                no_deps=False, cookbook=None):
        if cookbook is None:
            cookbook = CookBook(config)

        oven = Oven(recipes, cookbook, force=self.force,
                    no_deps=self.no_deps, missing_files=missing_files)
        oven.start_cooking()
Exemple #7
0
    def runargs(self,
                config,
                recipes,
                missing_files=False,
                force=False,
                no_deps=False,
                cookbook=None):
        if cookbook is None:
            cookbook = CookBook(config)

        oven = Oven(recipes,
                    cookbook,
                    force=self.force,
                    no_deps=self.no_deps,
                    missing_files=missing_files)
        oven.start_cooking()
Exemple #8
0
    def runargs(self, config, fuzzy_recipes, missing_files=False, force=False,
                no_deps=False, cookbook=None, dry_run=False, offline=False,
                deps_only=False, jobs=None):
        if cookbook is None:
            cookbook = CookBook(config, offline=offline)

        recipes = []
        for recipe in fuzzy_recipes:
          found = cookbook.get_closest_recipe(recipe)
          if found:
            recipes.append(found)
          else:
            recipes.append(recipe)

        oven = Oven(recipes, cookbook, force=self.force,
                    no_deps=self.no_deps, missing_files=missing_files,
                    dry_run=dry_run, deps_only=deps_only, jobs=jobs)
        oven.start_cooking()
Exemple #9
0
    def runargs(self, config, recipes, missing_files=False, force=False,
                no_deps=False, store=None, dry_run=False, use_binaries=False,
                upload_binaries=False, build_missing=False):
        if not store:
            store = PackagesStore(config)
        cookbook = store.cookbook

        oven = Oven(cookbook, force=self.force, missing_files=missing_files,
                    dry_run=dry_run, store=store)

        if isinstance(recipes, str):
            recipes = [recipes]

        if no_deps:
            ordered_recipes = recipes
        else:
            ordered_recipes = cookbook.list_recipes_deps(recipes)
        oven.start_cooking(ordered_recipes, use_binaries, upload_binaries,
                build_missing)
Exemple #10
0
    def runargs(self,
                config,
                recipes,
                missing_files=False,
                force=False,
                no_deps=False,
                cookbook=None,
                dry_run=False,
                offline=False,
                deps_only=False):
        if cookbook is None:
            cookbook = CookBook(config, offline=offline)

        oven = Oven(recipes,
                    cookbook,
                    force=self.force,
                    no_deps=self.no_deps,
                    missing_files=missing_files,
                    dry_run=dry_run,
                    deps_only=deps_only)
        oven.start_cooking()
Exemple #11
0
    def run(self, config, args):
        import cerbero
        import os
        from cerbero.build.recipe import BuildSteps
        cerbero.build.recipe.Recipe.package_name = os.path.basename(
            args.directory)
        cerbero.build.recipe.Recipe._default_steps = []
        if args.fetch:
            cerbero.build.recipe.Recipe._default_steps.append(BuildSteps.FETCH)
            cerbero.build.recipe.Recipe._default_steps.append(
                BuildSteps.EXTRACT)

        if args.configure:
            cerbero.build.recipe.Recipe._default_steps.append(
                BuildSteps.CONFIGURE)
        if args.compile:
            cerbero.build.recipe.Recipe._default_steps.append(
                BuildSteps.COMPILE)
        if args.check:
            cerbero.build.recipe.Recipe._default_steps.append(BuildSteps.CHECK)

        if args.install:
            cerbero.build.recipe.Recipe._default_steps.append(
                BuildSteps.INSTALL)
            cerbero.build.recipe.Recipe._default_steps.append(
                BuildSteps.POST_INSTALL)

        config.sources = os.path.dirname(args.directory)
        config.local_sources = os.path.dirname(args.local_sources)
        config.repo_dir = os.path.dirname(args.local_sources)

        cookbook = CookBook(config)

        oven = Oven(args.recipe,
                    cookbook,
                    force=True,
                    no_deps=True,
                    missing_files=False,
                    dry_run=args.dry_run)
        oven.start_cooking()
Exemple #12
0
    def start(self):
        # Use a common prefix for the build tools for all the configurations
        # so that it can be reused
        config = Config()
        os.environ.clear()
        os.environ.update(self.config._pre_environ)
        config.load()
        config.prefix = config.build_tools_prefix
        config.sources = os.path.join(DEFAULT_HOME, 'sources', 'buid-tools')
        config.cache_file = 'build_tools'

        if not os.path.exists(config.prefix):
            os.makedirs(config.prefix)
        if not os.path.exists(config.sources):
            os.makedirs(config.sources)

        config.do_setup_env()
        cookbook = CookBook(config)
        recipes = self.BUILD_TOOLS
        recipes += self.PLAT_BUILD_TOOLS.get(self.config.platform, [])
        oven = Oven(recipes, cookbook)
        oven.start_cooking()
        self.config.do_setup_env()
Exemple #13
0
    def start(self):
        # Use a common prefix for the build tools for all the configurations
        # so that it can be reused
        config = Config()
        os.environ.clear()
        os.environ.update(self.config._pre_environ)
        config.load()
        config.prefix = config.build_tools_prefix
        config.sources = os.path.join(DEFAULT_HOME, 'sources', 'buid-tools')
        config.cache_file = 'build_tools'

        if not os.path.exists(config.prefix):
            os.makedirs(config.prefix)
        if not os.path.exists(config.sources):
            os.makedirs(config.sources)

        config.do_setup_env()
        cookbook = CookBook(config)
        recipes = self.BUILD_TOOLS
        recipes += self.PLAT_BUILD_TOOLS.get(self.config.platform, [])
        oven = Oven(recipes, cookbook)
        oven.start_cooking()
        self.config.do_setup_env()
Exemple #14
0
    def start(self):
        # Use a common prefix for the build tools for all the configurations
        # so that it can be reused
        config = Config()
        os.environ.clear()
        os.environ.update(self.config._pre_environ)
        config.prefix = self.config.build_tools_prefix
        config.load()
        config.build_tools_prefix = self.config.build_tools_prefix
        config.sources = self.config.build_tools_sources
        config.build_tools_sources = self.config.build_tools_sources
        config.cache_file = self.config.build_tools_cache
        config.build_tools_cache = self.config.build_tools_cache
        config.external_recipes = self.config.external_recipes
        config.home_dir = self.config.home_dir
        config.local_sources = self.config.local_sources
        # We use a different repo to prevent clashes between the same recipe
        # compiled with different prefixes
        config.binary_repo = self.config.binary_repo + '/build-tools'
        config.binary_repo_username = self.config.binary_repo_username
        config.binary_repo_password = self.config.binary_repo_password
        config.cache_url = self.config.cache_url

        if not os.path.exists(config.prefix):
            os.makedirs(config.prefix)
        if not os.path.exists(config.sources):
            os.makedirs(config.sources)

        config.do_setup_env()
        cookbook = CookBook(config)
        recipes = self.BUILD_TOOLS
        recipes += self.PLAT_BUILD_TOOLS.get(self.config.platform, [])
        oven = Oven(cookbook)
        ordered_recipes = cookbook.list_recipes_deps(recipes)
        oven.start_cooking(ordered_recipes, self.use_binaries,
                self.upload_binaries, self.build_missing)
        self.config.do_setup_env()
Exemple #15
0
    def start(self):
        # Use a common prefix for the build tools for all the configurations
        # so that it can be reused
        config = Config()
        os.environ.clear()
        os.environ.update(self.config._pre_environ)
        config.prefix = self.config.build_tools_prefix
        config.load()
        config.build_tools_prefix = self.config.build_tools_prefix
        config.sources = self.config.build_tools_sources
        config.build_tools_sources = self.config.build_tools_sources
        config.cache_file = self.config.build_tools_cache
        config.build_tools_cache = self.config.build_tools_cache
        config.external_recipes = self.config.external_recipes
        config.home_dir = self.config.home_dir
        config.local_sources = self.config.local_sources
        # We use a different repo to prevent clashes between the same recipe
        # compiled with different prefixes
        config.binary_repo = self.config.binary_repo + '/build-tools'
        config.binary_repo_username = self.config.binary_repo_username
        config.binary_repo_password = self.config.binary_repo_password
        config.cache_url = self.config.cache_url

        if not os.path.exists(config.prefix):
            os.makedirs(config.prefix)
        if not os.path.exists(config.sources):
            os.makedirs(config.sources)

        config.do_setup_env()
        cookbook = CookBook(config)
        recipes = self.BUILD_TOOLS
        recipes += self.PLAT_BUILD_TOOLS.get(self.config.platform, [])
        oven = Oven(cookbook)
        ordered_recipes = cookbook.list_recipes_deps(recipes)
        oven.start_cooking(ordered_recipes, self.use_binaries,
                           self.upload_binaries, self.build_missing)
        self.config.do_setup_env()
Exemple #16
0
 def start(self):
     oven = Oven(self.recipes, self.cookbook)
     oven.start_cooking()
Exemple #17
0
 def start(self, jobs=0):
     oven = Oven(self.recipes, self.cookbook, jobs=jobs)
     oven.start_cooking()
Exemple #18
0
 def start(self):
     self._setup_env()
     oven = Oven(self.recipes, self.cookbook)
     oven.start_cooking()
     self.config.do_setup_env()