# -*- 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
# $Id: Portfile 115644 2014-01-07 19:50:17Z cal@macports.org $

PortSystem      1.0
PortGroup       muniversal 1.0
PortGroup       active_variants 1.1

name            gconf
set my_name     GConf
epoch           1
version         3.2.6
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        http://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

depends_lib     port:gtk3 \
                port:libxml2 \
                port:gobject-introspection \
                port:dbus-glib \
                port:policykit \
                port:orbit2

configure.args  --with-gtk=3.0 \
                --without-openldap \
                --enable-introspection=yes \
                --enable-gsettings-backend

# Don't do intltool's INTLTOOL_PERL dance
use_autoreconf  yes
autoreconf.args -fvi

# gobject-introspection uses g-ir-scanner, which uses $CC from env

if {[variant_isset universal]} {
    foreach arch ${configure.universal_archs} {
        lappend merger_build_args(${arch})  CC='${configure.cc} -arch ${arch}'
    }
} else {
    build.args-append       CC="${configure.cc} ${configure.cc_archflags}"
}

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 port: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
}

# The rules enabled by gobject-introspection require GNU make 3.81+
platform darwin 8 {
    depends_build-append    port:gmake
    build.cmd               ${prefix}/bin/gmake
}

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

livecheck.type  gnome
livecheck.name  ${my_name}
