Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, buildGoModule, fetchFromGitLab, python3 }:
2buildGoModule rec {
3 pname = "loccount";
4 version = "2.15";
5
6 src = fetchFromGitLab {
7 owner = "esr";
8 repo = "loccount";
9 rev = version;
10 hash = "sha256-IRDwxz/InF4okyfAzbK0PzZz+HMUwv5LgRthUUy3rus=";
11 };
12
13 vendorHash = null;
14
15 excludedPackages = "tests";
16
17 nativeBuildInputs = [ python3 ];
18
19 ldflags = [ "-s" "-w" ];
20
21 preBuild = ''
22 patchShebangs --build tablegen.py
23
24 go generate
25 '';
26
27 meta = with lib; {
28 description = "Re-implementation of sloccount in Go";
29 longDescription = ''
30 loccount is a re-implementation of David A. Wheeler's sloccount tool
31 in Go. It is faster and handles more different languages. Because
32 it's one source file in Go, it is easier to maintain and extend than the
33 multi-file, multi-language implementation of the original.
34
35 The algorithms are largely unchanged and can be expected to produce
36 identical numbers for languages supported by both tools. Python is
37 an exception; loccount corrects buggy counting of single-quote multiline
38 literals in sloccount 2.26.
39 '';
40 homepage = "https://gitlab.com/esr/loccount";
41 downloadPage = "https://gitlab.com/esr/loccount/tree/master";
42 license = licenses.bsd2;
43 maintainers = with maintainers; [ calvertvl ];
44 };
45}