easyblock = 'Binary'

name = 'ELIC'
version = '0.2'
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': '2018b'}
toolchainopts = {'pic': True}

source_urls = ['https://github.com/ESMValGroup/ESMValTool/archive/']
sources = [{'filename': 'ESMValTool.tar.gz', 'download_filename': 'v2.0a1.tar.gz'}]

dependencies = [
    ('Python', '2.7.15'),
    ('ELIC', '0.1', versionsuffix),
    ('orca', '1.2.1', '-nodejs-8.9.4'),
]

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

#exts_classmap = {
#    'gdtools': 'RPackage',
#}
exts_list = [
    # Python deps, order is important!
    ('pickleshare', '0.7.5', {
        'modulename': 'pickleshare',
        'source_urls': ['https://pypi.python.org/packages/source/p/pickleshare/'],
    }),
    ('simplegeneric', '0.8.1', {
        'source_tmpl': '%(name)s-%(version)s.zip',
        'modulename': 'simplegeneric',
        'source_urls': ['https://pypi.python.org/packages/source/s/simplegeneric/'],
    }),
    ('prompt_toolkit', '1.0.16', {
        'modulename': 'prompt_toolkit',
        'source_urls': ['https://pypi.python.org/packages/source/p/prompt_toolkit/'],
    }),
    ('Pygments', '2.3.1', {
        'modulename': 'pygments',
        'source_urls': ['https://pypi.python.org/packages/source/p/Pygments/'],
    }),
    ('pexpect', '4.7.0', {
        'modulename': 'pexpect',
        'source_urls': ['https://pypi.python.org/packages/source/p/pexpect/'],
    }),
    ('ipython', '5.8.0', {
        'modulename': 'IPython',
        'source_urls': ['https://pypi.python.org/packages/source/i/ipython/'],
    }),
    ################################
    # R extension
    #('gdtools', '0.1.7', {
    #    'source_tmpl': '%(name)s_%(version)s.tar.gz',
    #    'source_urls': [
    #        'http://cran.r-project.org/src/contrib/Archive/gdtools',
    #        'http://cran.r-project.org/src/contrib/',
    #        'http://cran.freestatistics.org/src/contrib',
    #    ],
    #}),
]

sanity_check_paths = {
    'files': ['ESMValTool.tar.gz'],
    'dirs': [],
}

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

moduleclass = 'numlib'
