# -*- 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.2
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  256e0001148ba15ce4c138dcc4fa129db6096d36 \
                    sha256  d4d65933b704d4c8d4ca9747dc511b883e35099abe534c8560f2aab3017e4cd4 \
                    size    115910

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