summary refs log tree commit diff
path: root/pkgs/development/tools/misc/complexity/default.nix
blob: 9f1eca0fa13c7fcb6c90dffdc3db68fec1a2811c (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
38
39
40
41
42
43
44
45
{ fetchurl, stdenv, autogen, texinfo }:

stdenv.mkDerivation rec {
  # FIXME: Currently fails to build.
  name = "complexity-0.4";

  src = fetchurl {
    url = "mirror://gnu/complexity/${name}.tar.gz";
    sha256 = "0dmk2pm7vi95482hnbbp597640bsjw5gg57j8cpy87855cl69yr8";
  };

  buildInputs =
    [ autogen
      texinfo  # XXX: shouldn't be needed, per GCS
    ];

  # Hack to work around build defect.
  makeFlags = "MAKEINFOFLAGS=--no-validate";

  doCheck = true;

  preBuild = ''
    sed -i -e '/gets is a security/d' lib/stdio.in.h
    sed -i '42 i\
      #undef false\
      #undef true' src/complexity.h
  '';

  meta = {
    description = "GNU Complexity, C code complexity measurement tool";

    longDescription =
      '' GNU Complexity is a tool designed for analyzing the complexity of C
         program functions.  It is very similar to the McCabe scoring, but
         addresses several issues not considered in that scoring scheme.
      '';

    license = stdenv.lib.licenses.gpl3Plus;

    homepage = http://www.gnu.org/software/complexity/;

    platforms = stdenv.lib.platforms.gnu;
    maintainers = [ stdenv.lib.maintainers.ludo ];
  };
}