# -*- 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
# $Id: Portfile 118092 2014-03-21 20:03:14Z macsforever2000@macports.org $

PortSystem          1.0

name                silo
version             4.9.1
revision            1
categories          science
platforms           darwin
maintainers         nomaintainer
license             BSD

description         mesh and field I/O library and scientific database

long_description    ${description}

homepage            https://wci.llnl.gov/codes/silo/
master_sites        ${homepage}silo-${version}/

checksums           sha1    f97b62dd8b2e1f0266ab2ba2924ecaa68303d28c \
                    rmd160  4228345a7fb2994c7e331c098712aaaafe0f2782

distname            ${name}-${version}-bsd

depends_lib         port:zlib

use_parallel_build  yes

# Makefile:152: *** missing separator.  Stop.
configure.ccache    no

default_variants    +hdf5

configure.args      --enable-optimization \
                    --disable-fortran \
                    --with-zlib \
                    --enable-install-lite-headers \
                    --enable-shared \
                    --enable-browser=no \
                    --enable-silex=no

test.run            yes
test.target         check

variant gcc44 description {Build with MacPorts gcc 4.4 compiler} conflicts gcc45 gcc46 gcc47 gcc48 gcc49 {
    configure.compiler          macports-gcc-4.4
}

variant gcc45 description {Build with MacPorts gcc 4.5 compiler} conflicts gcc44 gcc46 gcc47 gcc48 gcc49 {
    configure.compiler          macports-gcc-4.5
}

variant gcc46 description {Build with MacPorts gcc 4.6 compiler} conflicts gcc44 gcc45 gcc47 gcc48 gcc49 {
    configure.compiler          macports-gcc-4.6
}

variant gcc47 description {Build with MacPorts gcc 4.7 compiler} conflicts gcc44 gcc45 gcc46 gcc48 gcc49 {
    configure.compiler          macports-gcc-4.7
}

variant gcc48 description {Build with MacPorts gcc 4.8 compiler} conflicts gcc44 gcc45 gcc46 gcc47 gcc49 {
    configure.compiler          macports-gcc-4.8
}

variant gcc49 description {Build with MacPorts gcc 4.9 compiler} conflicts gcc44 gcc45 gcc46 gcc47 gcc48 {
    configure.compiler          macports-gcc-4.9
}

variant hdf5 description {Enable HDF5 support (recommended)} {
    depends_lib-append      port:hdf5-18
    configure.args-append   --with-hdf5=${prefix}
}

# If using a macports-installed GCC, which includes a compatible fortran
# compiler, compile fortran bindings
if {(    [ variant_isset gcc44 ] || [ variant_isset gcc45 ]
      || [ variant_isset gcc46 ] || [ variant_isset gcc47 ]
      || [ variant_isset gcc48 ] || [ variant_isset gcc49 ] )} {
    configure.args-replace      --disable-fortran --enable-fortran
}

livecheck.type      regex
livecheck.url       ${homepage}downloads.html
livecheck.regex     ${name}-(\[0-9.\]+)-bsd
