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

# Fallback until a newer version is fixed for Qt4.
# At the moment no version of Qt5 builds on Darwin PowerPC.
# https://github.com/qxmpp-project/qxmpp/issues/631
if {${os.platform} eq "darwin" && ${configure.build_arch} in [list ppc ppc64]} {
    PortGroup       qt4 1.0

    github.setup    qxmpp-project qxmpp 0.9.3 v
    revision        1
    checksums       rmd160  4387326e2b5116b01cc5bdc3f7efe43e26151a5f \
                    sha256  13f5162a1df720702c6ae15a476a4cb8ea3e57d861a992c4de9147909765e6de \
                    size    300764
    github.tarball_from archive

    configure.cmd   ${qt_qmake_cmd}

    configure.pre_args \
                    PREFIX=${prefix} \
                    QXMPP_USE_OPUS=1 \
                    QXMPP_USE_SPEEX=1 \
                    QXMPP_USE_THEORA=1 \
                    QXMPP_USE_VPX=1
} else {
    PortGroup       cmake 1.1
    PortGroup       qt5 1.0

    github.setup    qxmpp-project qxmpp 1.1.0 v
    revision        3
    checksums       rmd160  7f40f680706acda6dbc2c8447780932e04820804 \
                    sha256  cea26726aa3d77462ea8ce4e5c3eb26b99f599d7492e3409a31820853bef8341 \
                    size    286805

    configure.args-append \
                    -DWITH_OPUS=ON \
                    -DWITH_SPEEX=ON \
                    -DWITH_THEORA=ON \
                    -DWITH_VPX=ON
}

categories      devel net
license         LGPL-2.1
maintainers     nomaintainer

description     Cross-platform C++ XMPP library
long_description \
    QXmpp is a cross-platform C++ XMPP library built upon Qt. \
    It strives to be as easy to use as possible.

depends_lib-append \
                port:libopus \
                port:libtheora \
                path:lib/pkgconfig/vpx.pc:libvpx \
                port:speex
