15 stdenv.mkDerivation (finalAttrs: {
19 outputs = [ "out" "man" ];
21 src = fetchFromGitHub {
24 rev = finalAttrs.version;
25 hash = "sha256-w5k7WO2Kwx0ac/vP54ndPUp/AG6jG3MDf03h5z/+Cso=";
40 (python3.withPackages (ps: [ ps.pygments ]))
43 makeFlags = [ "PREFIX=$(out)" "MATCHCOMPILER=yes" "FILESDIR=$(out)/share/cppcheck" "HAVE_RULES=yes" ];
45 enableParallelBuilding = true;
48 # test/testcondition.cpp:4949(TestCondition::alwaysTrueContainer): Assertion failed.
49 doCheck = !(stdenv.isLinux && stdenv.isAarch64);
50 doInstallCheck = true;
53 substituteInPlace Makefile \
54 --replace 'PCRE_CONFIG = $(shell which pcre-config)' 'PCRE_CONFIG = $(PKG_CONFIG) libpcre'
58 make DB2MAN=${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl man
62 installManPage cppcheck.1
65 installCheckPhase = ''
66 runHook preInstallCheck
68 echo 'int main() {}' > ./installcheck.cpp
69 $out/bin/cppcheck ./installcheck.cpp > /dev/null
71 runHook postInstallCheck
75 description = "A static analysis tool for C/C++ code";
76 homepage = "http://cppcheck.sourceforge.net";
77 license = lib.licenses.gpl3Plus;
79 Check C/C++ code for memory leaks, mismatching allocation-deallocation,
80 buffer overruns and more.
82 maintainers = with lib.maintainers; [ joachifm paveloom ];
83 platforms = lib.platforms.unix;