about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/analysis/cccc/default.nix
blob: 49c8fb140e5925d9da707ec606c77742881312b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, stdenv, fetchurl }:

stdenv.mkDerivation rec {
  pname = "cccc";
  version = "3.1.4";

  src = fetchurl {
    url = "mirror://sourceforge/cccc/${version}/cccc-${version}.tar.gz";
    sha256 = "1gsdzzisrk95kajs3gfxks3bjvfd9g680fin6a9pjrism2lyrcr7";
  };

  hardeningDisable = [ "format" ];

  patches = [ ./cccc.patch ];

  preConfigure = ''
    substituteInPlace install/install.mak --replace /usr/local/bin $out/bin
    substituteInPlace install/install.mak --replace MKDIR=mkdir "MKDIR=mkdir -p"
  '';
  buildFlags = [ "CCC=c++" "LD=c++" ];

  meta = {
    description = "C and C++ Code Counter";
    longDescription = ''
      CCCC is a tool which analyzes C++ and Java files and generates a report
      on various metrics of the code. Metrics supported include lines of code, McCabe's
      complexity and metrics proposed by Chidamber&Kemerer and Henry&Kafura.
    '';
    homepage = "https://cccc.sourceforge.net/";
    license = lib.licenses.gpl2;
    platforms = lib.platforms.unix;
    maintainers = [ lib.maintainers.linquize ];
  };
}