# -*- 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        tetsuok arowpp 0.1.3 v
revision            0
checksums           rmd160  a639f1cc171e63a51e080f576ef000e9ccd6cc3d \
                    sha256  d3762df1d560d418d16b7b58eec35a573c566575db3c639a54c0f664cccb0edc \
                    size    31413

categories          math textproc
maintainers         nomaintainer

description         AROW++ An implementation of the efficient confidence-weighted classifier

long_description    arowpp (AROW++) is an simple and efficient implementation of \
                    Adaptive Regularization of Weights online learning algorithm \
                    for binary classification. AROW is efficient for learning \
                    tasks such as natural language processing tasks that the \
                    data is high-dimensional, extremely sparse. AROW is an \
                    extension of confidence weighted (CW) algorithm that can \
                    achieve the good performance with a few iterations.

platforms           darwin
license             BSD

github.tarball_from archive

depends_build       port:bazel

patchfiles          fix-build.patch

use_configure       no

compiler.cxx_standard 2011

# Need to figure out how to tell Bazel to use the right compiler and flags.
# Other ports using Bazel, like py-tensorflow, may provide guidance.
build.cmd           ${prefix}/bin/bazel
build.target        build
build.args          //:arow_learn //:arow_test

destroot {
    # The build system doesn't support installing so we have to do it manually.
    # https://github.com/tetsuok/arowpp/issues/3
    xinstall -W ${worksrcpath}/bazel-bin arow_learn arow_test ${destroot}${prefix}/bin
    xinstall -m 0644 -W ${worksrcpath}/src arowpp.h ${destroot}${prefix}/include
    # There isn't a dynamic library anymore.
    # https://github.com/tetsuok/arowpp/issues/6
    xinstall -m 0644 -W ${worksrcpath}/bazel-bin libarowpp.a ${destroot}${prefix}/lib

    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 0644 -W ${worksrcpath} \
        AUTHORS \
        BSD \
        COPYING \
        ChangeLog \
        README.md \
        ${docdir}
}
