# -*- 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.2 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from         tarball
revision                    0
license                     {GPL-2+ LGPL-2.1+ MPL-1.1+}
categories                  textproc
maintainers                 nomaintainer
description                 Spell checker and morphological analyzer
homepage                    https://hunspell.github.io/

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.

checksums                   rmd160  5c5ee430a8a0670686c9020c8bfeebe20e727015 \
                            sha256  d8aacc45042f42233c5871d65f44ae5299df0d631ca1ad7ded55fc8d2945e765 \
                            size    981446

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.
"
