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

name            gconf
set my_name     GConf
epoch           1
version         3.2.6
revision        4
set branch      [join [lrange [split ${version} .] 0 1] .]
maintainers     nomaintainer
categories      gnome
platforms       darwin
license         GPL-2+
description     GConf is a configuration database system.

long_description \
                GConf is a configuration database system, \
                functionally similar to the Windows registry \
                but lots better. :-) It's written for \
                the GNOME desktop but does not require GNOME.

homepage        https://www.gnome.org/projects/gconf/
master_sites    gnome:sources/${my_name}/${branch}/
distname        ${my_name}-${version}

use_xz          yes

checksums       rmd160  63c382672abfcee51440ff1e1524020e82fc304c \
                sha256  1912b91803ab09a5eed34d364bf09fe3a2a9c96751fde03a4e0cfa51a04d784c

depends_build   port:pkgconfig \
                port:gtk-doc \
                port:intltool \
                port:gnome-common \
                port:autoconf \
                port:automake \
                port:libtool

depends_lib     path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                port:libxml2 \
                port:dbus-glib \
                port:policykit \
                port:orbit2

gobject_introspection yes

configure.args  --disable-silent-rules \
                --enable-gsettings-backend \
                --with-gtk=3.0 \
                --without-openldap

# reconfigure using upstream autogen.sh for intltool 0.51 compatibility

post-patch {
    xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
}

configure.cmd   ./autogen.sh

destroot.keepdirs \
    ${destroot}${prefix}/etc/gconf/gconf.xml.mandatory \
    ${destroot}${prefix}/etc/gconf/gconf.xml.defaults

variant openldap description {Enable support for openldap} {
               depends_lib-append path:lib/libldap.dylib:openldap
               configure.args-delete --without-openldap
}

variant quartz conflicts x11 {}
variant x11 conflicts quartz {}

if {![variant_isset quartz]} {
        require_active_variants gtk3 x11 quartz
        default_variants +x11
} else {
        require_active_variants gtk3 quartz x11
}

post-activate {
    system "${prefix}/bin/gio-querymodules ${prefix}/lib/gio/modules"
}

livecheck.type  gnome
livecheck.name  ${my_name}