easyblock = 'CMakeMake'

name = 'ecCodes'
version = '2.19.1'
versionsuffix = '-Python-3.8.6'

homepage = 'https://software.ecmwf.int/wiki/display/ECC/ecCodes+Home'
description = """ecCodes is a package developed by ECMWF which provides an application programming interface and
 a set of tools for decoding and encoding messages in the following formats: WMO FM-92 GRIB edition 1 and edition 2,
 WMO FM-94 BUFR edition 3 and edition 4, WMO GTS abbreviated header (only decoding)."""

toolchain = {'name': 'foss', 'version': '2020b'}

source_urls = ['https://confluence.ecmwf.int/download/attachments/45757960/']
sources = ['eccodes-%(version)s-Source.tar.gz']

builddependencies = [('CMake', '3.18.4')]
dependencies = [
    ('netCDF', '4.7.4'),
    ('JasPer', '2.0.14'),
    ('Python', '3.8.6'),
    ('SciPy-bundle', '2020.11'),
]

separate_build_dir = True

configopts = "-DENABLE_NETCDF=ON -DENABLE_JPG=ON -DENABLE_PYTHON=ON"

sanity_check_paths = {
    'files': ['bin/%s' % x for x in ['bufr_copy', 'bufr_dump', 'bufr_filter', 'bufr_ls',
                                     'codes_count', 'codes_info', 'codes_split_file',
                                     'grib_copy', 'grib_dump', 'grib_filter', 'grib_ls']],
    'dirs': [],
}

moduleclass = 'tools'
