# -*- 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                slatec
version             4.1
revision            2
categories          science math
platforms           darwin
maintainers         nomaintainer
license             public-domain

description         Common Mathematical Library

long_description    SLATEC Common Mathematical Library is a comprehensive software library \
                    containing over 1400 general purpose mathematical and statistical routines \
                    written in Fortran 77.

homepage            http://www.netlib.org/slatec/
master_sites        http://www.netlib.org/slatec/
distname            slatec_src
extract.suffix      .tgz
worksrcdir          src
patchfiles          patch-slatec4linux.diff

checksums           rmd160  f4393d91e25ecd2ec0cae6b25d4b2829afcd4291 \
                    sha256  df009d9ef9c18aae06ce68711b1ae108d3533b4f174582c3cbea0915c4fdfe01 \
                    size    2373787

use_configure       no

compilers.choose    fc f77 f90
compilers.setup     require_fortran

# fix build error using gcc10
# :info:build ../defcmn.f:95:25:
# :info:build    51 |       CALL DCOPY (N, 0.D0, 0, COEFF, 1)
# :info:build       |                     2
# :info:build ......
# :info:build    95 |       CALL DCOPY (NBKPT, BKPTIN, 1, BKPT, 1)
# :info:build       |                         1
# :info:build Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
compilers.allow_arguments_mismatch yes

build.target        libslatec.a

pre-build {
    build.args-append \
        FC=${configure.fc} \
        FFLAGS='${configure.fflags}'
}

destroot {
    xinstall -m 644 ${worksrcpath}/static/libslatec.a ${destroot}${prefix}/lib
}

livecheck.type      none
