Esempio n. 1
0
def download_llvm_sources():
    tar = get_cmd_or_die("tar")

    # make sure we have the gpg public key installed first
    install_sig(c.LLVM_PUBKEY)

    with pb.local.cwd(c.BUILD_DIR):
        # download archives and signatures
        for (aurl, asig, afile,
             _) in zip(c.LLVM_ARCHIVE_URLS, c.LLVM_SIGNATURE_URLS,
                       c.LLVM_ARCHIVE_FILES, c.LLVM_ARCHIVE_DIRS):

            # download archive + signature
            download_archive(aurl, afile, asig)

    # first extract llvm archive
    if not os.path.isdir(c.LLVM_SRC):
        logging.info("extracting %s", c.LLVM_ARCHIVE_FILES[0])
        tar("xf", c.LLVM_ARCHIVE_FILES[0])
        os.rename(c.LLVM_ARCHIVE_DIRS[0], c.LLVM_SRC)

    # then clang front end
    with pb.local.cwd(os.path.join(c.LLVM_SRC, "tools")):
        if not os.path.isdir("clang"):
            logging.info("extracting %s", c.LLVM_ARCHIVE_FILES[1])
            tar("xf", os.path.join(c.ROOT_DIR, c.LLVM_ARCHIVE_FILES[1]))
            os.rename(c.LLVM_ARCHIVE_DIRS[1], "clang")

        with pb.local.cwd("clang/tools"):
            if not os.path.isdir("extra"):
                logging.info("extracting %s", c.LLVM_ARCHIVE_FILES[2])
                tar("xf", os.path.join(c.ROOT_DIR, c.LLVM_ARCHIVE_FILES[2]))
                os.rename(c.LLVM_ARCHIVE_DIRS[2], "extra")
Esempio n. 2
0
def download_llvm_sources():
    tar = get_cmd_or_die("tar")

    if not c.LLVM_SKIP_SIGNATURE_CHECKS:
        # make sure we have the gpg public key installed first
        install_sig(c.LLVM_PUBKEY)

    with pb.local.cwd(c.BUILD_DIR):
        # download archives and signatures
        for (aurl, asig, afile, _) in zip(
                c.LLVM_ARCHIVE_URLS,
                c.LLVM_SIGNATURE_URLS,
                c.LLVM_ARCHIVE_FILES,
                c.LLVM_ARCHIVE_DIRS):

            if c.LLVM_SKIP_SIGNATURE_CHECKS:
                asig = None
            # download archive and (by default) its signature
            download_archive(aurl, afile, asig)

    # first extract llvm archive,
    if not os.path.isdir(c.LLVM_SRC):
        logging.info("extracting %s", c.LLVM_ARCHIVE_FILES[0])
        tar("xf", c.LLVM_ARCHIVE_FILES[0])
        os.rename(c.LLVM_ARCHIVE_DIRS[0], c.LLVM_SRC)

    # then compiler-rt,
    with pb.local.cwd(os.path.join(c.LLVM_SRC, "projects")):
        if not os.path.isdir("compiler-rt"):
            logging.info("extracting %s", c.LLVM_ARCHIVE_FILES[2])
            tar("xf", os.path.join(c.ROOT_DIR, c.LLVM_ARCHIVE_FILES[2]))
            os.rename(c.LLVM_ARCHIVE_DIRS[2], "compiler-rt")

    # finally clang, and clang-tools-extra.
    with pb.local.cwd(os.path.join(c.LLVM_SRC, "tools")):
        if not os.path.isdir("clang"):
            logging.info("extracting %s", c.LLVM_ARCHIVE_FILES[1])
            tar("xf", os.path.join(c.ROOT_DIR, c.LLVM_ARCHIVE_FILES[1]))
            os.rename(c.LLVM_ARCHIVE_DIRS[1], "clang")