# -*- 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           perl5 1.0

github.setup        AlDanial cloc 1.80 v
perl5.branches      5.26
categories          textproc devel
license             GPL-2 Artistic-1
platforms           darwin
supported_archs     noarch
maintainers         nomaintainer
description         counts lines of source code
long_description    cloc counts blank lines, comment lines, and physical \
                    lines of source code in many programming languages. \
                    Given two versions of a code base, cloc can compute \
                    differences in blank, comment, and source lines.

checksums           rmd160  cba37e0852ce7e3ce4ae3fa39acfc25623905050 \
                    sha256  4317933344b2d2fa0de6f9abac74c19f51ec4f047aa45fa3fe1872f61f2eb0ec \
                    size    451931

depends_run-append  port:perl${perl5.major} \
                    port:p${perl5.major}-algorithm-diff \
                    port:p${perl5.major}-parallel-forkmanager \
                    port:p${perl5.major}-regexp-common \
                    port:p${perl5.major}-digest-md5

patchfiles          patch-Makefile-perl.diff

post-patch {
    reinplace -W ${worksrcpath} \
        "s|^#!/usr/bin/env perl|#!${perl5.bin}|" \
         cloc
    reinplace -W ${worksrcpath} \
        "s|__PERL__|${perl5.bin}|" \
         Makefile
}

worksrcdir          ${distname}/Unix

use_configure       no
build               {}

destroot.args-append prefix=${prefix}