1{ lib, stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 pname = "cccc";
5 version = "3.1.4";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/cccc/${version}/cccc-${version}.tar.gz";
9 sha256 = "1gsdzzisrk95kajs3gfxks3bjvfd9g680fin6a9pjrism2lyrcr7";
10 };
11
12 hardeningDisable = [ "format" ];
13
14 patches = [ ./cccc.patch ];
15
16 preConfigure = ''
17 substituteInPlace install/install.mak --replace /usr/local/bin $out/bin
18 substituteInPlace install/install.mak --replace MKDIR=mkdir "MKDIR=mkdir -p"
19 '';
20 buildFlags = [ "CCC=c++" "LD=c++" ];
21
22 meta = {
23 description = "C and C++ Code Counter";
24 longDescription = ''
25 CCCC is a tool which analyzes C++ and Java files and generates a report
26 on various metrics of the code. Metrics supported include lines of code, McCabe's
27 complexity and metrics proposed by Chidamber&Kemerer and Henry&Kafura.
28 '';
29 homepage = "https://cccc.sourceforge.net/";
30 license = lib.licenses.gpl2;
31 platforms = lib.platforms.unix;
32 maintainers = [ lib.maintainers.linquize ];
33 };
34}