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

fetch.type          git
git.url             https://invent.kde.org/unmaintained/kde-runtime.git
git.branch          e08a9f70

name                kde4-runtime
version             4.14.4.20150225
revision            19
categories          kde kde4
maintainers         nomaintainer
license             GPL-2+ LGPL-2.1+
description         Shared data needed by KDE4 programs
long_description    Provides data which is required by KDE4 applications. \
                    e.g. icons and mimetype data.
homepage            https://www.kde.org
master_sites        kde:stable/${version}/src/
use_xz              yes

default_variants    +samba

#Binaries do not link directly to openssl, nor use the ssl backend of kdelibs4,
#nor links to libkimap or libmailtransport from kdepimlibs4
license_noconflict  openssl

patchfiles          patch-support-for-lldb.diff \
                    patch-make-kioexec-agent.diff \
                    patch-phonon-cmakelists.diff \
                    patch-gpgme.diff

#Needs C++11 to build.
#Undefined symbols:
#"__ZN5Exiv27ExifKeyC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE"
compiler.cxx_standard   2011

depends_lib-append  port:attica \
                    port:bison \
                    port:exiv2 \
                    port:gpgme \
                    port:hicolor-icon-theme \
                    port:kactivities \
                    port:kdelibs4 \
                    port:kdepimlibs4 \
                    port:libgcrypt \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:libssh \
                    port:nepomuk-core \
                    port:openexr \
                    port:openslp \
                    port:oxygen-icons \
                    port:perl5 \
                    port:qca \
                    port:qimageblitz \
                    port:raptor2 \
                    port:redland \
                    port:shared-mime-info \
                    port:webp \
                    port:xz \
                    port:zlib

depends_run-append  port:virtuoso

#Virtuoso is only a runtime dependency,
#automatically deactivated if not available (ticket #41773)
depends_skip_archcheck  virtuoso

configure.args-append   -DXINE_INCLUDE_DIR=\"\" \
                        -DXINE_LIBRARY=\"\" \
                        -DWITH_ALSA=OFF \
                        -DWITH_QZeitgeist=OFF \
                        -DWITH_QNtrack=OFF \
                        -DKDEBASE_DISABLE_MULTIMEDIA=OFF \
                        -DKDERUNTIME_BUILD_NEPOMUK=ON

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

variant xine description "Enable xine support" {
# Unsupported. Don't report bugs, unless it comes with a patch :-)
    depends_lib-append      port:xine-lib
    configure.args-delete   -DXINE_INCLUDE_DIR=\"\" \
                            -DXINE_LIBRARY=\"\"
}
if {[variant_isset xine]} {
    # xine-lib is not universal
    universal_variant no
}

variant samba description "Activate use of samba" {
    depends_lib-append  port:samba3
}
if {![variant_isset samba]} {
    configure.args-append   -DWITH_Samba=OFF
} else {
    configure.args-append   -DWITH_Samba=ON
}

configure.args-append -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCMAKE_STRIP:FILEPATH=/bin/echo

post-destroot {
# Remove this file as it conflicts with hicolor-icon-theme
    file delete ${destroot}${prefix}/share/icons/hicolor/index.theme
# Remove this file as it conflicts with kdelibs4
    file delete ${destroot}${prefix}/include/nepomuk/resourcewatcher.h
}

livecheck.type       none