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

gitlab.instance     https://gitlab.freedesktop.org
gitlab.setup        geoclue geoclue 2.8.1
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  de70863cbc43d43283a473b3939b8b97fbab03fc \
                    sha256  1b5de03936bd8c031a1f6207c1857fa25a9aa1453ffe742f32a0a4a3281f2629 \
                    size    113472

set py_ver          3.14
set py_ver_nodot    [string map {. {}} ${py_ver}]

depends_build       port:gettext \
                    path:bin/pkg-config:pkgconfig \
                    path:bin/vala:vala \
                    port:python${py_ver_nodot}

depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:json-glib \
                    port:gettext-runtime \
                    path:lib/pkgconfig/libsoup-3.0.pc:libsoup

license_noconflict  vala

gobject_introspection yes

configure.python    ${prefix}/bin/python${py_ver}

meson.native.binaries   python3=${configure.python}

configure.args      -D3g-source=false \
                    -Dcdma-source=false \
                    -Dmodem-gps-source=false \
                    -Dnmea-source=false \
                    -Dgtk-doc=false \
                    -Ddemo-agent=false

pre-configure {
    configure.args-replace  -Dintrospection=enabled -Dintrospection=true
}

variant doc description {Build and install gtk-doc API docs} {
    depends_build-append    port:gtk-doc
    configure.args-replace  -Dgtk-doc=false -Dgtk-doc=true
}

variant nmea description {Enable support for NMEA GPS sources using Avahi} {
    depends_lib-append      port:avahi
    configure.args-replace  -Dnmea-source=false -Dnmea-source=true
}

variant demoagent conflicts quartz description {Enable support for demo agent} {
    configure.args-replace \
                    -Ddemo-agent=false \
                    -Ddemo-agent=true
}

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.
}
