2022-03-30 09:31:56 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libxslt, docbook_xsl, docbook_xml_dtd_45, pcre, withZ3 ? true, z3, python3 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cppcheck";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "2.7.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "danmar";
|
|
|
|
repo = "cppcheck";
|
|
|
|
rev = version;
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-GRhQXGldirIhUBI4CucDTTxuZhG0XW0qp1FjYXhVS0o=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
buildInputs = [ pcre
|
|
|
|
(python3.withPackages (ps: [ps.pygments]))
|
|
|
|
] ++ lib.optionals withZ3 [ z3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ libxslt docbook_xsl docbook_xml_dtd_45 ];
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" "FILESDIR=$(out)/cfg" "HAVE_RULES=yes" ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals withZ3 [ "USE_Z3=yes" "CPPFLAGS=-DNEW_Z3=1" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
make DB2MAN=${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl man
|
|
|
|
mkdir -p $man/share/man/man1
|
|
|
|
cp cppcheck.1 $man/share/man/man1/cppcheck.1
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A static analysis tool for C/C++ code";
|
|
|
|
longDescription = ''
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|