Beispiel #1
0
 def load_defaults(self):
     self.set_property('cache_file', None)
     self.set_property('home_dir', self._default_home_dir())
     self.set_property('prefix', None)
     self.set_property('sources', None)
     self.set_property('local_sources', None)
     self.set_property('cached_sources', self._relative_path('sources'))
     self.set_property('git_root', DEFAULT_GIT_ROOT)
     self.set_property('allow_parallel_build', DEFAULT_ALLOW_PARALLEL_BUILD)
     self.set_property('host', None)
     self.set_property('build', None)
     self.set_property('target', None)
     platform, arch, distro, distro_version, num_of_cpus = system_info()
     self.set_property('platform', platform)
     self.set_property('num_of_cpus', num_of_cpus)
     self.set_property('target_platform', platform)
     self.set_property('arch', arch)
     self.set_property('target_arch', arch)
     self.set_property('distro', distro)
     self.set_property('target_distro', distro)
     self.set_property('distro_version', distro_version)
     self.set_property('target_distro_version', distro_version)
     self.set_property('packages_prefix', None)
     self.set_property('packager', DEFAULT_PACKAGER)
     self.set_property('package_tarball_compression', 'bz2')
     stdlibpath = sysconfig.get_path('stdlib', vars={'installed_base':
                                                     ''})[1:]
     # Ensure that the path uses / as path separator and not \
     self.set_property('py_prefix', PurePath(stdlibpath).as_posix())
     self.set_property('lib_suffix', '')
     self.set_property('data_dir', self._find_data_dir())
     self.set_property('environ_dir', self._relative_path('config'))
     self.set_property('recipes_dir', self._relative_path('recipes'))
     self.set_property('packages_dir', self._relative_path('packages'))
     self.set_property('allow_system_libs', True)
     self.set_property('use_configure_cache', False)
     self.set_property('external_recipes', {})
     self.set_property('external_packages', {})
     self.set_property('universal_archs', None)
     self.set_property('variants', [])
     self.set_property('build_tools_prefix', None)
     self.set_property('build_tools_sources', None)
     self.set_property('build_tools_cache', None)
     self.set_property('recipes_commits', {})
     self.set_property('recipes_remotes', {})
     self.set_property('extra_build_tools', [])
     self.set_property('distro_packages_install', True)
     self.set_property('interactive', m.console_is_interactive())
     self.set_property('meson_cross_properties', {})
     self.set_property('manifest', None)
     self.set_property('extra_properties', {})
     self.set_property('extra_mirrors', [])
     self.set_property('extra_bootstrap_packages', {})
     self.set_property('bash_completions', set())
     # Increase open-files limits
     set_nofile_ulimit()
Beispiel #2
0
 def load_defaults(self):
     self.set_property('cache_file', None)
     self.set_property('home_dir', DEFAULT_HOME)
     self.set_property('prefix', None)
     self.set_property('sources', None)
     self.set_property('local_sources', None)
     self.set_property('git_root', DEFAULT_GIT_ROOT)
     self.set_property('allow_parallel_build', DEFAULT_ALLOW_PARALLEL_BUILD)
     self.set_property('host', None)
     self.set_property('build', None)
     self.set_property('target', None)
     platform, arch, distro, distro_version, num_of_cpus = system_info()
     self.set_property('platform', platform)
     self.set_property('num_of_cpus', num_of_cpus)
     self.set_property('target_platform', platform)
     self.set_property('arch', arch)
     self.set_property('target_arch', arch)
     self.set_property('distro', distro)
     self.set_property('target_distro', distro)
     self.set_property('distro_version', distro_version)
     self.set_property('target_distro_version', distro_version)
     self.set_property('packages_prefix', None)
     self.set_property('packager', DEFAULT_PACKAGER)
     self.set_property(
         'py_prefix',
         'lib/python%s.%s' % (sys.version_info[0], sys.version_info[1]))
     self.set_property('lib_suffix', '')
     self.set_property('data_dir', self._find_data_dir())
     self.set_property('environ_dir', self._relative_path('config'))
     self.set_property('recipes_dir', self._relative_path('recipes'))
     self.set_property('packages_dir', self._relative_path('packages'))
     self.set_property('allow_system_libs', True)
     self.set_property('use_configure_cache', False)
     self.set_property('external_recipes', {})
     self.set_property('external_packages', {})
     self.set_property('universal_archs',
                       [Architecture.X86, Architecture.X86_64])
     self.set_property('variants', [])
     self.set_property('build_tools_prefix', None)
     self.set_property('build_tools_sources', None)
     self.set_property('build_tools_cache', None)
     self.set_property('recipes_commits', {})
     self.set_property('binary_commits', {})
     self.set_property('cache_url', None)
     self.set_property('extra_build_tools', [])
     self.set_property('extra_bootstrap_packages', {})
     self.set_property('ignore_runtime_deps', False)
     self.set_property('binaries', None)
     self.set_property('binary_repo', "")
     self.set_property('binary_repo_username', None)
     self.set_property('binary_repo_password', None)
     self.set_property('extra_properties', {})
