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

gitlab.instance     https://gitlab.freedesktop.org
gitlab.setup        geoclue geoclue 2.4.13
name                geoclue2
revision            0
categories          devel net
license             GPL-2+ LGPL-2.1+
maintainers         nomaintainer
description         Geolocation library
long_description    Geoclue is a modular geoinformation service built on top of the D-Bus messaging system. The goal of the Geoclue project is to make creating location-aware applications as simple as possible.

checksums           rmd160  a000cc393708dbed1238c3219bc6df9b23b4ffdb \
                    sha256  282484d2dc82f17a2fab67c001e6799000c23b95a60a99907a96383f58700585 \
                    size    108691

depends_build       port:intltool \
                    port:pkgconfig \
                    port:gtk-doc \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    path:bin/vala:vala

depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:json-glib \
                    port:libnotify \
                    port:libsoup-2.4

gobject_introspection yes

# reconfigure using upstream autogen.sh for intltool 0.51 compatibility

post-patch {
    xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
}

configure.cmd       ./autogen.sh

configure.args      --disable-silent-rules \
                    --disable-3g-source \
                    --disable-cdma-source \
                    --disable-modem-gps-source \
                    --disable-nmea-source \
                    --with-systemdsystemunitdir=no \
                    --enable-demo-agent=no \
                    --enable-compile-warnings=minimum

variant debug description {Build with debug support} {
    configure.args-append   --enable-debug
}

variant doc description {Build and install gtk-doc API docs} {
    configure.args-append   --enable-gtk-doc
}

variant nmea description {Enable support for NMEA GPS sources using Avahi} {
    depends_lib-append      port:avahi
    configure.args-delete   --disable-nmea-source
}

variant demoagent conflicts quartz description {Enable support for demo agent} {
    configure.args-replace \
                    --enable-demo-agent=no \
                    --enable-demo-agent=yes
}

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

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

if {![variant_isset quartz]} {
    default_variants +x11
}

notes {
  The demo agent is now disabled by default, but can be enabled via +demoagent.
}