# -*- 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 125861 2014-09-28 07:38:20Z devans@macports.org $

PortSystem          1.0
PortGroup           kde4 1.1

name                nepomuk-core
version             4.14.3
revision            1
categories          kde kde4
maintainers         nomaintainer
license             GPL-2+ LGPL-2.1+
description         Nepomuk-core contains the Semantik Desktop core libraries
long_description    ${description}. This includes central services like file \
                    indexing, file system monitoring, query and of course storage, \
                    as well as the corresponding client libraries. This port is provided \
                    only for historical reasons and the libraries it provides.
homepage            https://www.kde.org
master_sites        kde:stable/${version}/src/
use_xz              yes
checksums           rmd160  8d971b8ac8c44b11576a91153414b227a044abb1 \
                    sha256  74e725577f2f513c577c138e395448c3ca451cd894e35e14017b4b3ce63eab3d \
                    size    383516

# Binaries do not link to openssl, nor use the ssl backend of kdelibs4
license_noconflict  openssl

depends_lib-append  port:ebook-tools \
                    port:exiv2 \
                    port:ffmpeg \
                    port:kdelibs4 \
                    port:kfilemetadata \
                    port:mobipocket \
                    port:poppler-qt4-mac \
                    port:taglib

patchfiles-append   patch-cmake-baloo.diff \
                    patch-nepomuk-make-daemons-agents.diff

# make the port build even when soprano is installed without the virtuoso backend
patchfiles-append   patch-build-without-soprano+virtuoso.diff

configure.env-append \
                    PKG_CONFIG_PATH="${prefix}/libexec/poppler-qt4-mac/lib/pkgconfig:${prefix}/lib/pkgconfig"
build.env-append    PKG_CONFIG_PATH="${prefix}/libexec/poppler-qt4-mac/lib/pkgconfig:${prefix}/lib/pkgconfig"

pre-activate {
    # Deactivate hack for when nepomuk-core was split from kde4-runtime
    if {[file exists ${applications_dir}/KDE4/nepomukbackup.app/Contents/Info.plist] 
        && ![catch {set vers [lindex [registry_active kde4-runtime] 0]}] 
        && [vercmp [lindex $vers 1] 4.9.3] < 0} {
            registry_deactivate_composite kde4-runtime "" [list ports_nodepcheck 1] 
    } 
}

variant baloo description "Add support for baloo indexing (probably requires port:soprano+virtuoso)" {
    depends_lib-append  port:baloo
    patchfiles-delete   patch-cmake-baloo.diff
}

notes-append "nepomuk-core requires Soprano's Virtuoso backend (port:soprano+virtuoso)\
if you actually want to use the server. You can disregard this is you are installing\
nepomuk-core only as a dependency."

livecheck.url       http://kde.mirrors.hoobly.com/stable/
livecheck.regex     (\\d+(\\.\\d+)+)
