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

name                accountsservice
# unconditional use of <shadow.h> breaks macos build for 0.6.43+
# caused by an attempt to fix
# https://bugs.freedesktop.org/show_bug.cgi?id=48177
# using the following commit
# https://cgit.freedesktop.org/accountsservice/commit/src?id=14ca4245b6c842b9c69f0c245bdd6d38bd7f1cb6
# don't update further until this is addressed
version             0.6.42
revision            2
description         AccountsService provides a set of D-Bus interfaces for querying \
                    and manipulating user account information.

long_description    ${description}
maintainers         nomaintainer
categories          gnome security
platforms           darwin
license             GPL-3+
homepage            https://www.freedesktop.org/wiki/Software/AccountsService/
master_sites        https://www.freedesktop.org/software/accountsservice/

use_xz              yes

checksums           rmd160  72b3025468b855d50517729530a92e5cb31ca82e \
                    sha256  e56494c2f18627900b57234e5628923cc16a37bf8fd16b06c46118d6ae9c007e

depends_build       port:pkgconfig \
                    port:intltool \
                    port:xmlto \
                    port:libxslt \
                    port:gtk-doc \
                    port:autoconf \
                    port:automake \
                    port:libtool

depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:policykit

patchfiles          patch-define-wtmpx_filename.diff \
                    patch-src-daemon.c.diff \
                    patch-src-libaccountsservice-Makefile.am.diff

post-patch {
    reinplace "s|@@MP_PREFIX@@|${prefix}|" ${worksrcpath}/src/daemon.c
}

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-systemd \
                    --disable-silent-rules

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
