On 2017/12/01 14:54, Klemens Nanni wrote:
> On Thu, Nov 09, 2017 at 12:11:05AM +0100, Klemens Nanni wrote:
> > Hey ports@,
> >
> > here's https://gitlab.com/esr/loccount/, from DESCR:
> >
> > loccount is a re-implementation of David A. Wheeler's sloccount tool in
> > Go. It is faster and handles more different languages. Because it's one
> > source file in Go, it is easier to maintain and extend than the
> > multi-file, multi-language implementation of the original.
> >
> > The algorithms are largely unchanged and can be expected to produce
> > identical numbers for languages supported by both tools. Python is an
> > exception; loccount corrects buggy counting of single-quote multiline
> > literals in sloccount 2.26.
> >
> > Tested on amd64, here's an example:
> >
> > $ time loccount /usr/src/sys
> > all 2010138 (100.00%) in 5939 files
> > c 1943636 (96.69%) in 2762 files
> > asm 58178 (2.89%) in 254 files
> > makefile 3023 (0.15%) in 207 files
> > awk 2096 (0.10%) in 18 files
> > yacc 1654 (0.08%) in 2 files
> > shell 738 (0.04%) in 8 files
> > lex 560 (0.03%) in 2 files
> > m4 175 (0.01%) in 1 files
> > perl 70 (0.00%) in 2 files
> > ada 8 (0.00%) in 1 files
> > 0m02.69s real 0m06.07s user 0m01.15s system
> >
> > Feedback, comments?
> Anyone willing to commit this? It still works fine after the lang/go
> 1.9.2 update, I'm using it regularily.
>
: # $OpenBSD: $
:
: COMMENT = Faster Go re-implementation of sloccount for more
languages
just describe what it does rather than say things like "faster
reimplementation" and "more". in particular it's quite useless to
have a package comparing itself with something else that isn't in
packages.
something like "count lines of code in various languages"?
: V = 1.1
: DISTNAME = loccount-${V}
: CATEGORIES = textproc
:
: HOMEPAGE = https://gitlab.com/esr/loccount
:
: DISTFILES = ${DISTNAME}{${V}/archive}${EXTRACT_SUFX}
: WRKDIST =
${WRKDIR}/${DISTNAME}-a4b1199c68660884eb183aecd128102c0c1fbfb8
:
: MASTER_SITES = ${HOMEPAGE}/repository/
:
: # BSD
: PERMIT_PACKAGE_CDROM = Yes
:
: WANTLIB = c pthread
loccount-1.1(textproc/loccount):
Extra: c.92 pthread.25
if you're adding WANTLIB in the hope that it triggers an update in a statically
linked program, add a comment explaining why, otherwise it is likely to be
removed
in a WANTLIB sync.
: BUILD_DEPENDS = textproc/asciidoc
:
: MODULES = lang/go
there doesn't seem much advantage to using the lang/go module when
you're not using the go build scaffolding.
: ALL_TARGET = ${HOMEPAGE:https://%=%}
this is a bit obtuse, if you were actually using it, it would be simpler
to just use the string.
but you're not actually using it.
: WRKSRC = ${MODGO_WORKSPACE}/src/${ALL_TARGET}
:
: do-build:
: make -C ${WRKSRC} loccount{,.1}
:
: do-test:
: make -C ${WRKSRC} check
normally ${MAKE_PROGRAM} rather than calling make directly, but seems
simpler to get rid of the MODULES and have something like this instead
BUILD_DEPENDS = textproc/asciidoc \
lang/go
ALL_TARGET = loccount loccount.1
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/loccount-$V-* ${PREFIX}/bin/loccount
${INSTALL_MAN} ${WRKSRC}/loccount.1 ${PREFIX}/man/man1/
... there's a remaining problem of this package not being updated
when the go compiler itself is updated (which likely results in changes
in the built code), though this affects all go ports other than
"MODGO_TYPE=lib" ones.
:
: do-install:
: ${INSTALL_PROGRAM} ${WRKSRC}/loccount ${PREFIX}/bin/
: ${INSTALL_MAN} ${WRKSRC}/loccount.1 ${PREFIX}/man/man1/
:
: