# -*- 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 92587 2012-05-01 20:19:49Z mk@macports.org $

PortSystem          1.0

# See dports/_resources/port1.0/group/kde4-1.1.tcl for more info.
PortGroup           kde4    1.1

name                kmymoney4
version             4.6.2

categories          kde finance
maintainers         mk pixilla openmaintainer

description         kmymoney version 4
long_description    KMyMoney is the personal finance manager for KDE.
platforms           darwin
license             GPL-2+

homepage            http://kmymoney2.sourceforge.net/index-home.html
master_sites        sourceforge:kmymoney2

livecheck.type      regex
livecheck.url       http://sourceforge.net/projects/kmymoney2/files/
livecheck.regex     "kmymoney-(4\\.\\d+?(\\.\\d+))\\.tar"

distname            kmymoney-${version}
use_bzip2           yes

build.asroot        yes

checksums           md5     5659706cbe85416cbabfa000a29b19b5 \
                    sha1    b7dc6ce3a36c441ae2d199725db9aa2ec23fdd1f \
                    rmd160  b71f82f7fed3daba5711437db29cd225f38262d9

conflicts           kmymoney4-devel

depends_lib-append  port:libofx \
                    port:aqbanking5 \
                    port:kde4-runtime \
                    port:kdepimlibs4 \
                    port:oxygen-icons \
                    port:libalkimia

patch.dir           ${workpath}/${distname}
patch.pre_args      -p1
patchfiles          patch-CMakeLists.txt.diff

#default_variants +no_x11 +no_gtk

variant no_x11 description {build without X11 to avoid unneeded dependencies} {}

variant no_gtk description {build without GTK support to ensure avahi gets build without it, avoiding X11} {}

post-activate {
    # Calling kbuildsycoca4 in case KDE hasn't called it yet to make sure that plugins are loaded.
    system "${prefix}/bin/kbuildsycoca4"
}
