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

set git_sha1        341d6d91931fdb04ad657d27ed740cf533fc925b

github.setup        libdynd libdynd 0.7.2 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            1
categories          devel math
license             BSD

maintainers         {stromnov @stromnov} openmaintainer

description         LibDyND is a C++ library for dynamic, multidimensional arrays.
long_description    {*}${description}

checksums           rmd160  58a444d46d348fddc6f4cf04669d301dbb47981e \
                    sha256  7bc14b26537a0b5c0e8ad9d8b0143b94eab38917ca42082be44cfa0fbb605e01 \
                    size    1342463

patchfiles-append   patch-CMakeLists.txt.diff

# https://trac.macports.org/ticket/59745
patchfiles-append   patch-src_dynd_type.cpp.diff

post-patch {
    reinplace "s|@@DYND_GIT_SHA1@@|${git_sha1}|g" ${worksrcpath}/CMakeLists.txt
    reinplace "s|@@DYND_VERSION_STRING@@|v${version}|g" ${worksrcpath}/CMakeLists.txt
}

compiler.cxx_standard 2014

configure.args-append \
                    -DDYND_SHARED_LIB:BOOL=ON \
                    -DDYND_CUDA:BOOL=OFF \
                    -DDYND_FFTW:BOOL=OFF \
                    -DDYND_LLVM:BOOL=OFF \
                    -DDYND_INSTALL_LIB:BOOL=ON \
                    -DDYND_BUILD_TESTS:BOOL=OFF \
                    -DDYND_BUILD_BENCHMARKS:BOOL=OFF
