# -*- 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 92399 2012-04-27 19:12:22Z cal@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           github 1.0

set uname           svipc
github.setup        mdcb yp-${uname} 0.14
name                py-${uname}
license             GPL-3
platforms           darwin
maintainers         users.sourceforge.net:paumard openmaintainer
description         System V InterProcess Communication (Yorick/Python plug-ins)
long_description    This plug-in for python and yorick gives access to the \
                    System V IPC framework. This allows sharing memory and \
                    passing messages and semaphores between several distinct \
                    processes.
homepage            https://github.com/mdcb/yp-svipc

checksums           rmd160  5faa9b3943e638bdae084018316ddfe50d1c9aa4 \
                    sha256  9f879670ecb4df71f1851cd3ac0250fdd2317baeb25e200f924037cc120dd1e3

python.versions     26 27 31 32
python.default_version       27

if {$subport != ${name}} {
    livecheck.type  none
}
if {${subport} != ${name} && ${subport} != "yorick-svipc"} {
    depends_lib-append  port:py${python.version}-numpy
    pre-configure {
        reinplace "s/define_macros=\\\[/define_macros=\\\[('SVIPC_HACKS', True),/" ${worksrcpath}/setup.py
    }

}

subport yorick-svipc {
    # this _will_ cause a lint warning
    categories          science
    depends_build
    depends_lib         path:bin/yorick:yorick
    depends_run
    use_configure       yes
    universal_variant   no
    configure.dir       ${worksrcpath}/yorick
    configure.cmd       ${prefix}/bin/yorick
    configure.pre_args  {}
    configure.args      -batch make.i
    build.dir           ${worksrcpath}/yorick
    build.cmd           make
    build.target        {}
    pre-destroot        {}
    destroot.cmd        make
    destroot.destdir    DESTDIR=${destroot}
}

