# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 53896 2009-07-16 08:39:13Z jochen@macports.org $

PortSystem          1.0

set realname        hdf5
name                ${realname}-18
version             1.8.3
categories          science
maintainers         mmoll openmaintainer

description         HDF5 general purpose library and file format for storing scientific data
long_description    ${description}
homepage            http://www.hdfgroup.org/HDF5/
platforms           darwin
master_sites        ftp://ftp.hdfgroup.org/HDF5/current/src/ \
                    ftp://ftp.hdfgroup.org/HDF5/prev-releases/hdf5-${version}/src/
checksums           md5 5ce228d860bf9e797ca40ab1a823c380 \
                    sha1 0bf66eb5d964472eae4b6c2bb26e669dcd188140 \
                    rmd160 7b279306b5458f39dc7343c14a7c7c88459823a3
distname            ${realname}-${version}
patchfiles          patch-configure.diff
depends_lib         port:zlib port:szip
use_parallel_build  yes

# The HDF5 configure script reorders CPPFLAGS and mangles
# '-isysroot /Developer/SDKs/MacOSX10.5.sdk'. Luckily, we can omit it,
# since it does not run the preprocessing phase separate from the
# compilation phase and it leaves the CFLAGS/CXXFLAGS alone.
configure.universal_cppflags
configure.args      --with-zlib=yes --with-szlib=yes --enable-filters=all \
                    --enable-production --disable-fortran \
                    --enable-cxx --enable-shared --disable-static

test.run            yes
test.target         check

variant threadsafe description {Enable threadsafety (experimental and un-supported, disables cxx support)} {
    configure.args-delete       --disable-threadsafe --enable-cxx
    configure.args-append       --enable-threadsafe --disable-cxx
}

livecheck.check     regex
livecheck.url       http://www.hdfgroup.org/HDF5/release/obtain5.html
livecheck.regex     5-(\[0-9.\]+)
