# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 107896 2013-07-08 20:08:10Z devans@macports.org $

PortSystem      1.0
PortGroup       active_variants 1.1

name            glade
version         3.14.2
license         LGPL-2 GPL-2
set branch      [join [lrange [split ${version} .] 0 1] .]
description     Glade is a RAD tool to enable quick & easy development of user interfaces \
                for the GTK+ 3.* toolkit and the GNOME desktop environment.
long_description ${description}
maintainers     devans openmaintainer
categories      devel gnome
platforms       darwin
homepage        http://glade.gnome.org/
master_sites    gnome:sources/${name}/${branch}/

use_xz          yes

checksums       rmd160  687693a677d2c62e47ad849d97585f15e253d9f7 \
                sha256  d2e6b5a20cfdbc0a5ed49122ac7b4e3a10ba140ccfcaba60082e6e2b52a62ac6

depends_skip_archcheck devhelp

depends_build   port:pkgconfig \
                port:itstool \
                port:gnome-doc-utils

depends_lib     port:gtk3 \
                port:libxml2

depends_run     port:desktop-file-utils \
                port:hicolor-icon-theme \
                port:devhelp

patchfiles      patch-configure.diff

#
# disable gobject introspection if building universal
# to match behavior of dependency gtk3
#

if {[variant_isset universal]} {
    require_active_variants     gtk3 universal
    configure.args              --enable-introspection=no
} else {
    require_active_variants     gtk3 "" universal
    depends_lib-append          port:gobject-introspection
    configure.args              --enable-introspection=yes
}

variant python26 conflicts python27 description {Use python 2.6} {
    configure.python            ${prefix}/bin/python2.6
    depends_lib-append          port:py26-gobject3
    set python_framework        ${frameworks_dir}/Python.framework/Versions/2.6
    configure.pkg_config_path   ${python_framework}/lib/pkgconfig
}

variant python27 conflicts python26 description {Use python 2.7} {
    configure.python            ${prefix}/bin/python2.7
    depends_lib-append          port:py27-gobject3
    set python_framework        ${frameworks_dir}/Python.framework/Versions/2.7
    configure.pkg_config_path   ${python_framework}/lib/pkgconfig
}

if {![variant_isset python26]} {
    default_variants +python27
}

post-activate {
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
    system "${prefix}/bin/gtk-update-icon-cache-3.0 -f -t ${prefix}/share/icons/hicolor"
}

livecheck.type  gnome
