# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem      1.0
PortGroup       meson 1.0

name            libsecret
version         0.21.4
revision        0

categories      gnome security
license         LGPL-2.1
maintainers     nomaintainer

description     ${name} is a library for storing and retrieving passwords \
                and other secrets
long_description \
                libsecret is a client for the Secret Service DBus API. The Secret \
                Service allows storage of passwords in a common way on the desktop. \
                Supported by gnome-keyring and ksecretservice.
homepage        https://wiki.gnome.org/Projects/Libsecret

# Disable unexpected download of subprojects
meson.wrap_mode nodownload

set branch      [join [lrange [split ${version} .] 0 1] .]
master_sites    gnome:sources/${name}/${branch}/
use_xz          yes

checksums       rmd160  acd5c1f062dbbb465ec12a09dec0fb588a4da859 \
                sha256  163d08d783be6d4ab9a979ceb5a4fecbc1d9660d3c34168c581301cd53912b20 \
                size    206636

# Upstream patch for dylib versioning; expected to be included in next release.
# See: https://gitlab.gnome.org/GNOME/libsecret/-/merge_requests/143
patchfiles-append \
                patch-meson-dylib-versions.diff

depends_build-append \
                port:docbook-xml \
                port:docbook-xsl-nons \
                port:gettext \
                port:gsed \
                port:libxslt \
                path:bin/pkg-config:pkgconfig \
                path:bin/vala:vala

depends_lib-append \
                port:gettext-runtime \
                path:lib/pkgconfig/glib-2.0.pc:glib2 \
                path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
                port:libgcrypt

configure.args-append \
                -Dgtk_doc=false

# error: incompatible function pointer types passing 'void (gpointer)' (aka 'void (void *)') to parameter of type 'GTestDataFunc' (aka 'void (*)(const void *)') [-Wincompatible-function-pointer-types]
# https://gitlab.gnome.org/GNOME/vala/-/issues/1413
if {[string match *clang* ${configure.cc}]} {
    configure.cflags-append \
                -Wno-error=incompatible-function-pointer-types
}

# This project does not use the old even=stable/odd=unstable GNOME versioning convention.
livecheck.type  gnome-with-unstable
