示例#1
0
def build(dep, args, dest_dir):
    set_title('Building ' + dep)
    owd = os.getcwdu()
    set_current_source(filename_for_dep(dep))
    output_dir = todir = mkdtemp(prefix=dep + '-')
    set_build_dir(output_dir)
    try:
        m = importlib.import_module('pkgs.' + dep)
    except ImportError:
        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), dep + '.py')):
            raise
        m = None
    tsdir = extract_source()
    try:
        if hasattr(m, 'main'):
            m.main(args)
        else:
            simple_build()
        if isosx:
            fix_install_names(m, output_dir)
    except Exception:
        import traceback
        traceback.print_exc()
        print('\nDropping you into a shell')
        sys.stdout.flush(), sys.stderr.flush()
        run_shell()
        raise SystemExit(1)
    create_package(m, output_dir, pkg_path(dep))
    install_package(pkg_path(dep), dest_dir)
    if hasattr(m, 'post_install_check'):
        m.post_install_check()
    os.chdir(owd)
    rmtree(todir)
    rmtree(tsdir)
示例#2
0
def install_pkgs(other_deps=all_deps, dest_dir=PREFIX):
    other_deps = tuple(other_deps)
    if other_deps:
        print('Installing %d previously compiled packages:' % len(other_deps), end=' ')
        sys.stdout.flush()
        for dep in other_deps:
            pkg = pkg_path(dep)
            if os.path.exists(pkg):
                print(dep, end=', ')
                sys.stdout.flush()
                install_package(pkg, dest_dir)
        print()
        sys.stdout.flush()
示例#3
0
def install_pkgs(other_deps=all_deps, dest_dir=PREFIX):
    other_deps = tuple(other_deps)
    if other_deps:
        print('Installing %d previously compiled packages:' % len(other_deps), end=' ')
        sys.stdout.flush()
        for dep in other_deps:
            pkg = pkg_path(dep)
            if os.path.exists(pkg):
                print(dep, end=', ')
                sys.stdout.flush()
                install_package(pkg, dest_dir)
        print()
        sys.stdout.flush()
示例#4
0
def build(dep, args, dest_dir):
    set_title('Building ' + dep)
    owd = os.getcwdu()
    set_current_source(filename_for_dep(dep))
    output_dir = todir = mkdtemp(prefix=dep + '-')
    set_build_dir(output_dir)
    idep = dep.replace('-', '_')
    try:
        m = importlib.import_module('pkgs.' + idep)
    except ImportError:
        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), idep + '.py')):
            raise
        m = None
    tsdir = extract_source()
    try:
        if hasattr(m, 'main'):
            m.main(args)
        else:
            if dep in python_deps:
                python_build()
                output_dir = os.path.join(output_dir, os.path.basename(SW), os.path.basename(PREFIX))
            else:
                simple_build()
        if isosx:
            fix_install_names(m, output_dir)
    except Exception:
        import traceback
        traceback.print_exc()
        print('\nDropping you into a shell')
        sys.stdout.flush(), sys.stderr.flush()
        run_shell()
        raise SystemExit(1)
    create_package(m, output_dir, pkg_path(dep))
    install_package(pkg_path(dep), dest_dir)
    if hasattr(m, 'post_install_check'):
        m.post_install_check()
    os.chdir(owd)
    rmtree(todir)
    rmtree(tsdir)