Beispiel #3
0
 def load_defaults(self):
     self.set_property('cache_file', None)
     self.set_property('home_dir', DEFAULT_HOME)
     self.set_property('prefix', None)
     self.set_property('sources', None)
     self.set_property('local_sources', None)
     self.set_property('git_root', DEFAULT_GIT_ROOT)
     self.set_property('allow_parallel_build', DEFAULT_ALLOW_PARALLEL_BUILD)
     self.set_property('host', None)
     self.set_property('build', None)
     self.set_property('target', None)
     platform, arch, distro, distro_version, num_of_cpus = system_info()
     self.set_property('platform', platform)
     self.set_property('num_of_cpus', num_of_cpus)
     self.set_property('target_platform', platform)
     self.set_property('arch', arch)
     self.set_property('target_arch', arch)
     self.set_property('distro', distro)
     self.set_property('target_distro', distro)
     self.set_property('distro_version', distro_version)
     self.set_property('target_distro_version', distro_version)
     self.set_property('packages_prefix', None)
     self.set_property('packager', DEFAULT_PACKAGER)
     self.set_property('py_prefix', 'lib/python%s.%s' %
             (sys.version_info[0], sys.version_info[1]))
     self.set_property('lib_suffix', '')
     self.set_property('data_dir', self._find_data_dir())
     self.set_property('environ_dir', self._relative_path('config'))
     self.set_property('recipes_dir', self._relative_path('recipes'))
     self.set_property('packages_dir', self._relative_path('packages'))
     self.set_property('allow_system_libs', True)
     self.set_property('use_configure_cache', False)
     self.set_property('external_recipes', {})
     self.set_property('external_packages', {})
     self.set_property('universal_archs',
                       [Architecture.X86, Architecture.X86_64])
     self.set_property('variants', [])
     self.set_property('build_tools_prefix', None)
     self.set_property('build_tools_sources', None)
     self.set_property('build_tools_cache', None)
     self.set_property('recipes_commits', {})
     self.set_property('cache_url', None)
     self.set_property('extra_build_tools', [])
     self.set_property('extra_bootstrap_packages', {})
     self.set_property('ignore_runtime_deps', False)
     self.set_property('binaries', None)
     self.set_property('binary_repo', "")
     self.set_property('binary_repo_username', None)
     self.set_property('binary_repo_password', None)
     self.set_property('extra_properties', {})
 def testLoadDefaults(self):
     config = Config()
     config.load_defaults()
     platform, arch, distro, distro_version, num_of_cpus = system_info()
     data_dir = os.path.join(os.path.dirname(__file__), "..", "data")
     data_dir = os.path.abspath(data_dir)
     props = {
         "platform": platform,
         "target_platform": platform,
         "distro": distro,
         "distro_version": distro_version,
         "target_distro": distro,
         "target_distro_version": distro_version,
         "arch": arch,
         "target_arch": arch,
         "num_of_cpus": num_of_cpus,
         "host": None,
         "build": None,
         "target": None,
         "prefix": None,
         "sources": None,
         "local_sources": None,
         "min_osx_sdk_version": None,
         "lib_suffix": "",
         "cache_file": None,
         "toolchain_prefix": None,
         "install_dir": None,
         "packages_prefix": None,
         "data_dir": data_dir,
         "environ_dir": config._relative_path("config"),
         "recipes_dir": config._relative_path("recipes"),
         "packages_dir": config._relative_path("packages"),
         "git_root": cconfig.DEFAULT_GIT_ROOT,
         "wix_prefix": cconfig.DEFAULT_WIX_PREFIX,
         "packager": cconfig.DEFAULT_PACKAGER,
         "py_prefix": "lib/python%s.%s" % (sys.version_info[0], sys.version_info[1]),
         "allow_parallel_build": cconfig.DEFAULT_ALLOW_PARALLEL_BUILD,
         "use_configure_cache": False,
         "allow_system_libs": True,
         "external_packages": {},
         "external_recipes": {},
         "use_ccache": None,
         "force_git_commit": None,
         "universal_archs": [cconfig.Architecture.X86, cconfig.Architecture.X86_64],
     }
     self.assertEquals(sorted(config._properties), sorted(props.keys()))
     for p, v in props.iteritems():
         self.assertEquals(getattr(config, p), v)
