nixpkgs/pkgs/development/tools/analysis/cppcheck/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.3 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, pcre
, python3
, libxslt
, docbook_xsl
, docbook_xml_dtd_45
, withZ3 ? true
, z3
, which
}:
stdenv.mkDerivation rec {
2016-07-17 09:52:13 +00:00
pname = "cppcheck";
2022-07-16 04:20:00 +00:00
version = "2.8.2";
src = fetchFromGitHub {
owner = "danmar";
repo = "cppcheck";
rev = version;
2022-07-16 04:20:00 +00:00
sha256 = "sha256-Zv5dGjEtlloWdL2rkGEVLrVTS/QSRDjvDrequVSwgM0=";
};
buildInputs = [ pcre
(python3.withPackages (ps: [ps.pygments]))
] ++ lib.optionals withZ3 [ z3 ];
nativeBuildInputs = [ libxslt docbook_xsl docbook_xml_dtd_45 which ];
makeFlags = [ "PREFIX=$(out)" "MATCHCOMPILER=yes" "FILESDIR=$(out)/share/cppcheck" "HAVE_RULES=yes" ]
++ lib.optionals withZ3 [ "USE_Z3=yes" "CPPFLAGS=-DNEW_Z3=1" ];
2016-04-15 15:18:29 +00:00
outputs = [ "out" "man" ];
2016-10-21 13:56:20 +00:00
enableParallelBuilding = true;
2022-03-26 15:43:27 +00:00
doCheck = true;
postInstall = ''
make DB2MAN=${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl man
2016-04-15 15:18:29 +00:00
mkdir -p $man/share/man/man1
cp cppcheck.1 $man/share/man/man1/cppcheck.1
'';
meta = with lib; {
description = "A static analysis tool for C/C++ code";
longDescription = ''
2016-07-17 09:52:13 +00:00
Check C/C++ code for memory leaks, mismatching allocation-deallocation,
buffer overruns and more.
'';
homepage = "http://cppcheck.sourceforge.net/";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ joachifm ];
};
}