2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, libxslt, docbook_xsl, docbook_xml_dtd_45, pcre, withZ3 ? true, z3 }:
|
2012-02-15 16:07:45 +00:00
|
|
|
|
2016-03-05 17:33:53 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2016-07-17 09:52:13 +00:00
|
|
|
pname = "cppcheck";
|
2021-11-29 06:18:28 +00:00
|
|
|
version = "2.6";
|
2012-02-15 16:07:45 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
|
2021-11-29 06:18:28 +00:00
|
|
|
sha256 = "sha256-rQuvhVgpVBdwCCekraG+cqxR9PUs/wm5pjVQHzTpaKI=";
|
2012-02-15 16:07:45 +00:00
|
|
|
};
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
buildInputs = [ pcre ] ++ lib.optionals withZ3 [ z3 ];
|
2016-03-07 18:35:38 +00:00
|
|
|
nativeBuildInputs = [ libxslt docbook_xsl docbook_xml_dtd_45 ];
|
2014-05-08 12:27:48 +00:00
|
|
|
|
2020-05-26 10:48:03 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" "FILESDIR=$(out)/cfg" "HAVE_RULES=yes" ]
|
2021-01-23 12:26:19 +00:00
|
|
|
++ lib.optionals withZ3 [ "USE_Z3=yes" "CPPFLAGS=-DNEW_Z3=1" ];
|
2015-05-02 22:22:23 +00:00
|
|
|
|
2016-04-15 15:18:29 +00:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2016-10-21 13:56:20 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-05-02 22:22:23 +00:00
|
|
|
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
|
2015-05-02 22:22:23 +00:00
|
|
|
'';
|
2012-02-15 16:07:45 +00:00
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2015-05-02 22:22:23 +00:00
|
|
|
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.
|
2015-05-02 22:22:23 +00:00
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://cppcheck.sourceforge.net/";
|
2016-03-05 17:33:53 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
2016-05-16 20:30:20 +00:00
|
|
|
maintainers = with maintainers; [ joachifm ];
|
2012-02-15 16:07:45 +00:00
|
|
|
};
|
|
|
|
}
|