# -*- 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.98 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
perl5.branches      5.34
categories          textproc devel
license             {Artistic-1 GPL-2}
supported_archs     noarch
platforms           any
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  7a64b193445b13a58a835fa65e3dbd4b6fac56d6 \
                    sha256  92fee0cb2b37e64b66a0fe60c9c0771f7c06bec1c9dfb0ab7c4b8c8f0be00583 \
                    size    661524

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}
