nixpkgs-suyu/pkgs/development/tools/misc/pmccabe/default.nix

49 lines
1.4 KiB
Nix
Raw Normal View History

2017-03-03 05:28:01 +01:00
{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
2017-03-03 05:28:01 +01:00
name = "pmccabe-${version}";
version = "2.6";
src = fetchurl {
2017-03-03 05:28:01 +01:00
url = "http://http.debian.net/debian/pool/main/p/pmccabe/pmccabe_${version}.tar.gz";
sha256 = "0a3h1b9fb87c82d5fbql5lc4gp338pa5s9i66dhw7zk8jdygx474";
};
2017-04-06 04:05:38 +02:00
patches = [
./getopt_on_darwin.patch
];
configurePhase = ''
2017-03-03 05:28:01 +01:00
sed -i -r Makefile \
-e 's,/usr/,/,g' \
-e "s,^DESTDIR =.*$,DESTDIR = $out," \
-e "s,^INSTALL = install.*$,INSTALL = install," \
-e "s,^all:.*$,all: \$(PROGS),"
'';
checkPhase = "make test";
doCheck = true;
2017-03-03 05:28:01 +01:00
meta = with stdenv.lib; {
description = "McCabe-style function complexity and line counting for C and C++";
2017-03-03 05:28:01 +01:00
homepage = https://people.debian.org/~bame/pmccabe/;
license = 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.
'';
2017-03-03 05:28:01 +01:00
maintainers = with maintainers; [ peterhoeg ];
2017-04-06 04:05:38 +02:00
platforms = platforms.unix;
};
}