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

github.setup        ArsMasiuk qvge 0.6.3 v
checksums           rmd160  fbcecf18b32976d11cb4949330b6cce66349acac \
                    sha256  f08cbcae4bb4911c5564d929288b8c85f3994d9c0018c929ce37efce239dab7a \
                    size    458064

revision            0
categories          graphics
license             MIT
maintainers         nomaintainer
description         Qt Visual Graph Editor
long_description    QVGE is a multiplatform graph editor written in C++/Qt. \
                    Its main goal is to make it possible to visually edit \
                    two-dimensional graphs in a simple and intuitive way.

depends_build-append \
                    port:makeicns

compiler.cxx_standard \
                    2014

qt5.min_version     5.9
qt5.depends_component \
                    qtsvg

configure.args-append \
                    -r src/qvgeapp.pro

patchfiles          patch-mac-icon.diff

post-patch {
    reinplace s|@@ICON@@|${worksrcpath}/Icon.icns| ${worksrcpath}/src/qvgeapp/qvgeapp.pro
}

pre-build {
    set icon_src icon256.png
    if {[catch {system -W ${worksrcpath} "${prefix}/bin/makeicns -in ${icon_src} -out Icon.icns 2>&1"}]} {
        return -code error "${icon_src} could not be converted to Icon.icns:$::errorInfo"
    }
}

post-build {
    move ${worksrcpath}/bin/qvgeapp.app ${worksrcpath}/bin/${name}.app
}

destroot {
    copy ${worksrcpath}/bin/${name}.app ${destroot}${applications_dir}
}
