# -*- 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                spice-gtk
version             0.34
revision            1
maintainers         {danchr @danchr} openmaintainer
categories          devel
license             LGPL-2.1+
platforms           darwin
description         VNC viewer widget for GTK

long_description    gtk-vnc is a VNC viewer widget for GTK. It is built using \
                    coroutines allowing it to be completely asynchronous  \
                    while remaining single threaded. It provides a core C  \
                    library, and bindings for Python (PyGTK). \
                    \
                    GTK-VNC supports a number of VNC extensions aimed at  \
                    improving the user experience, particularly when  \
                    interacting with virtual machines.

homepage            https://www.spice-space.org/page/Spice-Gtk
master_sites        https://www.spice-space.org/download/gtk/

use_bzip2           yes

checksums           rmd160  3c238174b293d09be175839630bcc730682f0b78 \
                    sha256  e9720e01165f8451c9f3f58ad50e3afb990993b81cc2db86b3661b7ac5b976ee

depends_build-append \
                    port:pkgconfig \
                    port:intltool port:vala

depends_lib \
    port:spice-protocol \
    port:gtk3 \
    path:lib/pkgconfig/pixman-1.pc:libpixman \
    port:lz4 \
    port:jpeg \
    port:pulseaudio \
    port:libepoxy \
    port:libusb

# for ucontext
configure.cppflags-append \
                -D_XOPEN_SOURCE

variant quartz {
    # src/vncdisplaykeymap.c includes <gdk/gdkquartz.h>, which in turn
    # includes AppKit -- and that one fails hard in a regular C compiler...
    configure.cflags-append \
        -ObjC
}

if {[variant_isset quartz]} {
    require_active_variants gtk3 quartz
} else {
    require_active_variants gtk3 "" quartz
}