示例#1
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')
示例#2
0
    def source(self):
        zip_name = "bzip2-%s.tar.gz" % self.version

        from source_cache import copyFromCache
        if not copyFromCache(zip_name):
            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)
示例#3
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)
示例#4
0
    def source(self):
        zip_name = 'gmp-{version}.tar.bz2'.format(version=self.version)

        from source_cache import copyFromCache
        if not copyFromCache(zip_name):
            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)
示例#5
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)
示例#6
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)
示例#7
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'),
            )