# -*- 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$

PortSystem      1.0

name            geany
version         1.26
license         GPL-2+
categories      devel
platforms       darwin
maintainers     si-co.net:kiarash

description     A fast and lightweight GTK+ IDE

long_description \
    Geany is a small and lightweight integrated development \
    environment. It was developed to provide a small and fast \
    IDE, which has only a few dependencies from other packages. \
    Another goal was to be as independent as possible from a \
    special Desktop Environment like KDE or GNOME.

homepage        http://www.geany.org/
master_sites    http://download.geany.org/
use_bzip2       yes

checksums       rmd160  6f1f73067a0e802a7c335e23526024533b9b2249 \
                sha256  e38530e87c577e1e9806be3b40e08fb9ee321eb1abc6361ddacdad89c825f90d

depends_build \
    port:pkgconfig \
    port:intltool \
    port:autoconf \
    port:automake \
    port:libtool
depends_lib \
    port:desktop-file-utils \
    port:gettext \
    port:gtk2 \
    port:vte-gtk2-compat

# reconfigure using distributed autogen.sh for intltool 0.51 compatibility

configure.cmd       ./autogen.sh

configure.args      --disable-silent-rules \
                    --enable-vte

patchfiles          vte-sonames.diff

variant gtk3 description {Enable experimental gtk3 support} {
    depends_lib-replace port:gtk2 port:gtk3
    depends_lib-replace port:vte-gtk2-compat port:vte-2.90
    depends_run-append  port:gnome-themes-standard
    configure.args-append --enable-gtk3
}

if {[variant_isset gtk3]} {
    set update_icon_cache "gtk-update-icon-cache-3.0"
    configure.args-append --with-vte-module-path=${prefix}/lib/libvte2_90.dylib
} else {
    configure.args-append --with-vte-module-path=${prefix}/lib/libvte.dylib
    set update_icon_cache "gtk-update-icon-cache"
}

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

livecheck.type  regex
livecheck.url   ${master_sites}
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"