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

github.setup            gpilab framework 1.0.5 v
name                    py-gpilab-framework
revision                0
python.versions         35 36
python.default_version  36
supported_archs         noarch
platforms               darwin
license                 LGPL-3
maintainers             {eborisch @eborisch} \
                        openmaintainer
description             This is the GPI Framework project.

long_description        This is the GPI Framework project. The framework \
                        constitutes the main process that provides a canvas \
                        for graphically organizing and assembling algorithm \
                        components called 'Nodes'. The framework also \
                        contains the PyFI C++ interface for simplifying the \
                        generation of Python extension modules.

homepage                http://gpilab.com

checksums \
    rmd160  5978096574f142adb13a8998c3f84308140f57c2 \
    sha256  9778c8a52ef45533eed5ce8e25c2b38bd49cdc858ee17b4a638e968a73646d9b \
    size    4114430

patchfiles                  mainWindow.py.diff

if {${name} ne ${subport} } {
    depends_run-append      port:py${python.version}-json-tricks \
                            port:py${python.version}-numpy \
                            port:py${python.version}-opengl \
                            port:py${python.version}-pep8 \
                            port:py${python.version}-pillow \
                            port:py${python.version}-psutil \
                            port:py${python.version}-pyflakes \
                            port:py${python.version}-pyqt4 \
                            port:py${python.version}-qimage2ndarray \
                            port:py${python.version}-scipy \
                            port:py${python.version}-sip \
                            port:astyle \
                            path:include/eigen3/Eigen/Core:eigen3 \
                            port:fftw-3 \
                            port:fftw-3-single \
                            
    livecheck.type          none


    post-patch {
        reinplace \
           -E "s^/usr/bin/env python3?^${prefix}/bin/python${python.branch}^" \
           bin/gpi_launch bin/gpi_make bin/gpi_update doc/conf.py \
           doc/FrameworkDev/devguide.rst doc/latest_version.py \
           lib/gpi/types/numpy_GPITYPE.py \
           lib/gpi/types/globjectlist_GPITYPE.py \
           lib/gpi/types/python_GPITYPE.py lib/gpi/docs.py \
           lib/gpi/numba_stub.py lib/gpi/launch.py lib/gpi/topsort.py \
           lib/gpi/make.py
        reinplace "s/import json/import json_tricks as json/" \
            lib/gpi/network.py
        reinplace "s/10\\.9/${macosx_deployment_target}/" lib/gpi/make.py
    }

    use_configure no

    build { }

    destroot {
        set DD ${destroot}${prefix}
        set PP ${destroot}${python.pkgd}
        xinstall -W ${worksrcpath}/bin gpi_launch gpi_make ${DD}/bin/
        xinstall -d ${DD}/share/${subport}/
        xinstall -W ${worksrcpath} COPYING COPYING.LESSER LICENSE README.md \
            ${DD}/share/${subport}
        xinstall -d ${PP}
        file copy ${worksrcpath}/lib/gpi ${PP}/
        file copy ${worksrcpath}/include/PyFI ${destroot}${prefix}/include/
        file copy ${worksrcpath}/include/multiproc \
            ${destroot}${prefix}/include/
    }
}