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

set uname           svipc
github.setup        mdcb yp-${uname} 0.16
name                py-${uname}
license             GPL-3
platforms           darwin
maintainers         {thibaut @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

patchfiles          patch-version.diff
patch.pre_args      -p1

checksums           rmd160  f0d94da1014bab729db6658d22f7ee0d38b27a44 \
                    sha256  52f0dd4c5611b18e048c4d83e86a1d12e7362c265089574d78b2e18749b0629c \
                    size    26912

python.versions     27 35 36 37

if {${name} ne ${subport}} {
    livecheck.type  none
}
if {${name} ne ${subport} && ${subport} ne "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 yorick
    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}
}

