# -*- 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           active_variants 1.1

name                vino
version             3.22.0
revision            2
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 @dbevans} openmaintainer
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  64c44875042ee388870b1f10dd470e5b756c59b8 \
                    sha256  2911c779b6a2c46e5bc8e5a0c94c2a4d5bd4a1ee7e35f2818702cb13d9d23bab

depends_build       port:pkgconfig \
                    port:intltool \
                    port:gnome-common \
                    port:autoconf \
                    port:automake \
                    port:libtool

depends_lib         port:desktop-file-utils \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    port:dbus-glib \
                    port:telepathy-glib \
                    port:libnotify \
                    port:libsecret \
                    path:lib/pkgconfig/gnutls.pc:gnutls \
                    port:libgcrypt \
                    port:xorg-libXdamage \
                    port:xorg-libXext \
                    port:xorg-libXtst \
                    port:xorg-libice \
                    port:xorg-libsm \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:zlib

# vino only builds with gtk3 +x11

require_active_variants path:lib/pkgconfig/gtk+-3.0.pc:gtk3 x11

# reconfigure using upstream autogen.sh for intltool 0.51 compatibility

configure.cmd       ./autogen.sh

configure.args      --x-includes=${prefix}/include \
                    --x-libraries=${prefix}/lib \
                    --disable-silent-rules \
                    --disable-schemas-compile \
                    --enable-compile-warnings=minimum \
                    --without-avahi \
                    --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
