@@ -1,24 +1,30 @@
1−{ fetchurl, stdenv }:
1+{ stdenv, fetchurl }:
22
33stdenv.mkDerivation rec {
4− name = "pmccabe-2.4-CVS20070814";
4+ name = "pmccabe-${version}";
5+ version = "2.6";
56
67 src = fetchurl {
7− url = "http://cvs.parisc-linux.org/download/${name}.tar.gz";
8− sha256 = "0nqvfdf2cxx516nw0rwr3lhzhiyrnpc2jf45ldfwsdc9rm2nj3r9";
8+ url = "http://http.debian.net/debian/pool/main/p/pmccabe/pmccabe_${version}.tar.gz";
9+ sha256 = "0a3h1b9fb87c82d5fbql5lc4gp338pa5s9i66dhw7zk8jdygx474";
910 };
1011
1112 configurePhase = ''
12− sed -i "Makefile" \
13− -"es|^[[:blank:]]*DESTDIR[[:blank:]]*=.*$|DESTDIR = $out|g ; \
14− s|^[[:blank:]]*INSTALL[[:blank:]]*=.*$|INSTALL = install|g ; \
15− s|/usr/|/|g"
16− '';
13+ sed -i -r Makefile \
14+ -e 's,/usr/,/,g' \
15+ -e "s,^DESTDIR =.*$,DESTDIR = $out," \
16+ -e "s,^INSTALL = install.*$,INSTALL = install," \
17+ -e "s,^all:.*$,all: \$(PROGS),"
18+ '';
19+
20+ checkPhase = "make test";
21+
22+ doCheck = true;
1723
18− meta = {
24+ meta = with stdenv.lib; {
1925 description = "McCabe-style function complexity and line counting for C and C++";
20− homepage = http://www.parisc-linux.org/~bame/pmccabe/;
21− license = stdenv.lib.licenses.gpl2Plus;
26+ homepage = https://people.debian.org/~bame/pmccabe/;
27+ license = licenses.gpl2Plus;
2228
2329 longDescription = ''
2430 pmccabe calculates McCabe-style cyclomatic complexity for C and
@@ -32,6 +38,7 @@ stdenv.mkDerivation rec {
3238 trees or files; and vifn, to invoke vi given a function name rather
3339 than a file name.
3440 '';
35− platforms = stdenv.lib.platforms.linux;
41+ platforms = platforms.linux;
42+ maintainers = with maintainers; [ peterhoeg ];
3643 };
3744}