# -*- 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           kde4    1.1
PortGroup           compiler_blacklist_versions 1.0 
PortGroup           boost 1.0

name                kdepim4
version             4.14.3
revision            5
categories          kde kde4
maintainers         intevation.de:bjoern.ricks {nicos @NicosPavlov}
license             GPL-2+ LGPL-2+
description         KDE4 groupware suite
long_description    KDE4 groupware suite including a Mail client, \
                    addressbook, organizer and groupware integration.
platforms           darwin
homepage            https://www.kde.org
master_sites        kde:stable/${version}/src/
use_xz              yes
distname            kdepim-${version}

checksums           rmd160  7dabf2be18cc9d3a0e42c9be855ebbe45dc54181 \
                    sha256  a3fd17fa2f3b1debc32bd28537402aaf7337582ff2fe39dbadd47d5b3232f944

depends_lib-append  port:kde4-runtime \
                    port:nepomuk-widgets \
                    port:kdelibs4 port:dblatex \
                    port:kdepimlibs4 port:kdepimlibs4-kioslaves \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:shared-desktop-ontologies port:libassuan \
                    port:kdepim4-runtime \
                    port:link-grammar \
                    port:baloo

configure.args-append   ../${distname} \
                        -DWITH_IndicateQt=OFF

#ktimetracker: Enable ktimetracker and removing its dependency on X11 (https://trac.macports.org/ticket/44282)
#emulate-addTitle: Preventing menu crash in kmail (https://trac.macports.org/ticket/44798)
patchfiles-append   patch-ktimetracker.diff \
                    patch-emulate-addTitle.diff \
                    patch-CMakeLists-disableKleo.diff \
                    patch-internal-gpgme.diff \
                    patch-kdgant2-CMakeLists.diff \
                    patch-pointers.diff

#Disabling kleopatra which does not build with boost >= 1.57. 
#See https://bugs.kde.org/show_bug.cgi?id=341355

pre-configure {
    reinplace "s|%PREFIX%|${prefix}|g" \
        ${worksrcpath}/libkleo/CMakeLists.txt
    reinplace "s|%PREFIX%|${prefix}|g" \
        ${worksrcpath}/kaddressbook/CMakeLists.txt
    reinplace "s|%PREFIX%|${prefix}|g" \
        ${worksrcpath}/messagecomposer/CMakeLists.txt
}

if {![variant_isset docs]} {
    depends_lib-delete  port:dblatex
    patchfiles-append   patch-CMakeLists.diff
}

#Blacklist gcc42 and llvm-gcc-42
compiler.blacklist  gcc-4.2 apple-gcc-4.2 llvm-gcc-4.2 macports-llvm-gcc-4.2
#Also blacklist clang before Xcode 4.2
compiler.blacklist-append   {clang < 211.10.1}

universal_variant   no

livecheck.url       ${kde4.mirror}
livecheck.regex     (\\d+(\\.\\d+)+)
