# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           kde4    1.1

name                amarok
version             2.6.0
revision            4
categories          kde kde4
maintainers         nomaintainer
# Future GPL versions must be approved by KDE
license             {GPL-2 GPL-3}
description         Amarok, the world-renowned media player.
long_description    Amarok is a music player and manager with an intuitive \
                    interface. It provides a variety of feature which helps \
                    to discover and manage your music.
platforms           darwin
homepage            https://amarok.kde.org/
master_sites        kde:stable/${name}/${version}/src/
use_bzip2           yes

checksums           rmd160  89b8e3a56390dc240efc7dddd8e97ac9e4a03127 \
                    sha256  a91280e588181cf9363d7146f339ef527220fe0c8057f26f010f592b01fdd2c0

configure.args-append   -DKDE4_BUILD_TESTS=OFF

depends_lib-append  port:kde4-runtime port:kdelibs4 \
                    port:qtscriptgenerator port:liblastfm \
                    port:taglib port:taglib-extras \
                    port:loudmouth port:qca port:libmtp port:libgpod

patchfiles          patch-src-app_mac.cpp.diff \
                    patch-TrayIcon.diff \
                    patch-FindMySQLAmarok.diff

# prototype for 'Dynamic::BiasPtr Dynamic::AbstractBiasFactory::createFromXml(QCoreXmlStreamReader*)' does not match any in class 'Dynamic::AbstractBiasFactory'
universal_variant   no

pre-configure {
    reinplace "s|@PREFIX@|${prefix}|g" \
        ${worksrcpath}/cmake/modules/FindMySQLAmarok.cmake
}

variant mysql51 \
    conflicts mysql55 mysql56 mariadb55 \
    description {build with mysql51 port} {

    depends_lib-append      port:mysql51

    pre-configure {
        reinplace "s|@MYSQL@|mysql51|g" \
            ${worksrcpath}/cmake/modules/FindMySQLAmarok.cmake
    }
}

variant mysql55 \
    conflicts mysql51 mysql56 mariadb55 \
    description {build with mysql55 port} {

    depends_lib-append      port:mysql55

    pre-configure {
        reinplace "s|@MYSQL@|mysql55|g" \
            ${worksrcpath}/cmake/modules/FindMySQLAmarok.cmake
    }
}

variant mysql56 \
    conflicts mysql51 mysql55 mariadb55 \
    description {build with mysql56 port} {

    depends_lib-append      port:mysql56

    pre-configure {
        reinplace "s|@MYSQL@|mysql56|g" \
            ${worksrcpath}/cmake/modules/FindMySQLAmarok.cmake
    }
}

variant mariadb55 \
    conflicts mysql51 mysql55 mysql56 \
    description {build with mariadb port} {

    depends_lib-append      port:mariadb

    pre-configure {
        reinplace "s|@MYSQL@|mariadb|g" \
            ${worksrcpath}/cmake/modules/FindMySQLAmarok.cmake
    }
}

if {![variant_isset mysql51] && ![variant_isset mysql55] && ![variant_isset mysql56] \
    && ![variant_isset mariadb55]} {
    default_variants +mariadb55
}

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