# -*- 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 87354 2011-11-18 00:44:04Z rmstonecipher@macports.org $

PortSystem      1.0
PortGroup       muniversal 1.0

name            anjuta
version         2.30.2.1
revision        3
license         GPL-2
set branch      [join [lrange [split ${version} .] 0 1] .]
description     A GNOME/GTK IDE
long_description        ${description}
maintainers     devans openmaintainer
categories      gnome devel
platforms       darwin
homepage        http://anjuta.sourceforge.net/
master_sites    gnome:sources/${name}/${branch}/

checksums       md5     2bbae82e9938ce5db716ee7525c8e869 \
                sha1    163de0820e9559353114484566425d155ea692af \
                rmd160  9c864a7dc98e072c1bd1730ae7774d7d0b81f97b

depends_build   port:pkgconfig \
                port:intltool \
                port:gnome-doc-utils \
                port:gtk-doc \
                port:p5.12-locale-gettext

depends_lib     port:autogen \
                port:gconf \
                port:gdl \
                port:libgda4 \
                port:libunique \
                port:vte

depends_run     port:rarian

post-patch {
        reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.12|" ${worksrcpath}/scripts/builder2schema.pl
}

configure.perl  ${prefix}/bin/perl5.12
configure.args  --enable-static \
                --disable-scrollkeeper \
                --disable-schemas-install \
                --disable-plugin-devhelp \
                --disable-plugin-glade \
                --disable-plugin-sourceview \
                --disable-plugin-subversion

if {${configure.compiler} == "clang"} { 
    configure.compiler llvm-gcc-4.2 
}

variant devhelp description {Enable devhelp plugin support} {
                configure.args-delete   --disable-plugin-devhelp
                depends_lib-append      port:devhelp
}

variant sourceview description {Enable gtksourceview editor plugin support instead of scintilla} {
                configure.args-delete   --disable-plugin-sourceview
                depends_lib-append      port:gtksourceview2
}

variant subversion description {Enable subversion plugin support} {
                configure.args-delete   --disable-plugin-subversion
                configure.args-append   --with-subversion-dir=${prefix} \
                                        --with-svn-include=${prefix}/include/subversion-1 \
                                        --with-svn-lib=${prefix}/lib
                depends_lib-append      port:subversion
}

post-activate {
        system "scrollkeeper-update"
        system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"
        system "export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` && \
             gconftool-2 --makefile-install-rule ${prefix}/etc/gconf/schemas/*.schemas"
}

livecheck.type  regex
livecheck.url   http://ftp.gnome.org/pub/gnome/sources/${name}/${branch}/
livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)}
