mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +00:00
6739decba3
The original hash is for https://github.com/danmar/cppcheck/commit/4a17dcb and the new hash is for https://github.com/danmar/cppcheck/commit/ef1c70f.
57 lines
1.3 KiB
Nix
57 lines
1.3 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, pcre
|
|
, python3
|
|
, libxslt
|
|
, docbook_xsl
|
|
, docbook_xml_dtd_45
|
|
, withZ3 ? true
|
|
, z3
|
|
, which
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "cppcheck";
|
|
version = "2.9.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "danmar";
|
|
repo = "cppcheck";
|
|
rev = version;
|
|
hash = "sha256-bKZOAGInks26NmzlKo1T8NREO9xoF8ZsssNDzyTJwlU=";
|
|
};
|
|
|
|
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" ];
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
doCheck = true;
|
|
|
|
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
|
|
'';
|
|
|
|
meta = with lib; {
|
|
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 ];
|
|
};
|
|
}
|