# -*- 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 86619 2011-10-29 22:33:59Z devans@macports.org $

PortSystem 1.0

name            telepathy-farsight
version         0.0.19
revision        1
license         LGPL-2.1+
description     The ${name} component of Telepathy - a Flexible Communications Framework
long_description \
                ${description} \
                Telepathy-farsight is a GObject-based C library that uses Telepathy GLib, Farsight and GStreamer \
                to implement media streaming for channels with the MediaSignalling interface.

maintainers     devans openmaintainer
categories      comms
platforms       darwin
homepage        http://telepathy.freedesktop.org/wiki/Telepathy-Farsight
master_sites    http://telepathy.freedesktop.org/releases/${name}/

checksums       sha1    15357e24346c6a67f9d3c609184367babc0f0019 \
                rmd160  ab10a100e9c2178439f8aa87c66d76f3664ed8f0

depends_build   port:pkgconfig \
                port:gtk-doc

depends_lib     port:telepathy-glib \
                port:farsight2

patchfiles      patch-python-pytpfarsightmodule.c.diff \
                patch-configure.diff

post-patch      {
                    reinplace "s|__MP_PYTHON_PREFIX__|${frameworks_dir}/Python.framework/Versions/2.6|" ${worksrcpath}/configure
                }


configure.args  --disable-python \
                --disable-silent-rules

variant python26 conflicts python27 description {Enable building of Python 2.6 bindings} {
                configure.args-delete       --disable-python
                depends_lib-append          port:py26-gst-python
                set python_pkg_config_path  ${frameworks_dir}/Python.framework/Versions/2.6/lib/pkgconfig
                configure.pkg_config_path   ${python_pkg_config_path}
                configure.python            ${prefix}/bin/python2.6
                build.env-append            PKG_CONFIG_PATH=${python_pkg_config_path}
}

variant python27 conflicts python26 description {Enable building of Python 2.7 bindings} {
                configure.args-delete       --disable-python
                depends_lib-append          port:py27-gst-python
                set python_pkg_config_path  ${frameworks_dir}/Python.framework/Versions/2.7/lib/pkgconfig
                configure.pkg_config_path   ${python_pkg_config_path}
                configure.python            ${prefix}/bin/python2.7
                build.env-append            PKG_CONFIG_PATH=${python_pkg_config_path}
}

#
# upgrade old python variant to python27 which is now a default variant
#

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

livecheck.type  regex
livecheck.url   ${master_sites}
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
