easyblock = 'ConfigureMake'

name = 'libmatheval'
version = '1.1.11'

homepage = 'http://www.gnu.org/software/libmatheval/'
description = """GNU libmatheval is a library (callable from C and Fortran) to parse
 and evaluate symbolic expressions input as text."""

toolchain = {'name': 'GCCcore', 'version': '6.4.0'}
toolchainopts = {'pic': True}

source_urls = [GNU_SOURCE]
sources = [SOURCELOWER_TAR_GZ]
patches = ['libmatheval-%(version)s_fix-matheval-test.patch']
checksums = [
    '474852d6715ddc3b6969e28de5e1a5fbaff9e8ece6aebb9dc1cc63e9e88e89ab',  # libmatheval-1.1.11.tar.gz
    '2888ee1ba32bb864b655e53e13b06eafc23b598faed80b90585d41c98e2ae073',  # libmatheval-1.1.11_fix-matheval-test.patch
]

builddependencies = [
    ('binutils', '2.28'),
]
dependencies = [
    ('flex', '2.6.4'),
    ('Bison', '3.0.4'),
    ('Guile', '1.8.8'),
]

configopts = '--with-pic '

# fix for guile-config being broken because shebang line contains full path to bin/guile
configopts += 'GUILE_CONFIG="$EBROOTGUILE/bin/guile -e main -s $EBROOTGUILE/bin/guile-config"'

sanity_check_paths = {
    'files': ['lib/libmatheval.a', 'include/matheval.h'],
    'dirs': [],
}

moduleclass = 'lib'
