# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           compilers 1.0

name                sparskit
version             2
categories          science
platforms           darwin
maintainers         {dstrubbe @dstrubbe}
license             LGPL-2.1+

description         A basic tool-kit for sparse matrix computations

long_description    A basic tool-kit for sparse matrix computations: programs \
                    for converting data structures, printing simple \
                    statistics on a matrix, plotting a matrix profile, \
                    performing basic linear algebra operations with sparse \
                    matrices and so on.

homepage            http://www-users.cs.umn.edu/~saad/software/SPARSKIT
master_sites        ${homepage}
distname            SPARSKIT${version}

checksums           rmd160  95554593896300d7823f40956a428e8e7c57bb78 \
                    sha1    702bb646024f62fafbd827aa29d4f8994a74b90a

use_configure       no

patchfiles          patch-makefile.diff \
                    patch-INFO-makefile.diff \
                    patch-INOUT-makefile.diff \
                    patch-MATGEN-FEM-makefile.diff

compilers.choose    fc
compilers.setup     require_fortran

build.args          OPT="-c -O3"

use_parallel_build  yes

test.run            yes
test.args           FFLAGS=-O3
# test requires FC, FFLAGS set because test makefiles lack explicit rule for .f -> .o and these are in the implicit rule

post-fetch {
    build.args-append  F77=${configure.fc}
    test.args-append   F77=${configure.fc} FC=${configure.fc}
}

destroot {
    xinstall ${worksrcpath}/libskit.a ${destroot}${prefix}/lib/
}

post-test {
    ui_notice "Examine log file for test results."
}

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     SPARSKIT(\[0-9.\]+)${extract.suffix}