# -*- 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
PortGroup           waf 1.0

github.setup        jubatus jubatus 1.1.1
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0

categories          devel math textproc
maintainers         nomaintainer

description         Distributed Online Machine Learning Framework

long_description    The Jubatus library is a online machine learning framework \
                    which runs in distributed environment. Jubatus library includes \
                    these functions: multi-class/binary classification, pre-proccessing \
                    data (for natural language), and process management.

homepage            http://jubat.us/
license             {LGPL-2.1 BSD}

checksums           rmd160  16eb7df068bfee1c263d5d343fe699760223532c \
                    sha256  40b929705744e6313b3674bc0e504cdd0424865bb0a258ddd9db5957773a7395 \
                    size    552510

depends_build-append port:pkgconfig

depends_lib         port:jubatus_core \
                    port:msgpack0 \
                    port:jubatus-mpio \
                    port:jubatus-msgpack-rpc \
                    port:log4cxx \
                    port:mecab-utf8 \
                    port:ux-trie \
                    port:libzookeeper

platform darwin {
    if {${os.major} <= 10} {
        known_fail  yes
        pre-fetch {
            ui_error "$name does not build on Snow Leopard or earlier."
            error "unsupported platform"
        }
    } elseif {${os.major} >= 13} {
        configure.cxxflags-append  "-std=c++11 -DMP_FUNCTIONAL_STANDARD -DMP_MEMORY_STANDARD -DMP_UNORDERED_MAP_STANDARD"
    }
}

configure.args-append    --enable-mecab --enable-ux --enable-zookeeper

# shipped waf does not recognize --nocache
configure.post_args-delete \
                    --nocache

post-destroot {
    # install additional documents.
    set doc_dir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${doc_dir}
    xinstall -m 644 -W ${worksrcpath} \
        CONTRIBUTING.md \
        ChangeLog.rst \
        LICENSE \
        README.rst \
        ${doc_dir}
}
