예제 #1
0
 def source(self):
     zip_name = "bzip2-%s.tar.gz" % self.version
     tools.download("http://www.bzip.org/%s/%s" % (self.version, zip_name),
                    zip_name)
     tools.check_md5(zip_name, "00b516f4704d4a7cb50a1d97e6e8e15b")
     tools.unzip(zip_name)
     os.unlink(zip_name)
예제 #2
0
    def source(self):
        zip_name = "%s.tar.gz" % self.version
        tools.download("https://github.com/grpc/grpc/archive/v%s" % zip_name, zip_name)
        tools.check_md5(zip_name, "c6fc06d80ffd9c2ab903764bf69f4606")
        tools.unzip(zip_name)
        os.unlink(zip_name)
        with tools.chdir(self.zip_folder_name):
            tools.replace_in_file("CMakeLists.txt", "project(${PACKAGE_NAME} C CXX)", 
                '''project(${PACKAGE_NAME} C CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()''')
            tools.replace_in_file("CMakeLists.txt", "include(cmake/benchmark.cmake)", "")
            tools.replace_in_file("CMakeLists.txt", "add_executable(check_epollexclusive", "add_executable(check_epollexclusive EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "add_executable(gen_hpack_tables", "add_executable(gen_hpack_tables EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "add_executable(gen_legal_metadata_characters", "add_executable(gen_legal_metadata_characters EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "add_executable(gen_percent_encoding_tables", "add_executable(gen_percent_encoding_tables EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "add_executable(grpc_create_jwt", "add_executable(grpc_create_jwt EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "add_executable(grpc_print_google_default_creds_token", "add_executable(grpc_print_google_default_creds_token EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "add_executable(grpc_verify_jwt", "add_executable(grpc_verify_jwt EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "add_library(grpc_csharp_ext SHARED", "add_library(grpc_csharp_ext SHARED EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "add_executable(grpc_csharp_plugin", "add_executable(grpc_csharp_plugin EXCLUDE_FROM_ALL")
            # tools.replace_in_file("CMakeLists.txt", "add_executable(grpc_node_plugin", "add_executable(grpc_node_plugin EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "add_executable(grpc_objective_c_plugin", "add_executable(grpc_objective_c_plugin EXCLUDE_FROM_ALL")
            # tools.replace_in_file("CMakeLists.txt", "add_executable(grpc_php_plugin", "add_executable(grpc_php_plugin EXCLUDE_FROM_ALL")
            # tools.replace_in_file("CMakeLists.txt", "add_executable(grpc_python_plugin", "add_executable(grpc_python_plugin EXCLUDE_FROM_ALL")
            # tools.replace_in_file("CMakeLists.txt", "add_executable(grpc_ruby_plugin", "add_executable(grpc_ruby_plugin EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "add_library(grpc_csharp_ext SHARED", "add_library(grpc_csharp_ext SHARED EXCLUDE_FROM_ALL")
            tools.replace_in_file("CMakeLists.txt", "install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/etc/roots.pem", '''export(TARGETS %s NAMESPACE gRPC:: FILE gRPCTargets.cmake)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/etc/roots.pem''' % ' '.join([
    'address_sorting', 'gpr',
    'grpc', 'grpc_cronet', 'grpc_unsecure', 
    'grpc++', 'grpc++_cronet', 'grpc++_error_details', 'grpc++_reflection', 'grpc++_unsecure', 'grpc_plugin_support',
    'grpc_cpp_plugin',
    'grpc_node_plugin', 'grpc_php_plugin', 'grpc_python_plugin', 'grpc_ruby_plugin',
]))
예제 #3
0
    def md5_test(self):
        folder = temp_folder()
        filepath = os.path.join(folder, "file.txt")
        file_content = "a file"
        save(filepath, file_content)

        check_md5(filepath, "d6d0c756fb8abfb33e652a20e85b70bc")
        check_sha1(filepath, "eb599ec83d383f0f25691c184f656d40384f9435")
        check_sha256(
            filepath,
            "7365d029861e32c521f8089b00a6fb32daf0615025b69b599d1ce53501b845c2")

        with self.assertRaisesRegexp(
                ConanException,
                "md5 signature failed for 'file.txt' file. Computed signature:"
        ):
            check_md5(filepath, "invalid")

        with self.assertRaisesRegexp(
                ConanException,
                "sha1 signature failed for 'file.txt' file. Computed signature:"
        ):
            check_sha1(filepath, "invalid")

        with self.assertRaisesRegexp(
                ConanException,
                "sha256 signature failed for 'file.txt' file. Computed signature:"
        ):
            check_sha256(filepath, "invalid")
예제 #4
0
    def source(self):
        archive_ext = 'tar.gz'
        archive_name = f'pcl-pcl-{self.version}'
        archive_file = f'{archive_name}.{archive_ext}'

        from source_cache import copyFromCache
        if copyFromCache(archive_file):
            tools.unzip(archive_file)
            shutil.move(archive_name, self.name)
        else:
            try:
                if not os.path.exists(archive_file):
                    # Sometimes the file can already exist
                    tools.download(
                        url=f'https://github.com/PointCloudLibrary/pcl/archive/{archive_file}',
                        filename=archive_file
                    )
                    tools.check_md5(archive_file, self.md5_hash)
                tools.unzip(archive_file)
                shutil.move(archive_name, self.name)
            except ConanException as e:
                self.output.warn('Received exception while downloding PCL archive.  Attempting to clone from source. Exception = %s'%e)
                self.run(f'git clone https://github.com/PointCloudLibrary/pcl.git {self.name}')
                self.run(f'cd {self.name} && git checkout pcl-{self.version}')

        if self.settings.compiler == 'gcc':
            import cmake_helpers
            cmake_helpers.wrapCMakeFile(os.path.join(self.source_folder, self.name), output_func=self.output.info)

        patch_files = glob.glob('patches/*')
        for patch_file in patch_files:
            self.output.info(f'Applying patch {patch_file}')
            tools.patch(patch_file=patch_file, base_path='pcl')
예제 #5
0
 def source(self):
     zip_name = "libmicrohttpd-%s.tar.gz" % self.version
     download("http://ftp.gnu.org/gnu/libmicrohttpd/%s" % zip_name,
              zip_name)
     check_md5(zip_name, "452f6a4cef08f23f88915b86bde4d9d6")
     unzip(zip_name)
     os.unlink(zip_name)
예제 #6
0
 def source(self):
     archive = 'mpfr-{version}.tar.gz'.format(version=self.version)
     tools.download('http://www.mpfr.org/mpfr-current/{archive}'.format(archive=archive), archive)
     tools.check_md5(archive, self.md5hash)
     tools.unzip(archive)
     shutil.move('mpfr-{version}'.format(version=self.version), self.name)
     os.unlink(archive)
예제 #7
0
 def source(self):
     zip_name = "bzip2-%s.tar.gz" % self.version
     # url = "http://www.bzip.org/%s/%s" % (self.version, zip_name)
     url = "https://bintray.com/conan/Sources/download_file?file_path=%s" % zip_name
     tools.download(url, zip_name)
     tools.check_md5(zip_name, "00b516f4704d4a7cb50a1d97e6e8e15b")
     tools.unzip(zip_name)
     os.unlink(zip_name)
예제 #8
0
 def source(self):
     zip_name = "python3.6.1-release.zip"
     download("https://github.com/python/cpython/archive/v3.6.1.zip",
              zip_name)
     check_md5(zip_name, "6ac7748627c88978ca7a30a0a310a553")
     unzip(zip_name)
     shutil.move("cpython-3.6.1", self.name)
     os.unlink(zip_name)
예제 #9
0
 def source(self):
     zip_name = "python2.7.13-release.zip"
     download("https://github.com/python/cpython/archive/v2.7.13.zip",
              zip_name)
     check_md5(zip_name, "c31795e30d95b082627aaa9368fe65fc")
     unzip(zip_name)
     shutil.move("cpython-2.7.13", self.name)
     os.unlink(zip_name)
예제 #10
0
 def source(self):
     tar_name = "v%s.tar.gz" % self.version
     tools.download(
         "https://github.com/mfontanini/libtins/archive/%s" % tar_name,
         tar_name)
     tools.check_md5(tar_name, "be029088c9fc8dc979022410b49a8e61")
     tools.unzip(tar_name)
     os.unlink(tar_name)
예제 #11
0
 def source(self):
     zip_name = "gnutls-%s.tar.gz" % self.version
     # download("http://ftp.heanet.ie/mirrors/ftp.gnupg.org/gcrypt/gnutls/v3.4/%s" % zip_name, zip_name)
     download(
         "https://www.dropbox.com/s/njds242a0mk62wu/%s?dl=1" % zip_name,
         zip_name)
     check_md5(zip_name, "b4b58ca69bf58029553e0e3eac09f5b9")
     unzip(zip_name)
     os.unlink(zip_name)
예제 #12
0
 def source(self):
     zip_name = "gnutls-%s.tar.gz" % self.version
     # download("http://ftp.heanet.ie/mirrors/ftp.gnupg.org/gcrypt/gnutls/v3.4/%s" % zip_name, zip_name)
     download(
         "https://www.dropbox.com/s/7h0a0b0gfmkjp42/%s?dl=1" % zip_name,
         zip_name)
     check_md5(zip_name, "093777651b9cb41f66122991c5bf3d42")
     unzip(zip_name)
     os.unlink(zip_name)
예제 #13
0
    def source(self):
        targzfile = '%s.tar.gz' % self.ZIP_FOLDER_NAME
        tools.download("http://www.fftw.org/fftw-%s.tar.gz" % self.version, targzfile)
        tools.check_md5(targzfile, "2edab8c06b24feeb3b82bbb3ebf3e7b3")
        tools.untargz(targzfile)
        os.unlink(targzfile)

        shutil.move("CMakeLists.txt", self.ZIP_FOLDER_NAME)
        shutil.move("config.h.cmake", self.ZIP_FOLDER_NAME)
        shutil.move("config.h.cmaketemplate", self.ZIP_FOLDER_NAME)
예제 #14
0
    def source(self):
        zip_name = "libzippp-v%s-%s.tar.gz" % (self.version,
                                               self.libzip_version)
        tools.download(
            "https://github.com/ctabin/libzippp/archive/" + zip_name, zip_name)
        tools.check_md5(zip_name, "f1ff080f075f89d7f00346b392393597")
        tools.unzip(zip_name)
        os.unlink(zip_name)

        shutil.copy("CMakeLists.txt", self.zip_folder_name)
예제 #15
0
    def source(self):
        zip_name = "%s.tar.gz" % self.version
        tools.download("https://github.com/google/benchmark/archive/v%s" % zip_name, zip_name)
        tools.check_md5(zip_name, "482dddb22bec43f5507a000456d6bb88")
        tools.unzip(zip_name)
        os.unlink(zip_name)
        with tools.chdir(self.zip_folder_name):
            tools.replace_in_file('CMakeLists.txt', 'project (benchmark)', '''project (benchmark)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()''')
예제 #16
0
    def source(self):
        zip_name = "v%s.tar.gz" % self.version
        tools.download("https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/%s" % zip_name, zip_name)
        tools.check_md5(zip_name, "f5e8548bebcc076831eaa4c06c271d3d")
        tools.unzip(zip_name)
        os.unlink(zip_name)

        with tools.chdir(self.zip_folder_name):
            tools.replace_in_file("CMakeLists.txt", "project(amqpcpp)", '''project(amqpcpp)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()''')
예제 #17
0
파일: conanfile.py 프로젝트: CGAL/conan-gmp
 def source(self):
     zip_name = 'gmp-{version}.tar.bz2'.format(version=self.version)
     tools.download(
         'http://gnu.uberglobalmirror.com/gmp/{zip_name}'.format(
             zip_name=zip_name), zip_name)
     # Alternative
     # tools.download(f'http://gmplib.org/download/gmp/{zip_name}', zip_name)
     tools.check_md5(zip_name, self.md5_hash)
     tools.unzip(zip_name)
     shutil.move('gmp-{version}'.format(version=self.version), 'gmp')
     os.unlink(zip_name)
예제 #18
0
 def source(self):
     source_tgz = "http://fltk.org/pub/fltk/1.3.4/fltk-" + self.version + "-source.tar.gz"
     self.output.info("Downloading %s" % source_tgz)
     src_file_name = "fltk.tar.gz"
     tools.download(source_tgz, src_file_name)
     tools.check_md5(src_file_name, "ce21e095cf258c8bc62ce6bb605ef813")
     tools.unzip(src_file_name, ".")
     os.rename("fltk-" + self.version, "fltk")
     os.remove(src_file_name)
     shutil.move("fltk/CMakeLists.txt", "fltk/CMakeListsOriginal.cmake")
     shutil.move("CMakeLists.txt", "fltk/CMakeLists.txt")
예제 #19
0
    def source(self):
        targzfile = '%s.tar.gz' % self.ZIP_FOLDER_NAME
        tools.download("http://www.fftw.org/fftw-%s.tar.gz" % self.version,
                       targzfile)
        tools.check_md5(targzfile, "2edab8c06b24feeb3b82bbb3ebf3e7b3")
        tools.untargz(targzfile)
        os.unlink(targzfile)

        shutil.move("CMakeLists.txt", self.ZIP_FOLDER_NAME)
        shutil.move("config.h.cmake", self.ZIP_FOLDER_NAME)
        shutil.move("config.h.cmaketemplate", self.ZIP_FOLDER_NAME)
예제 #20
0
    def source(self):
        archive = 'scons-%s'%self.version
        archive_file = '%s.tar.gz'%archive
        url = 'http://prdownloads.sourceforge.net/scons/%s'%archive_file

        from source_cache import copyFromCache
        if not copyFromCache(archive_file):
            tools.download(url=url, filename=archive_file)
            tools.check_md5(archive_file, self.md5_hash)
        tools.unzip(archive_file)
        shutil.move(archive, self.name)
        os.remove(archive_file)
예제 #21
0
    def _confirm_valid_gzip_file_or_download(self, folder):
        gzip_path = self._get_gzip_path(folder)
        if os.path.exists(gzip_path):
            try:
                tools.check_md5(gzip_path, self._md5_sum)
                return gzip_path
            except BaseException:
                os.remove(gzip_path)

        tools.download(self._url, gzip_path)
        tools.check_md5(gzip_path, self._md5_sum)
        return gzip_path
예제 #22
0
    def source(self):
        archive = 'mesa-18.%s' % self.version
        archive_file = '%s.tar.xz' % archive
        url = 'https://mesa.freedesktop.org/archive/%s' % archive_file

        from source_cache import copyFromCache
        if not copyFromCache(archive_file):
            tools.download(url=url, filename=archive_file)
            tools.check_md5(archive_file, self.md5_hash)
        tools.unzip(archive_file)
        shutil.move(archive, self.name)
        os.remove(archive_file)
예제 #23
0
    def source(self):
        zip_name = "bzip2-%s.tar.gz" % self.version
        tools.download("http://www.bzip.org/%s/%s" % (self.version, zip_name),
                       zip_name,
                       verify=False)
        tools.check_md5(zip_name, "00b516f4704d4a7cb50a1d97e6e8e15b")
        tools.unzip(zip_name)
        os.unlink(zip_name)

        # Prepare for CMake
        shutil.move("CMakeLists.txt",
                    "%s/CMakeLists.txt" % self.zip_folder_name)
        tools.patch(patch_file="patches/bzip2-1.0.6_modern_cmake_build.patch")
예제 #24
0
    def source(self):
        # Found this at https://01.org/linuxgraphics/downloads/2017q1-intel-graphics-stack-recipe
        archive = 'libdrm-%s' % self.version
        archive_file = '%s.tar.gz' % archive
        url = 'http://dri.freedesktop.org/libdrm/%s' % archive_file

        from source_cache import copyFromCache
        if not copyFromCache(archive_file):
            tools.download(url=url, filename=archive_file)
            tools.check_md5(archive_file, self.md5_hash)
        tools.unzip(archive_file)
        shutil.move(archive, self.name)
        os.remove(archive_file)
예제 #25
0
    def source(self):
        if self.settings.os != "Windows": # wraps winiconv for windows
            zip_name = "libiconv-%s.tar.gz" % self.version
            download("http://ftp.gnu.org/pub/gnu/libiconv/%s" % zip_name, zip_name)
            check_md5(zip_name, "e34509b1623cec449dfeb73d7ce9c6c6")
            unzip(zip_name)
            os.unlink(zip_name)
            if self.settings.os == "Linux":
	        text_to_replace = '_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");'
                replaced_text = '''#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
    _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
    #endif'''
                replace_in_file(os.path.join(self.ZIP_FOLDER_NAME, "srclib", "stdio.in.h"), text_to_replace, replaced_text)
예제 #26
0
    def source(self):
        zip_name = self.zip_folder_name + ".tar.xz"
        tools.download("https://dist.libuv.org/dist/v%(version)s/libuv-v%(version)s.tar.gz" % {'version': self.version},
                       zip_name)
        tools.check_md5(zip_name, "e3202bd420e0740d6809df042cccd9f9")
        tools.unzip(zip_name)
        os.unlink(zip_name)

        with tools.chdir(self.zip_folder_name):
            tools.replace_in_file("CMakeLists.txt", "project(libuv)",
                                  '''project(libuv C)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()''')
            tools.replace_in_file("CMakeLists.txt", "if(UNIX)", "if(FALSE)")
예제 #27
0
 def source(self):
     zip_name = "vma-2.3.0.zip"
     tools.download(
         "https://codeload.github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/zip/v2.3.0",
         zip_name)
     tools.check_md5(zip_name, "4EBE3957D75931D8945FC77A91EE4445")
     os.mkdir("include")
     os.mkdir("licenses")
     tools.unzip(zip_name)
     shutil.move("VulkanMemoryAllocator-2.3.0/src/vk_mem_alloc.h",
                 "include")
     shutil.move("VulkanMemoryAllocator-2.3.0/LICENSE.txt", "licenses")
     shutil.rmtree("VulkanMemoryAllocator-2.3.0")
     os.unlink(zip_name)
예제 #28
0
    def _source_linux(self):
        archive = 'SuiteSparse-%s.tar.gz'%self.version

        from source_cache import copyFromCache
        if not copyFromCache(archive):
            tools.download('http://faculty.cse.tamu.edu/davis/SuiteSparse/%s'%archive, archive)
        tools.check_md5(archive, self.md5_hash)

        tools.unzip(archive)

        if 'openblas' in self.deps_cpp_info.deps:
            # LDFLAGS isn't used prevasively enough, so we need to hack the Makefile.
            tools.replace_in_file(
                file_path='SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk',
                search='BLAS = -lopenblas',
                replace='BLAS = -L%s -lopenblas'%(self.deps_cpp_info['openblas'].rootpath + '/lib'),
            )
예제 #29
0
    def source(self):
        zip_name = self.zip_folder_name + ".tar.gz"
        tools.download("https://libzip.org/download/" + zip_name, zip_name)
        tools.check_md5(zip_name, "ca72a4c93bef1595e5ff45eaf534d4da")
        tools.unzip(zip_name)
        os.unlink(zip_name)

        with tools.chdir(self.zip_folder_name):
            tools.replace_in_file(
                "CMakeLists.txt", "PROJECT(libzip C)", '''PROJECT(libzip C)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()''')
            tools.replace_in_file("CMakeLists.txt", "ADD_SUBDIRECTORY(man)",
                                  "")
            tools.replace_in_file("CMakeLists.txt",
                                  "ADD_SUBDIRECTORY(regress)", "")
            tools.replace_in_file("CMakeLists.txt",
                                  "ADD_SUBDIRECTORY(examples)", "")
예제 #30
0
    def md5_test(self):
        folder = temp_folder()
        filepath = os.path.join(folder, "file.txt")
        file_content = "a file"
        save(filepath, file_content)

        check_md5(filepath, "d6d0c756fb8abfb33e652a20e85b70bc")
        check_sha1(filepath, "eb599ec83d383f0f25691c184f656d40384f9435")
        check_sha256(filepath, "7365d029861e32c521f8089b00a6fb32daf0615025b69b599d1ce53501b845c2")

        with self.assertRaisesRegexp(ConanException, "md5 signature failed for 'file.txt' file."):
            check_md5(filepath, "invalid")

        with self.assertRaisesRegexp(ConanException, "sha1 signature failed for 'file.txt' file."):
            check_sha1(filepath, "invalid")

        with self.assertRaisesRegexp(ConanException, "sha256 signature failed for 'file.txt' file."):
            check_sha256(filepath, "invalid")
예제 #31
0
    def source(self):
        zip_name = "%s.tar.gz" % self.version
        tools.download("https://github.com/whoshuu/cpr/archive/%s" % zip_name,
                       zip_name)
        tools.check_md5(zip_name, "f9df0c649208b06dd314699b4eb43759")
        tools.unzip(zip_name)
        os.unlink(zip_name)
        with tools.chdir(self.zip_folder_name):
            tools.replace_in_file(
                'CMakeLists.txt', 'project(cpr)', '''project(cpr)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()''')
            tools.replace_in_file('CMakeLists.txt', 'add_subdirectory(opt)',
                                  '')
            #tools.replace_in_file('cpr/CMakeLists.txt', 'add_library(${CPR_LIBRARIES}', 'add_library(${CPR_LIBRARIES} STATIC')
            tools.replace_in_file('cpr/CMakeLists.txt', '${CURL_INCLUDE_DIRS}',
                                  '${CONAN_INCLUDE_DIRS_LIBCURL}')
            tools.replace_in_file('cpr/CMakeLists.txt', '${CURL_LIBRARIES}',
                                  '${CONAN_LIBS_LIBCURL}')
예제 #32
0
    def source(self):
        zip_name = "v%s.tar.gz" % self.version
        tools.download(
            "https://github.com/muflihun/easyloggingpp/archive/%s" % zip_name,
            zip_name)
        tools.check_md5(zip_name, "f9a18180fa0842e8744749a4fe3e3ce9")
        tools.unzip(zip_name)
        os.unlink(zip_name)

        with tools.chdir(self.zip_folder_name):
            tools.replace_in_file(
                "CMakeLists.txt", "project(Easyloggingpp CXX)",
                '''project(Easyloggingpp CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()''')
            tools.replace_in_file(
                "CMakeLists.txt",
                "add_library(easyloggingpp STATIC src/easylogging++.cc)",
                '''add_library(easyloggingpp STATIC src/easylogging++.cc)
add_definitions(-DELPP_NO_DEFAULT_LOG_FILE)''')