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

name                gnome-keyring
epoch               1
version             3.36.0
revision            1
set branch          [join [lrange [split ${version} .] 0 1] .]
maintainers         {devans @dbevans} openmaintainer
categories          gnome
platforms           darwin
license             GPL-2+ LGPL-2
description         GNOME program for storing passwords.

long_description    gnome-keyring is a program that keep passwords and other secrets for \
                    users. It is run as a daemon in the session, similar to ssh-agent, and \
                    other applications locate it via an environment variable or a dbus.

homepage            https://wiki.gnome.org/Projects/GnomeKeyring
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  60556a3a2785a32e87795a3599d6f0ed69622f9f \
                    sha256  a264b57a8d1a71fdf0d66e8cd6033d013fb828be279c35766545eb9bb3734f87 \
                    size    1345360

depends_build       port:pkgconfig \
                    port:docbook-xsl-nons \
                    port:libxslt

depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:dbus \
                    port:gcr \
                    port:libgcrypt

patchfiles          implicit.patch

# blacklist compilers that do not support C11 (redefinition of typedef 'GckSession' in daemon/login/gkd-login.h)
compiler.blacklist  *gcc-3.* *gcc-4.* {clang < 300}

configure.args      --without-libcap-ng \
                    --disable-pam \
                    --disable-p11-tests \
                    --disable-silent-rules \
                    --disable-strict \
                    --disable-schemas-compile

platform darwin {
# On darwin 15 (El Capitan), System Integrity Protection (SIP)
# blocks, by default, any attempt by non-AppStore applications
# to install content in system locations.  This causes
# activation of PAM modules in /usr/lib/pam by MacPorts to fail.
# Disabling optional PAM support on this platform.
    if {${os.major} > 9 && ${os.major} < 15} {
        configure.args-delete --disable-pam
        configure.args-append --with-pam-dir=/usr/lib/pam
        # installs PAM modules into /usr/lib/pam
        destroot.violate_mtree yes
        post-destroot {
            file delete ${destroot}/usr/lib/pam/pam_gnome_keyring.la
        }
    }
}

post-activate {
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
}

livecheck.type      gnome
