# -*- 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
# $Id: Portfile 118935 2014-04-14 02:00:10Z devans@macports.org $

PortSystem      1.0

name            vino
version         3.12.0
license         GPL-2
set branch      [join [lrange [split ${version} .] 0 1] .]
homepage        https://wiki.gnome.org/Projects/Vino
description     Vino is a VNC server for the current GNOME user
long_description    ${description}
categories      gnome
platforms       darwin
maintainers     devans openmaintainer
master_sites    gnome:sources/${name}/${branch}/

use_xz          yes

checksums       rmd160  c7069f40f3e3b633cbad321edb1bfcfd3361d987 \
                sha256  86c9d8b60d79982e4488815db0d441c398e011ad8262659789afecc97a01ca5b

depends_build   port:pkgconfig \
                port:intltool \
                port:gnome-common

depends_lib     port:desktop-file-utils \
                port:gtk3 \
                port:dbus-glib \
                port:telepathy-glib \
                port:libsoup \
                port:libnotify \
                port:libsecret \
                port:gnutls \
                port:libgcrypt \
                port:xorg-libXdamage \
                port:xorg-libXext \
                port:xorg-libXtst \
                port:jpeg \
                port:zlib

# update m4/intltool.m4 and autoreconf

pre-configure {
    copy -force ${prefix}/share/aclocal/intltool.m4 ${worksrcpath}/m4
}

use_autoreconf  yes
autoreconf.args -fvi

configure.cflags-append \
                -Wno-format-nonliteral

configure.args  --x-includes=${prefix}/include \
                --x-libraries=${prefix}/lib \
                --disable-silent-rules \
                --disable-schemas-compile \
                --without-network-manager \
                --without-avahi \
                --enable-http-server=no \
                --enable-ipv6

variant avahi description {Enable mDNS support using avahi} {
    depends_lib-append      port:avahi
    configure.args-replace  --without-avahi --with-avahi
}

variant debug description {Enable debugging messages} {
    configure.args-append   --enable-debug
}

post-activate {
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
}

livecheck.type  gnome