Beispiel #5
0
 def load_defaults(self):
     self.set_property('cache_file', None)
     self.set_property('home_dir', self._default_home_dir())
     self.set_property('prefix', None)
     self.set_property('sources', None)
     self.set_property('local_sources', None)
     self.set_property('cached_sources', self._relative_path('sources'))
     self.set_property('git_root', DEFAULT_GIT_ROOT)
     self.set_property('allow_parallel_build', DEFAULT_ALLOW_PARALLEL_BUILD)
     self.set_property('host', None)
     self.set_property('build', None)
     self.set_property('target', None)
     platform, arch, distro, distro_version, num_of_cpus = system_info()
     self.set_property('platform', platform)
     self.set_property('num_of_cpus', num_of_cpus)
     self.set_property('target_platform', platform)
     self.set_property('arch', arch)
     self.set_property('target_arch', arch)
     self.set_property('distro', distro)
     self.set_property('target_distro', distro)
     self.set_property('distro_version', distro_version)
     self.set_property('target_distro_version', distro_version)
     self.set_property('packages_prefix', None)
     self.set_property('packager', DEFAULT_PACKAGER)
     stdlibpath = sysconfig.get_path('stdlib', vars={'installed_base': ''})
     # Ensure that the path uses / as path separator and not \
     self.set_property('py_prefix', PurePath(stdlibpath).as_posix())
     self.set_property('lib_suffix', '')
     self.set_property('data_dir', self._find_data_dir())
     self.set_property('environ_dir', self._relative_path('config'))
     self.set_property('recipes_dir', self._relative_path('recipes'))
     self.set_property('packages_dir', self._relative_path('packages'))
     self.set_property('allow_system_libs', True)
     self.set_property('use_configure_cache', False)
     self.set_property('external_recipes', {})
     self.set_property('external_packages', {})
     self.set_property('universal_archs',
                       [Architecture.X86, Architecture.X86_64])
     self.set_property('variants', [])
     self.set_property('build_tools_prefix', None)
     self.set_property('build_tools_sources', None)
     self.set_property('build_tools_cache', None)
     self.set_property('recipes_commits', {})
     self.set_property('recipes_remotes', {})
     self.set_property('extra_build_tools', {})
     self.set_property('distro_packages_install', True)
     self.set_property('interactive', True)
Beispiel #6
0
 def load_defaults(self):
     self.set_property('cache_file', None)
     self.set_property('home_dir', self._default_home_dir())
     self.set_property('prefix', None)
     self.set_property('sources', None)
     self.set_property('local_sources', None)
     self.set_property('cached_sources', self._relative_path('sources'))
     self.set_property('git_root', DEFAULT_GIT_ROOT)
     self.set_property('allow_parallel_build', DEFAULT_ALLOW_PARALLEL_BUILD)
     self.set_property('host', None)
     self.set_property('build', None)
     self.set_property('target', None)
     platform, arch, distro, distro_version, num_of_cpus = system_info()
     self.set_property('platform', platform)
     self.set_property('num_of_cpus', num_of_cpus)
     self.set_property('target_platform', platform)
     self.set_property('arch', arch)
     self.set_property('target_arch', arch)
     self.set_property('distro', distro)
     self.set_property('target_distro', distro)
     self.set_property('distro_version', distro_version)
     self.set_property('target_distro_version', distro_version)
     self.set_property('packages_prefix', None)
     self.set_property('packager', DEFAULT_PACKAGER)
     stdlibpath = sysconfig.get_path('stdlib', vars={'installed_base': ''})
     # Ensure that the path uses / as path separator and not \
     self.set_property('py_prefix', PurePath(stdlibpath).as_posix())
     self.set_property('lib_suffix', '')
     self.set_property('data_dir', self._find_data_dir())
     self.set_property('environ_dir', self._relative_path('config'))
     self.set_property('recipes_dir', self._relative_path('recipes'))
     self.set_property('packages_dir', self._relative_path('packages'))
     self.set_property('allow_system_libs', True)
     self.set_property('use_configure_cache', False)
     self.set_property('external_recipes', {})
     self.set_property('external_packages', {})
     self.set_property('universal_archs', None)
     self.set_property('variants', [])
     self.set_property('build_tools_prefix', None)
     self.set_property('build_tools_sources', None)
     self.set_property('build_tools_cache', None)
     self.set_property('recipes_commits', {})
     self.set_property('recipes_remotes', {})
     self.set_property('extra_build_tools', {})
     self.set_property('distro_packages_install', True)
     self.set_property('interactive', True)
