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

epoch               1
github.setup        s-yata marisa-trie 0.3.1 v
revision            2
categories          textproc
maintainers         nomaintainer
license             {BSD LGPL-2.1+}

description         Static and space-efficient trie data structure
long_description    Matching Algorithm with Recursively Implemented StorAge \
                    (MARISA) is a static and space-efficient trie data structure. \
                    And libmarisa is a C++ library to provide an implementation \
                    of MARISA. Also, the package of libmarisa contains a set of \
                    command line tools for building and operating a MARISA-based \
                    dictionary.
distname            v${version}
checksums           rmd160  c18fca76f11a81ceca670011222174c40dbf26cb \
                    sha256  986ed5e2967435e3a3932a8c95980993ae5a196111e377721f0849cad4e807f3 \
                    size    212791
github.tarball_from archive

cmake.build_type    Release

worksrcdir          ${worksrcdir}

compiler.cxx_standard   2020

configure.args-append \
                    -DBUILD_SHARED_LIBS=ON

post-destroot {
    set docdir         ${prefix}/share/doc/${name}
    xinstall -m 755 -d ${destroot}${docdir}/docs
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS COPYING.md README.md \
        ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath}/docs \
        readme.en.html readme.ja.html style.css \
        ${destroot}${docdir}/docs
}

variant tests description "Enable tests" {
    configure.args-append \
                    -DBUILD_TESTING=ON
    test.run        yes
    test.target     test
}
