# IT4Innovations 2019

easyblock = 'ConfigureMake'

name = 'GDAL'
version = '2.2.3'
versionsuffix = '-Py-2.7'

homepage = 'http://www.gdal.org/'
description = """GDAL is a translator library for raster geospatial data formats that is released under an X/MIT style
 Open Source license by the Open Source Geospatial Foundation. As a library, it presents a single abstract data model
 to the calling application for all supported formats. It also comes with a variety of useful commandline utilities for
 data translation and processing."""

toolchain = {'name': 'intel', 'version': '2017a'}
toolchainopts = {'usempi': True}

source_urls = ['http://download.osgeo.org/gdal/%(version)s/']
sources = [SOURCELOWER_TAR_XZ]
checksums = ['a328d63d476b3653f5a25b5f7971e87a15cdf8860ab0729d4b1157ba988b8d0b']

dependencies = [
    ('Py', '2.7', '', True),
    ('netCDF', '4.6.3'),
    ('expat', '2.2.6', '', True),
    ('GEOS', '3.7.1', '', ('Py', '2.7')),
    ('SQLite', '3.27.1', '', True),
    ('libxml2', '2.9.9', '', True),
    ('libpng', '1.6.34', '', True),
    ('libjpeg-turbo', '1.5.3', '', True),
    ('JasPer', '2.0.14', '', True),
    ('LibTIFF', '4.0.7', '', True),
    ('zlib', '1.2.11', '', True),
    ('cURL', '7.56.1', '', True),
    ('PCRE', '8.42', '', True),
    ('PROJ', '5.0.0'),
]

configopts = '--with-expat=$EBROOTEXPAT --with-libz=$EBROOTLIBZ --with-hdf5=$EBROOTHDF5 --with-netcdf=$EBROOTNETCDF'
configopts += ' --with-xml2=$EBROOTLIBXML2 --with-geos=$EBROOTGEOS/bin/geos-config --with-jpeg=$EBROOTLIBJPEGMINTURBO'
configopts += ' --with-png=$EBROOTLIBPNG --with-sqlite3=$EBROOTSQLITE --with-jasper=$EBROOTJASPER'
configopts += ' --with-libtiff=$EBROOTLIBTIFF --with-pcre=$EBROOTPCRE --with-python=$EBROOTPYTHON/bin/python'

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

sanity_check_paths = {
    'files': ['lib/libgdal.a', 'lib/libgdal.%s' % SHLIB_EXT],
    'dirs': ['bin', 'include', 'lib/python%(local_pyshortver)s/site-packages']
}

moduleclass = 'data'
