Files

127 lines
4.5 KiB
Tcl

# -*- 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 mpi 1.0
PortGroup github 1.0
PortGroup cmake 1.1
PortGroup muniversal 1.0
PortGroup legacysupport 1.1
# strnlen
legacysupport.newest_darwin_requires_legacy 10
epoch 3
github.setup Unidata netcdf-c 4.10.0 v
revision 3
name netcdf
maintainers {takeshi @tenomoto} openmaintainer
categories science
license Permissive
description libraries for array-oriented scientific data
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
# Fetch from upstream release archive, not github.
# Distfile standard suffix is .tar.gz, the MacPorts default.
master_sites https://downloads.unidata.ucar.edu/netcdf-c/${version}
distname netcdf-c-${version}
checksums rmd160 f227127be3d4d4d2bc9b2dd5911c900a2977dba6 \
sha256 bd4bfa239385802a6cbea71a2f038dadcaba756a38c56804f829ed8262e7912f \
size 13334202
compilers.choose cc cpp cxx
mpi.setup
# m4 1.4.2 which comes with Mac OS X 10.4 is too old:
# https://trac.macports.org/ticket/47545
# And m4 wasn't included in the Xcode 15.3 version of the command line tools:
# https://trac.macports.org/ticket/69467#comment:6
# https://trac.macports.org/ticket/69639#comment:1
depends_build-append port:m4
configure.args-append -DENABLE_NETCDF_4=OFF \
-DENABLE_DAP=OFF \
-DENABLE_CDF5=OFF \
-DNC_M4=${prefix}/bin/gm4 \
-DCMAKE_PREFIX_PATH=${worksrcpath}/cmake/modules
# https://trac.macports.org/ticket/65672
compiler.blacklist-append *gcc-4.* {clang < 400}
test.run yes
test.target test
default_variants +netcdf4 +dap
if {(!${universal_possible}
|| ![variant_isset universal])
&& ( ${build_arch} == "x86_64"
|| ${build_arch} == "ppc64"
|| ${build_arch} == "arm64")
} {
default_variants-append +cdf5
}
if {[variant_isset netcdf4]} {
mpi.enforce_variant hdf5
}
variant netcdf4 description {enable support for netcdf-4 API} {
depends_lib-append port:hdf5 \
port:blosc \
port:bzip2 \
port:zlib \
port:zstd
configure.args-delete -DENABLE_NETCDF_4=OFF
configure.args-append -DENABLE_NETCDF_4=ON
}
variant hdf4 description {enable support for hdf4} {
depends_lib-append port:hdf4 \
path:include/turbojpeg.h:libjpeg-turbo
configure.args-append -DENABLE_HDF4=ON
}
variant dap description {enable dap} {
depends_lib-append port:curl \
port:libxml2
configure.args-delete -DENABLE_DAP=OFF
configure.args-append -DENABLE_DAP=ON \
-DENABLE_DAP_REMOTE_TESTS=OFF
}
variant cdf5 description {enable support for cdf5} {
configure.args-delete -DENABLE_CDF5=OFF
configure.args-append -DENABLE_CDF5=ON
}
if {${universal_possible} && [variant_isset universal]} {
pre-configure {
# record configure date (as cmake does) but ensure date will be the same for achitectures
# helps ensure libnetcdf.settings is the same for all architectures
set date [exec "/bin/date"]
reinplace "s|@CONFIG_DATE@|${date}|g" ${worksrcpath}/libnetcdf.settings.in
}
merger-post-destroot {
foreach arch ${universal_archs_to_use} {
reinplace "s|${build.dir}-${arch}|${build.dir}|g" ${destroot}-${arch}${prefix}/lib/libnetcdf.settings
}
}
}
if {[mpi_variant_isset]} {
configure.cflags-append -DHDF5_PARALLEL
configure.args-append -DENABLE_PARALLEL_TESTS=ON
}
# Need to use github portgroup for livecheck, because upstream
# downloads page uses dynamic content and does not show version
# numbers directly.
github.livecheck.regex {([^"rba]+)}