# -*- 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                   github 1.0

#PortGroup                   cmake 1.0
PortGroup                   mpi 1.0

github.setup                Unidata netcdf-cxx4 4.3.1 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from         tarball
revision                    2
distname                    ${name}-${version}
maintainers                 {takeshi @tenomoto} openmaintainer
categories                  science
license                     Permissive

description                 NetCDF new C++ library
long_description \
    NetCDF (network Common Data Form) is a set of software libraries \
    and machine-independent data formats that support the creation,  \
    access, and sharing of array-oriented scientific data.

homepage                    https://www.unidata.ucar.edu/software/netcdf/

checksums           rmd160  7f3560c9f257650c9821d7a1b9385de9d4e2b8b6 \
                    sha256  714339bba765077e03af62f32c35a2f96fded59fc01a1dd215266a8e2af39a53 \
                    size    607825

compilers.choose            cc cpp cxx
mpi.setup

#cmake.out_of_source         yes

#mpi.enforce_variant         hdf5

depends_lib                 port:netcdf

configure.args              --disable-filter-testing

configure.cppflags-append   -DNDEBUG
configure.cxxflags-append   -fno-common
configure.cflags-append     -fno-common
configure.ldflags-append    -lnetcdf

post-configure {
    file rename ${worksrcpath}/VERSION ${worksrcpath}/VERSION.txt
}

test.run                    yes
test.target                 check

destroot.destdir            prefix=${destroot}${prefix}
