1{ lib, stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 pname = "pmccabe";
5 version = "2.6";
6
7 src = fetchurl {
8 url = "http://http.debian.net/debian/pool/main/p/pmccabe/pmccabe_${version}.tar.gz";
9 sha256 = "0a3h1b9fb87c82d5fbql5lc4gp338pa5s9i66dhw7zk8jdygx474";
10 };
11
12 patches = [
13 ./getopt_on_darwin.patch
14 ];
15
16 configurePhase = ''
17 sed -i -r Makefile \
18 -e 's,/usr/,/,g' \
19 -e "s,^DESTDIR =.*$,DESTDIR = $out," \
20 -e "s,^INSTALL = install.*$,INSTALL = install," \
21 -e "s,^all:.*$,all: \$(PROGS),"
22 '';
23
24 checkPhase = "make test";
25
26 doCheck = true;
27
28 meta = with lib; {
29 description = "McCabe-style function complexity and line counting for C and C++";
30 homepage = "https://people.debian.org/~bame/pmccabe/";
31 license = licenses.gpl2Plus;
32
33 longDescription = ''
34 pmccabe calculates McCabe-style cyclomatic complexity for C and
35 C++ source code. Per-function complexity may be used for
36 spotting likely trouble spots and for estimating testing
37 effort.
38
39 pmccabe also includes a non-commented line counter, decomment which
40 only removes comments from source code; codechanges, a program to
41 calculate the amount of change which has occurred between two source
42 trees or files; and vifn, to invoke vi given a function name rather
43 than a file name.
44 '';
45 maintainers = with maintainers; [ peterhoeg ];
46 platforms = platforms.unix;
47 };
48}