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

name                kdepimlibs4
version             4.14.3
revision            15
categories          kde kde4
maintainers         {nicos @NicosPavlov}
license             GPL-2+ LGPL-2+ BSD
description         KDE4 core PIM libraries
long_description    Core libraries necessary for Personal Information Management (PIM) in KDE4
platforms           darwin
homepage            https://www.kde.org
master_sites        kde:stable/${version}/src/
use_xz              yes
distname            kdepimlibs-${version}

checksums           rmd160  95af39ad4848fe48efbd4e3be8b4b0767530ec60 \
                    sha256  65edb1bec191be1b6f8450dc71eadae734f4ab0585aab0a885207390399868d7

#The only binaries linking to openssl (through QtNetwork) are libkimap.dylib
#and libmailtransport.dylib, which are purely LPGL, thus not conflicting with
#openssl license, apart from plugins in kioslaves
license_noconflict  openssl

depends_lib-append  port:kdelibs4 \
                    port:akonadi \
                    port:boost \
                    port:libical \
                    port:openldap \
                    port:ossp-uuid \
                    port:prison \
                    port:cyrus-sasl2 \
                    port:shared-mime-info \
                    port:qjson \
                    port:libxslt \
                    port:libxml2 \
                    port:perl5 \
                    port:gpgme

#Suppress build of kioslaves which conflict with openssl
patchfiles-append   patch-CMakeLists.diff \
                    patch-do_not_include_cpp.diff \
                    patch-ical.diff \
                    patch-tests.diff

configure.args-append   -DMAILTRANSPORT_INPROCESS_SMTP=Off \
                        -DCMAKE_CXX_FLAGS=\"-std=c++11\"

subport kdepimlibs4-kioslaves {

#kioslaves components conflict with openssl license
license_noconflict-delete   openssl

#The main kdepimlibs4 is required for linking with other libraries
depends_lib-append      port:kdepimlibs4

#Builds only kioslaves components
patchfiles-delete   patch-CMakeLists.diff
patchfiles-append   patch-CMakeLists-kioslaves.diff

#Suppresses files already installed by kdepimlibs4 main port
post-destroot {
    delete ${destroot}${prefix}/share/mime/packages/kdepimlibs-mime.xml
}
}

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