# -*- 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 107716 2013-07-04 16:21:25Z jeremyhu@macports.org $

PortSystem      1.0
PortGroup       muniversal 1.0
PortGroup       active_variants 1.1

name            gconf
set my_name     GConf
epoch           1
# Issues in https://trac.macports.org/ticket/28077 are now resolved
version         2.32.4
revision        2
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_bzip2       yes

checksums       rmd160  8f7aa9fb72deb935546b503b4f8547099be459e3 \
                sha256  46030c09422603dbb72f13b5dd592dcc01fbc13562b9e94dafb2b58982bc6b3a

depends_build   port:pkgconfig \
                port:gtk-doc \
                port:intltool

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

configure.args  --with-gtk=2.0 \
                --without-openldap \
                --enable-introspection=yes

# 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 gtk2 x11 quartz
        default_variants +x11
} else {
        require_active_variants gtk2 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}
