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

github.setup                hunspell hunspell 1.7.3 v
github.tarball_from         releases
revision                    0

license                     {GPL-2+ LGPL-2.1+ MPL-1.1+}
categories                  textproc
maintainers                 nomaintainer

description                 Spell checker and morphological analyzer
long_description            Hunspell is a spell checker and morphological analyzer library and program \
                            designed for languages with rich morphology and complex word compounding or \
                            character encoding. Hunspell interfaces: Ispell-like terminal interface \
                            using Curses library, Ispell pipe interface, OpenOffice.org UNO module.

homepage                    https://hunspell.github.io/

checksums                   rmd160  dd76f84bba0c0a44498c070e392454cf8b767959 \
                            sha256  433274dac0619cb00c2e18b43a3dd3a9d50da5b5613fa9b5c21781e35dd76bc1 \
                            size    1605476

conflicts                   freeling

# error: 'class std::vector<w_char, std::allocator<w_char> >'has no member named 'data'
compiler.cxx_standard       2011

patchfiles                  patch-hunspell.cxx.diff

depends_lib                 port:gettext port:ncurses port:readline

use_autoreconf              yes
autoreconf.args             -fvi

configure.cppflags-append   -DLIBDIR=\\"${prefix}/share/hunspell\\"
configure.args              --with-ui --with-readline

if {${os.major} < 15} {
    compiler.thread_local_storage yes
}

test.run                    yes
test.target                 check

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING COPYING.LESSER COPYING.MPL \
        ChangeLog NEWS README THANKS ${destroot}${docdir}
}

notes "
You must install (at least) one of the language dictionaries after installing\
this port in order for it to work.
"
