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

PortSystem          1.0
PortGroup           gobject_introspection 1.0

name                gtkspell3
version             3.0.10
license             GPL-2+
categories          x11 gnome textproc
platforms           darwin
maintainers         {devans @dbevans} 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        sourceforge:project/gtkspell/${version}

use_xz              yes

checksums           rmd160  db7e6f023e55fda96f630e88f7e9d945ec2dc6b9 \
                    sha256  b040f63836b347eb344f5542443dc254621805072f7141d49c067ecb5a375732 \
                    size    300968

depends_build       port:pkgconfig \
                    port:intltool \
                    port:gtk-doc \
                    port:autoconf-archive \
                    port:autoconf \
                    port:automake \
                    port:libtool

depends_lib         port:gtk3 \
                    port:iso-codes \
                    port:enchant2 \
                    port:vala

gobject_introspection yes

# reconfigure using upstream autogen.sh for intltool 0.51 compatibility

pre-patch {
    copy ${worksrcpath}/autogen.sh ${worksrcpath}/autogen.sh.orig
}

patchfiles          patch-autogen.sh.diff

configure.cmd       ./autogen.sh
configure.args      --disable-gtk2 \
                    --enable-gtk3 \
                    --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>"