summary refs log tree commit diff
path: root/pkgs/development/tools/misc/pmccabe/default.nix
blob: 18f3fe375cbc6e5828a1151177ee772199297b86 (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
35
36
37
{ fetchurl, stdenv }:

stdenv.mkDerivation rec {
  name = "pmccabe-2.4-CVS20070814";

  src = fetchurl {
    url = "http://cvs.parisc-linux.org/download/${name}.tar.gz";
    sha256 = "0nqvfdf2cxx516nw0rwr3lhzhiyrnpc2jf45ldfwsdc9rm2nj3r9";
  };

  configurePhase = ''
    sed -i "Makefile"							\
        -"es|^[[:blank:]]*DESTDIR[[:blank:]]*=.*$|DESTDIR = $out|g ;	\
	   s|^[[:blank:]]*INSTALL[[:blank:]]*=.*$|INSTALL = install|g ;	\
	   s|/usr/|/|g"
  '';

  meta = {
    description = "McCabe-style function complexity and line counting for C and C++";
    homepage = http://www.parisc-linux.org/~bame/pmccabe/;
    license = stdenv.lib.licenses.gpl2Plus;

    longDescription = ''
      pmccabe calculates McCabe-style cyclomatic complexity for C and
      C++ source code.  Per-function complexity may be used for
      spotting likely trouble spots and for estimating testing
      effort.

      pmccabe also includes a non-commented line counter, decomment which
      only removes comments from source code; codechanges, a program to
      calculate the amount of change which has occurred between two source
      trees or files; and vifn, to invoke vi given a function name rather
      than a file name.
    '';
    platforms = stdenv.lib.platforms.linux;
  };
}