easyblock = 'PythonBundle'

name = 'ELIC_Python'
version = '1'
versionsuffix = '-Python-%(pyver)s'

homepage = 'https://gogs.elic.ucl.ac.be'
description = """This repo provides additional Python and R extensions for ELIC ecosystem."""

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

builddependencies = [
    ('pkg-config', '0.29.2'),
]

dependencies = [
    ('Python', '2.7.18'),
    ('SciPy-bundle', '2019.10', versionsuffix),
    ('GDAL', '3.0.0', versionsuffix),
    #('NCL', '6.6.2'),
    #('CDO', '1.9.9'),
    #('NCO', '4.9.7'),
    ('ncview', '2.1.7'),
]

exts_defaultclass = 'PythonPackage'
exts_default_options = {
    'source_tmpl': '%(name)s-%(version)s.tar.gz',
}

exts_list = [
    # Python deps, order is important!
    ('PyKE', '1.1.1', {
        'source_tmpl': 'pyke-1.1.1.zip',
        'source_urls': ['http://download.sourceforge.net/pyke'],
        'checksums': ['b0b294f435c6e6d2d4a80badf57d92cb66814dfe21e644a521901209e6a3f8ae'],
    }),
    #('matplotlib', '2.2.4', {
    #    'source_urls': ['https://pypi.python.org/packages/source/m/matplotlib/'],
    #}),
    #('basemap', '1.1.0', {
    #    'modulename': 'mpl_toolkits.basemap',
    #    'source_tmpl': 'v%(version)s.tar.gz',
    #    'source_urls': ['https://github.com/matplotlib/basemap/archive'],
    #    'checksums': ['6acdc3a08bfcebf0a1b52a05d73d51b7aa5e7240fedfa95537c92d16f2ef8778'],
    #}),
    #('scipy', '1.2.2', {
    #    'source_urls': ['https://pypi.python.org/packages/source/s/scipy/'],
    #    'checksums': ['a4331e0b8dab1ff75d2c67b5158a8bb9a83c799d7140094dda936d876c7cfbb1'],
    #}),
]

modextrapaths = {
    'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages',
    'PYTHONUSERBASE': '',
}

postinstallcmds = [
    "cd %(installdir)s && " +
    'pip install setuptools --upgrade && ' +
    'pip install olefile pyproj pyshp chardet urllib3 --prefix="%(installdir)s" && ' +
    'pip install OWSLib ' +
                'netCDF4==1.4.3.2 ' +
                'dask ' +
                'cf-units ' +
                'Cartopy ' +
                '--prefix="%(installdir)s" '
]

moduleclass = 'numlib'