Beispiel #7
0
import shutil
import hashlib
import urllib.request, urllib.error, urllib.parse
from distutils.version import StrictVersion

from cerbero.enums import Platform
from cerbero.utils import _, system_info, to_unixpath
from cerbero.utils import messages as m
from cerbero.errors import FatalError


PATCH = 'patch'
TAR = 'tar'


PLATFORM = system_info()[0]
LOGFILE = None  # open('/tmp/cerbero.log', 'w+')
DRY_RUN = False


def set_logfile_output(location):
    '''
    Sets a file to log

    @param location: path for the log file
    @type location: str
    '''

    global LOGFILE
    if not LOGFILE is None:
        raise Exception("Logfile was already open. Forgot to call "
Beispiel #8
0
import time
import glob
import shutil
import hashlib

from cerbero.enums import Platform
from cerbero.utils import _, system_info, to_unixpath
from cerbero.utils import messages as m
from cerbero.errors import FatalError


PATCH = 'patch'
TAR = 'tar'


PLATFORM = system_info()[0]
LOGFILE = None  # open('/tmp/cerbero.log', 'w+')
DRY_RUN = False


class StdOut:

    def __init__(self, stream=sys.stdout):
        self.stream = stream

    def write(self, data):
        self.stream.write(data)
        self.stream.flush()

    def __getattr__(self, attr):
        return getattr(self.stream, attr)
Beispiel #9
0
 def testLoadDefaults(self):
     config = Config()
     config.load_defaults()
     platform, arch, distro, distro_version, num_of_cpus = system_info()
     data_dir = os.path.join(os.path.dirname(__file__), '..', 'data')
     data_dir = os.path.abspath(data_dir)
     props = {
         'platform':
         platform,
         'target_platform':
         platform,
         'distro':
         distro,
         'distro_version':
         distro_version,
         'target_distro':
         distro,
         'target_distro_version':
         distro_version,
         'arch':
         arch,
         'target_arch':
         arch,
         'num_of_cpus':
         num_of_cpus,
         'host':
         None,
         'build':
         None,
         'target':
         None,
         'prefix':
         None,
         'sources':
         None,
         'local_sources':
         None,
         'min_osx_sdk_version':
         None,
         'lib_suffix':
         '',
         'cache_file':
         None,
         'toolchain_prefix':
         None,
         'install_dir':
         None,
         'packages_prefix':
         None,
         'data_dir':
         data_dir,
         'environ_dir':
         config._relative_path('config'),
         'recipes_dir':
         config._relative_path('recipes'),
         'packages_dir':
         config._relative_path('packages'),
         'git_root':
         cconfig.DEFAULT_GIT_ROOT,
         'wix_prefix':
         cconfig.DEFAULT_WIX_PREFIX,
         'packager':
         cconfig.DEFAULT_PACKAGER,
         'py_prefix':
         'lib/python%s.%s' % (sys.version_info[0], sys.version_info[1]),
         'allow_parallel_build':
         cconfig.DEFAULT_ALLOW_PARALLEL_BUILD,
         'use_configure_cache':
         False,
         'allow_system_libs':
         True,
         'external_packages': {},
         'external_recipes': {},
         'use_ccache':
         None,
         'force_git_commit':
         None,
         'universal_archs':
         [cconfig.Architecture.X86, cconfig.Architecture.X86_64],
     }
     self.assertEquals(sorted(config._properties), sorted(props.keys()))
     for p, v in props.iteritems():
         self.assertEquals(getattr(config, p), v)