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

PortSystem          1.0
PortGroup           yelp 1.0

name                empathy
version             3.12.14
revision            3
license             GPL-2+ LGPL-2.1+ GFDL-1.3+ CC-BY-SA-3
set branch          [join [lrange [split ${version} .] 0 1] .]
description         Empathy is an instant-messaging(chat) program for GNOME
long_description    Empathy is an instant-messaging(chat) program which supports text, \
                    voice, video, file transfers, and inter-application communication (tubes) \
                    over many different protocols(Google, Jabber, Facebook, SIP, Yahoo, etc).
maintainers         {devans @dbevans} openmaintainer
categories          gnome
platforms           darwin
homepage            https://wiki.gnome.org/Apps/Empathy
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  6a0a78ddef2859c22662798f91b0be5e595823c9 \
                    sha256  7d86942ce97edd10ade0e6ae6a210d35e4d627fe4d223377d71fd1840bc6e3a3 \
                    size    5017776

depends_build       port:pkgconfig \
                    port:intltool \
                    port:itstool \
                    port:yelp-tools \
                    port:gnome-common \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    port:libxslt \
                    port:python27

depends_lib         port:desktop-file-utils \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    port:dbus-glib \
                    port:folks \
                    port:libsecret \
                    port:gsettings-desktop-schemas \
                    port:libxml2 \
                    port:telepathy-glib \
                    port:telepathy-logger \
                    port:libcanberra \
                    port:libnotify \
                    port:gcr \
                    port:pulseaudio \
                    path:lib/pkgconfig/webkit2gtk-4.0.pc:webkit2-gtk \
                    port:libsoup-2.4 \
                    port:libgee  \
                    port:telepathy-farstream \
                    port:clutter-gtk \
                    port:clutter-gst3 \
                    port:gstreamer1 \
                    port:enchant \
                    port:iso-codes \
                    port:xorg-libX11

depends_run         port:telepathy-mission-control \
                    port:telepathy-idle \
                    port:telepathy-gabble \
                    port:telepathy-haze \
                    port:telepathy-salut \
                    port:gnome-keyring \
                    port:adwaita-icon-theme

license_noconflict  dbus-glib gnutls

use_parallel_build  no

configure.cmd       ./autogen.sh
configure.python    ${prefix}/bin/python2.7

configure.args      --x-includes=${prefix}/include \
                    --x-libraries=${prefix}/lib \
                    --enable-gst-1.0=yes \
                    --enable-debug \
                    --enable-gudev=no \
                    --enable-spell=yes \
                    --enable-map=no \
                    --enable-location=no \
                    --enable-geocode=no \
                    --enable-nautilus-sendto=no \
                    --enable-goa=no \
                    --without-cheese \
                    --enable-ubuntu-online-accounts=no \
                    --disable-coding-style-checks \
                    --disable-schemas-compile \
                    --disable-silent-rules \
                    --disable-Werror

#
# folks is not universal
#

universal_variant   no

variant map description {Enable map view} {
    depends_lib-append      port:libchamplain
    configure.args-replace  --enable-map=no --enable-map=yes
}

variant geocode description {Enable geocode support} {
    depends_lib-append      port:geocode-glib
    configure.args-replace  --enable-geocode=no --enable-geocode=yes
}

variant location description {Enable location awareness using geoclue2 (broken)} {
    depends_lib-append      port:geoclue2
    configure.args-replace  --enable-location=no --enable-location=yes
}

variant goa description {Enable GNOME online accounts plugin for mission control} {
    depends_lib-append      port:gnome-online-accounts \
                            port:telepathy-mission-control
    configure.args-replace  --enable-goa=no --enable-goa=yes
}

default_variants    +map +geocode +goa

post-activate {
    system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
}

livecheck.type      gnome