# -*- 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
# $Id: Portfile 119964 2014-05-12 10:05:20Z stromnov@macports.org $

PortSystem          1.0
PortGroup           github 1.0
PortGroup           python 1.0
PortGroup           cmake 1.0

set git_sha1        09c190390cc2df88031373735990e93727bbfb50
github.setup        ContinuumIO dynd-python 0.6.2 v

name                py-dynd
categories-append   devel
platforms           darwin
license             BSD

python.versions     26 27 33 34

maintainers         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  d9e8316a171803982088944f33c2267ce9bf71a9 \
                    sha256  d142f8ceafb189158f3a057e43f4b79a65e9f2855700a7970f0ad4b5eccd096a

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

    patchfiles-append   patch-CMakeLists.txt.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
    }

    use_configure       yes
    configure.args-append \
                        -DUSE_SEPARATE_LIBDYND=ON \
                        -DUSE_RELATIVE_RPATH=OFF \
                        -DPYTHON_EXECUTABLE=${prefix}/bin/python${python.branch} \
                        -DCYTHON_EXECUTABLE=${prefix}/bin/cython-${python.branch}

    build.cmd           make
    build.target        all

    destroot.cmd        make
    destroot.destdir    DESTDIR=${destroot}

    livecheck.type      none
}
