# -*- 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        blackducksoftware ohcount 3.1.1 v
revision            0
checksums           rmd160  6e9e9f35e9ced6b83d5c5fb350b46044f00e0348 \
                    sha256  4be27e54ac0fb5016fe2f09c2f54ec0139e67d9e2d9ee2e8569f8dfb4e56f59f \
                    size    1282124

categories      textproc devel
license         GPL-2
maintainers     nomaintainer
description     Ohcount is a source code line counter.
long_description \
    Ohcount identifies source code files in most common programming languages, \
    and prepares total counts of code and comments. It can operate on single files \
    or entire directory trees. Ohcount can produce line-by-line analysis of files \
    for detailed debugging.

github.tarball_from archive

depends_build       port:gperf \
                    port:ragel

depends_lib         port:libmagic \
                    port:pcre

patchfiles      patch-build.diff
patchfiles-append   ohcount_hash_parser_from_language.patch

post-patch {
    reinplace "s|@CC@|${configure.cc} [get_canonical_archflags cc]|g;s|@PREFIX@|${prefix}|g" ${worksrcpath}/build
}

use_configure   no
build.cmd       ./build ohcount && ./build shared

test.run            yes
test.cmd            ./build tests

destroot {
    xinstall -m 0755 -W ${worksrcpath} bin/${name} ${destroot}${prefix}/bin
    xinstall -m 0755 -W ${worksrcpath} src/lib${name}.dylib ${destroot}${prefix}/lib
}
