# The newer version require also the installation of basemap-data.
# Conveniently, the tarball contains that too, so that is the one
# being used here.
# Based on basemap-1.2.2-foss-2020a-Python-3.8.2.eb
# Author: J. Sassmannshausen (Imperial College London/UK)

easyblock = 'PythonBundle'

name = 'basemap'
version = '2.0.0'

homepage = 'https://matplotlib.org/basemap/'
description = """The matplotlib basemap toolkit is a library for plotting
2D data on maps in Python"""

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

builddependencies = [
    ('Cython', '3.1.2'),
]

dependencies = [
    ('Python', '3.13.5'),
    ('matplotlib', '3.10.5'),
    ('GEOS', '3.13.1'),
    ('Pillow', '11.3.0'),
    ('pyproj', '3.7.1'),
]

exts_list = [
    ('pyshp', '2.3.1', {
        'modulename': 'shapefile',
        'checksums': ['4caec82fd8dd096feba8217858068bacb2a3b5950f43c048c6dc32a3489d5af1'],
    }),
    ('basemap_data', version, {
        'modulename': 'mpl_toolkits.basemap_data',
        'preinstallopts': "cd data/%(name)s && GEOS_DIR=$EBROOTGEOS",
        'source_urls': ['https://github.com/matplotlib/basemap/archive/'],
        'sources': ['v%(version)s.tar.gz'],
        'checksums': ['192ee1c63291d7d1af98fab798c45239ea27e6ca31041afa8c42c8b697e44596'],
    }),
    (name, version, {
        'modulename': 'mpl_toolkits.basemap',
        'preinstallopts': "GEOS_DIR=$EBROOTGEOS",
        'source_urls': ['https://github.com/matplotlib/basemap/archive/'],
        'sources': ['v%(version)s.tar.gz'],
        'checksums': ['192ee1c63291d7d1af98fab798c45239ea27e6ca31041afa8c42c8b697e44596'],
    }),
]

moduleclass = 'vis'
