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

name            libsecret
version         0.21.7
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  bf9000234d6a4aed21a34f7336c23a44f2c63bae \
                sha256  6b452e4750590a2b5617adc40026f28d2f4903de15f1250e1d1c40bfd68ed55e \
                size    207692

# 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 \
                port:libgcrypt

gobject_introspection   yes

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
}

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

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