# -*- 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        qt4 1.0
PortGroup        cmake 1.0

name             kst
version          2.0.8
revision         4

categories       science
platforms        darwin
maintainers      {nicos @NicosPavlov} openmaintainer
license          GPL-2

description      Plots scientific data
long_description Kst is the fastest real-time large-dataset viewing and plotting tool available and has basic data analysis functionality. Kst contains many powerful built-in features and is expandable with plugins and extensions.

homepage         http://kst.kde.org/
master_sites     http://downloads.sourceforge.net/project/kst/Kst%20${version}
distname         Kst-${version}

checksums           rmd160  b4ed06ddbb4b2680d14e1ac5e8a310bcdd6f737c \
                    sha256  cefbfd3e3710771985e08f02a397ef8ab407168fa8415d2c3c5740c031af18c6

cmake.out_of_source yes

#Not using fixup_bundle from cmake
#Also fixing compilation with GSL2. Reported at 
#https://bugs.kde.org/show_bug.cgi?id=355324
patchfiles       patch-CMakeLists.diff \
                 patch-gsl2.diff

depends_lib-append   port:gsl \
                     port:cfitsio \
                     port:matio

configure.args-append    -Dkst_install_prefix=${applications_dir} \
                         -Dkst_install_libdir=lib \
                         -Dkst_release=ON \
                         -Dkst_3rdparty=ON

platform darwin {
    if {${os.major} > 11} {
        configure.args-append    -Dkst_clang=ON
    }
}

post-destroot {
    move ${destroot}${applications_dir}/share/kst ${destroot}${prefix}/share
    delete ${destroot}${prefix}/lib
    copy ${destroot.dir}/build/lib ${destroot}${prefix}
}

livecheck.type          regex
livecheck.url           http://sourceforge.net/projects/kst/files/
livecheck.regex         Kst (\[0-9.\]\\.\[0-9.\]\\.\[0-9.\]).