# -*- 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 119420 2014-04-25 05:28:31Z devans@macports.org $

PortSystem          1.0

name                gtkspell3
version             3.0.6
license             GPL-2+
categories          x11 gnome textproc
platforms           darwin
maintainers         devans openmaintainer
description         Library for highlighting and replacement of misspelled words
long_description    GtkSpell provides word-processor-style highlighting and replacement of \
                    misspelled words in a GtkTextView widget. Right-clicking a misspelled \
                    word pops up a menu of suggested replacements.
homepage            http://gtkspell.sourceforge.net
master_sites        ${homepage}/download

checksums           rmd160  68c980080e74b232088b40767e757fd4f6555fdc \
                    sha256  01372e5b1648d6c752bad390eda048f52ea44ca3d32a78f5a589cbfe5f6b0ac3

depends_build       port:pkgconfig \
                    port:intltool

depends_lib         port:gtk3 \
                    port:iso-codes \
                    port:enchant \
                    port:gobject-introspection \
                    port:vala

# update build/intltool.m4 and autoreconf

pre-configure {
    copy -force ${prefix}/share/aclocal/intltool.m4 ${worksrcpath}/build
}

use_autoreconf      yes
autoreconf.args     -fvi

configure.args      --disable-gtk2 \
                    --enable-gtk3 \
                    --enable-introspection=yes \
                    --enable-vala=yes \
                    --disable-silent-rules

variant gtk2 description {Build with support for GTK+ 2} {
    depends_lib-append  port:gtk2
    configure.args-replace  --disable-gtk2 --enable-gtk2
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     "The latest version is <b>(\\d+(?:\\.\\d+)*)</b>"
