Пример #1
0
def build(module_params):
    fs.remove("log")
    fs.remove("temp")
    shasums_url = "https://nodejs.org/dist/latest/SHASUMS256.txt"
    path_to_shasums = net.download_file(shasums_url)
    with open(path_to_shasums) as shasums_file:
        line = shasums_file.readline()
        match = re.search("node-v((\d.?)+?)-", line)
        latest_version = match.group(1)
        node_archive = net.download_file("https://nodejs.org/dist/latest/node-v{0}.tar.gz".format(latest_version))
        archives.extract_tar(node_archive, "temp")
        fs.rename("./temp/node-*", "./temp/node_src", True)
        assembly.configure("temp/node_src/", {}, [])
        try:
            assembly.make("temp/node_src/")
        except Exception as e:
            exc_type, exc_obj, exc_tb = sys.exc_info()
            fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
            print("Error while building nginx: '{0}' in {1}:{2} ".format(e, fname, exc_tb.tb_lineno), file=sys.stderr)
            print("Make log: ", os.path.abspath('log/make.txt'))
            sys.exit(1)
        try:
            assembly.make_install("temp/node_src/")
        except Exception as e:
            exc_type, exc_obj, exc_tb = sys.exc_info()
            fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
            print("Error while building nginx: '{0}' in {1}:{2} ".format(e, fname, exc_tb.tb_lineno), file=sys.stderr)
            print("Make log: ", os.path.abspath('log/make_install.txt'))
            sys.exit(1)
    fs.remove("temp")
Пример #2
0
def build(module_params):
    check_dependencies(False, ['version'], module_params)
    fs.remove(origin_dir)
    sqlite_url = 'http://www.sqlite.org/2015/sqlite-amalgamation-{0}.zip'.format(module_params['version'])
    net.download_file(sqlite_url, archive_path)
    archives.extract_zip(archive_path)
    fs.remove(archive_path)
    fs.rename('sqlite-amalgamation*', origin_dir, True)
    create_and_run_cmake_file(origin_dir, 'x86')
    create_and_run_cmake_file(origin_dir, 'x64')
    if is_windows():
        assembly.build_vcxproj(os.path.abspath(os.path.join(origin_dir, 'sqlite_x86', 'sqlite_x86.vcxproj')),
                               lib_directory, ('Debug', 'Release'))
        assembly.build_vcxproj(os.path.abspath(os.path.join(origin_dir, 'sqlite_x64', 'sqlite_x64.vcxproj')),
                               lib_directory, ('Debug', 'Release'))

    fs.move_files_to_dir_by_mask(os.path.join(origin_dir, '*.h'), headers_dir, True)
    fs.clear(origin_dir, cleanup_extensions['c++'])
Пример #3
0
def build(module_params):
    check_dependencies(False, ['version'], module_params)
    fs.remove(origin_dir)
    sqlite_url = 'http://www.sqlite.org/2015/sqlite-amalgamation-{0}.zip'.format(
        module_params['version'])
    net.download_file(sqlite_url, archive_path)
    archives.extract_zip(archive_path)
    fs.remove(archive_path)
    fs.rename('sqlite-amalgamation*', origin_dir, True)
    create_and_run_cmake_file(origin_dir, 'x86')
    create_and_run_cmake_file(origin_dir, 'x64')
    if is_windows():
        assembly.build_vcxproj(
            os.path.abspath(
                os.path.join(origin_dir, 'sqlite_x86', 'sqlite_x86.vcxproj')),
            lib_directory, ('Debug', 'Release'))
        assembly.build_vcxproj(
            os.path.abspath(
                os.path.join(origin_dir, 'sqlite_x64', 'sqlite_x64.vcxproj')),
            lib_directory, ('Debug', 'Release'))

    fs.move_files_to_dir_by_mask(os.path.join(origin_dir, '*.h'), headers_dir,
                                 True)
    fs.clear(origin_dir, cleanup_extensions['c++'])
Пример #4
0
def download_zlib(version):
    pcreLoc = net.download_file("http://zlib.net/zlib-{0}.tar.gz".format(version))
    archives.extract_tar(pcreLoc, "temp")
    fs.rename("temp/zlib-*", "temp/zlib", True)
Пример #5
0
def download_pcre(version):
    pcreLoc = net.download_file(
        "http://sourceforge.net/projects/pcre/files/pcre/{0}/pcre-{0}.tar.gz/download".format(version))
    archives.extract_tar(pcreLoc, "temp")
    fs.rename("temp/pcre-*", "temp/pcre", True)
Пример #6
0
def download_nginx(version):
    archiveLoc = net.download_file(
        "http://nginx.org/download/nginx-{0}.tar.gz".format(version))
    archives.extract_tar(archiveLoc, "temp")
    fs.rename("temp/nginx-*", "temp/nginx", True)
Пример #7
0
def download_openssl(version):
    opensslUrl = "ftp://ftp.openssl.org/source/openssl-{0}.tar.gz".format(
        version)
    opensslPath = net.download_file(opensslUrl)
    archives.extract_tar(opensslPath, "temp")
    fs.rename("temp/openssl-*", "temp/openssl", True)
Пример #8
0
def download_nginx(version):
    archiveLoc = net.download_file("http://nginx.org/download/nginx-{0}.tar.gz".format(version))
    archives.extract_tar(archiveLoc, "temp")
    fs.rename("temp/nginx-*", "temp/nginx", True)
Пример #9
0
def download_openssl(version):
    opensslUrl = "ftp://ftp.openssl.org/source/openssl-{0}.tar.gz".format(version)
    opensslPath= net.download_file(opensslUrl)
    archives.extract_tar(opensslPath, "temp")
    fs.rename("temp/openssl-*", "temp/openssl", True)