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

set git_sha1        8cdef57e71c784d7fe1f3f97a2ce2ce5727a89f1

github.setup        libdynd dynd-python 0.7.2 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball

name                py-dynd
categories-append   devel
license             BSD

python.versions     311

maintainers         {stromnov @stromnov} openmaintainer

description         Dynamic multi-dimensional array library.

long_description    DyND-Python, a component of the Blaze project, is the \
                    Python exposure of the DyND dynamic multi-dimensional \
                    array library.

checksums           rmd160  dc0c24136b8b295ab85046489b6a3b05146ce8b2 \
                    sha256  0ef58192fa66e9401dce91bc8a5602e16397529464e2bb027af62ed6f19d7a2c \
                    size    184984

if {${name} ne ${subport}} {
    depends_build-append \
                        port:py${python.version}-setuptools \
                        path:bin/cmake:cmake

    depends_lib-append  port:libdynd \
                        port:py${python.version}-numpy \
                        port:py${python.version}-cython

    patchfiles-append   patch-CMakeLists.txt.diff \
                        patch-setup.py.diff

    post-patch {
        reinplace "s|@@DYND_PYTHON_GIT_SHA1@@|${git_sha1}|g" ${worksrcpath}/CMakeLists.txt
        reinplace "s|@@DYND_PYTHON_VERSION_STRING@@|v${version}|g" ${worksrcpath}/CMakeLists.txt ${worksrcpath}/setup.py
        reinplace "s|@@EXTRA_CMAKE_ARGS@@|-DCYTHON_EXECUTABLE=${prefix}/bin/cython-${python.branch}|g" ${worksrcpath}/setup.py
    }
}