Example #1
0
def tarball_name():
    arch = get_platform()
    if opt.version is not None:
        return '%s-%s-%s-%s%s' % (opt.name, opt.version, arch.machine,
                                  arch.dist_name, arch.dist_version)
    else:
        git = run('git',
                  'describe',
                  '--always',
                  '--dirty',
                  output=False,
                  raise_on_failure=False)
        if git is None: git = ''
        if len(git): git = '%s' % git.strip()
        return '%s-%s-%s%s-%s%s' % (
            opt.name, arch.machine, arch.dist_name, arch.dist_version,
            time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime()), git)
    def __init__(self, env):
        '''Construct with the environment info'''
        self.pkgname = self.__class__.__name__

        # Yes, it is possible to get a / into a class name.
        # os.path.join fails pathologically there. So catch that specific case.
        assert '/' not in self.pkgname

        self.pkgdir = P.abspath(P.dirname(inspect.getfile(self.__class__)))
        #info(self.pkgdir)
        self.tarball = None
        self.workdir = None
        self.env = copy.deepcopy(
            env)  # local copy of the environment, not affecting other packages
        self.arch = get_platform(self)

        self.env['CPPFLAGS'] = self.env.get(
            'CPPFLAGS', '') + ' -I%(INSTALL_DIR)s/include' % self.env
        self.env['CXXFLAGS'] = self.env.get(
            'CXXFLAGS', '') + ' -I%(INSTALL_DIR)s/include' % self.env
        # If we include flags to directories that don't exist, we
        # cause compiler tests to fail.
        if P.isdir(self.env['ISIS3RDPARTY']):
            self.env['LDFLAGS'] = self.env.get(
                'LDFLAGS', '') + ' -L%(ISIS3RDPARTY)s' % self.env
        if P.isdir(self.env['INSTALL_DIR'] + '/lib'):
            self.env['LDFLAGS'] = self.env.get(
                'LDFLAGS', '') + ' -L%(INSTALL_DIR)s/lib' % self.env
        if P.isdir(self.env['INSTALL_DIR'] + '/lib64'):
            self.env['LDFLAGS'] = self.env.get(
                'LDFLAGS', '') + ' -L%(INSTALL_DIR)s/lib64' % self.env

        # Remove repeated entries in CPPFLAGS, CXXFLAGS, LDFLAGS
        self.env['CPPFLAGS'] = unique_compiler_flags(self.env['CPPFLAGS'])
        self.env['CXXFLAGS'] = unique_compiler_flags(self.env['CXXFLAGS'])
        self.env['CFLAGS'] = unique_compiler_flags(self.env['CFLAGS'])
        self.env['LDFLAGS'] = unique_compiler_flags(self.env['LDFLAGS'])
Example #3
0
    installdir = P.realpath(args[0])
    if not (P.exists(installdir) and P.isdir(installdir)):
        usage('Invalid installdir %s (not a directory)' % installdir)
    if opt.isisroot is not None and not P.isdir(opt.isisroot):
        parser.print_help()
        die('\nIllegal argument to --isisroot: path does not exist')

    # Ensure installdir/bin is in the path, to be able to find chrpath, etc.
    if "PATH" not in os.environ: os.environ["PATH"] = ""
    os.environ["PATH"] = P.join(installdir,
                                'bin') + os.pathsep + os.environ["PATH"]

    logging.basicConfig(level=opt.loglevel)

    lib_ext = '.dylib'
    if get_platform().os == 'linux':
        lib_ext = '.so'

    wrapper_file = 'libexec-helper.sh'
    if (opt.vw_build):
        wrapper_file = 'libexec-helper_vw.sh'
    mgr = DistManager(tarball_name(), wrapper_file, opt.asp_deps_dir)

    try:
        INSTALLDIR = Prefix(installdir)
        ISISROOT = P.join(INSTALLDIR)
        SEARCHPATH = [
            INSTALLDIR.lib(), opt.asp_deps_dir + '/lib',
            opt.asp_deps_dir + '/x86_64-conda-linux-gnu/sysroot/usr/lib64'
        ]
        print('Search path = ' + str(SEARCHPATH))