1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-21 05:25:38 +00:00
nixpkgs/pkgs/development/tools/analysis/cppcheck/default.nix

40 lines
1.2 KiB
Nix
Raw Normal View History

2020-05-26 11:48:03 +01:00
{ stdenv, fetchurl, libxslt, docbook_xsl, docbook_xml_dtd_45, pcre, withZ3 ? true, z3 }:
stdenv.mkDerivation rec {
2016-07-17 10:52:13 +01:00
pname = "cppcheck";
2020-05-20 10:08:05 +01:00
version = "2.0";
src = fetchurl {
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
2020-05-20 10:08:05 +01:00
sha256 = "0gssnb50cndr77xva4nar4a82ii0vfqy96dlm27gb7pd6xmd6xsz";
};
2020-05-26 11:48:03 +01:00
buildInputs = [ pcre ] ++ stdenv.lib.optionals withZ3 [ z3 ];
nativeBuildInputs = [ libxslt docbook_xsl docbook_xml_dtd_45 ];
2020-05-26 11:48:03 +01:00
makeFlags = [ "PREFIX=$(out)" "FILESDIR=$(out)/cfg" "HAVE_RULES=yes" ]
++ stdenv.lib.optionals withZ3 [ "USE_Z3=yes" "CPPFLAGS=-DNEW_Z3=1" ];
2016-04-15 16:18:29 +01:00
outputs = [ "out" "man" ];
2016-10-21 14:56:20 +01:00
enableParallelBuilding = true;
postInstall = ''
make DB2MAN=${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl man
2016-04-15 16:18:29 +01:00
mkdir -p $man/share/man/man1
cp cppcheck.1 $man/share/man/man1/cppcheck.1
'';
meta = with stdenv.lib; {
description = "A static analysis tool for C/C++ code";
longDescription = ''
2016-07-17 10:52:13 +01: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 ];
};
}