easyblock = 'ConfigureMake'

name = 'PARI-GP'
version = '2.7.6'

homepage = 'http://pari.math.u-bordeaux.fr'
description = """PARI/GP is a widely used computer algebra system designed for fast computations in number theory
 (factorizations, algebraic  number theory, elliptic curves...), but also contains a large number of other useful
 functions to compute with mathematical entities such as matrices, polynomials, power series, algebraic numbers etc.,
 and a lot of transcendental functions. PARI is  also available as a C library to allow for faster computations.
"""

toolchain = {'name': 'foss', 'version': '2016a'}

sources = ['pari-%(version)s.tar.gz']
source_urls = ['http://pari.math.u-bordeaux.fr/pub/pari/unix/']

skipsteps = ['configure']

prebuildopts = './Configure --prefix=%(installdir)s &&'

dependencies = [
    ('libreadline', '6.3'),
    ('ncurses', '6.0'),
]

sanity_check_paths = {
    'files': [
        "bin/%s" %
        binfile for binfile in [
            'gp', 'gp-2.7', 'gphelp', 'tex2mail']] + [
                "include/pari/%s" %
                incfile for incfile in [
                    'pari.h', 'genpari.h']], 'dirs': [
                        "bin", "include"]}

moduleclass = 'math'
