# -*- 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
# $Id: Portfile 87683 2011-12-01 17:05:39Z devans@macports.org $

PortSystem 1.0

name            empathy
version         2.30.3
revision        7
license         {GPL-2 GFDL-1.3 Attribution-ShareAlike-3.0}
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(AIM, MSN, Google/Jabber, Facebook, SIP, Yahoo, etc).
maintainers     devans openmaintainer
categories      gnome
platforms       darwin
homepage        http://live.gnome.org/Empathy
master_sites    gnome:sources/${name}/${branch}/

checksums       md5     d797f30219da87d4564fb92705626cd3 \
                sha1    1a438198469f623e7051a521ef2590f0da518075 \
                rmd160  57d558c81b166b8e008ee236a258d592b3ac50a3

depends_build   port:pkgconfig \
                port:intltool \
                port:gnome-doc-utils \
                port:gtk-doc

depends_lib     port:gconf \
                port:enchant \
                port:evolution-data-server \
                port:gstreamer \
                port:iso-codes \
                port:libcanberra \
                port:libchamplain \
                port:libgnome-keyring \
                port:libnotify \
                port:libunique \
                port:webkit-gtk

depends_run     port:telepathy-mission-control \
                port:telepathy-logger \
                port:telepathy-farsight \
                port:telepathy-gabble \
                port:telepathy-haze \
                port:telepathy-salut \
                port:gnome-settings-daemon

use_bzip2       yes

patchfiles      patch-configure.diff

configure.args  --mandir=${prefix}/share/man \
                --x-includes=${prefix}/include \
                --x-libraries=${prefix}/lib \
                --enable-webkit=yes \
                --enable-spell=yes \
                --enable-map=yes \
                --enable-location=no \
                --enable-favourite-contacts=no \
                --enable-nautilus-sendto=no \
                --enable-control-center-embedding=no \
                --with-connectivity=no \
                --disable-coding-style-checks \
                --disable-silent-rules \
                --disable-scrollkeeper \
                --disable-schemas-install

#
# enable build on Tiger by disabling map
# support which indirectly depends on mesa
# see #24393.
#

platform darwin 8 {
    depends_lib-delete port:libchamplain
    configure.args-delete --enable-map=yes
    configure.args-append --enable-map=no
}

#
# telepathy-haze -> pidgin is not universal
#

universal_variant no

variant python26 conflicts python27 description {Build using Python 2.6} {
    configure.python          ${prefix}/bin/python2.6
    depends_build-append      port:python26
}

variant python27 conflicts python26 description {Build using Python 2.7} {
    configure.python          ${prefix}/bin/python2.7
    depends_build-append      port:python27
}

if {![variant_isset python26]} {
    default_variants +python27
}

post-activate {
    system "scrollkeeper-update"
    system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"
    system "export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` && \
        gconftool-2 --makefile-install-rule ${prefix}/etc/gconf/schemas/*.schemas"
}

livecheck.type  regex
livecheck.url   http://ftp.gnome.org/pub/gnome/sources/${name}/${branch}/
livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)}
