# -*- 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           meson 1.0
PortGroup           gobject_introspection 1.0
PortGroup           active_variants 1.1

name                libnotify
version             0.8.8
revision            1
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          devel gnome
maintainers         nomaintainer
description         pop-up notification library
long_description \
                    The Desktop Notifications framework provides a standard way of doing \
                    passive pop-up notifications.

license             LGPL-2.1+

homepage            https://gitlab.gnome.org/GNOME/libnotify
master_sites        gnome:sources/${name}/${branch}

use_xz              yes

checksums           rmd160  30aa067351a643ef7c98310622f590828884893c \
                    sha256  23420ef619dc2cb5aebad613f4823a2fa41c07e5a1d05628d40f6ec4b35bfddd \
                    size    115644

depends_build-append \
                    path:bin/pkg-config:pkgconfig \
                    port:gi-docgen \
                    port:docbook-xsl-ns \
                    port:libxslt \
                    port:xmlto

depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gdk-pixbuf-2.0.pc:gdk-pixbuf2

gobject_introspection   yes

patchfiles          launch-context.c.patch

# Tests require gtk3
configure.args      -Dtests=false

pre-activate {
	if {${os.major} == 11 && ${os.minor} < 2 && ${os.platform} eq "darwin"} {
		ui_error "You must first update to OS X 10.7.2."
		return -code error "You must first update to OS X 10.7.2."
	}
}

variant x11 {
    require_active_variants path:lib/pkgconfig/glib-2.0.pc:glib2 x11
}

# Needed to avoid symbol not found: _g_desktop_app_info_new
variant quartz {
    require_active_variants path:lib/pkgconfig/glib-2.0.pc:glib2 quartz
}

if {![variant_isset quartz]} {
    default_variants +x11
}
if {![variant_isset x11]} {
    default_variants +quartz
}
if {![variant_isset quartz] && ![variant_isset x11]} {
    error "Either +x11 or +quartz is required"
}

livecheck.type      gnome-with-unstable
