blob: 1a7a1c0f4c9578e87d53ffc663fd127cc074e253 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
{ lib
, stdenv
, fetchFromGitHub
, docbook_xml_dtd_45
, docbook_xsl
, installShellFiles
, libxslt
, pcre
, pkg-config
, python3
, which
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cppcheck";
version = "2.13.0";
outputs = [ "out" "man" ];
src = fetchFromGitHub {
owner = "danmar";
repo = "cppcheck";
rev = finalAttrs.version;
hash = "sha256-+z8mMwI4hHpE3enIriTsxZEocqifppYgjZz3UPGswIo=";
};
nativeBuildInputs = [
docbook_xml_dtd_45
docbook_xsl
installShellFiles
libxslt
pkg-config
python3
which
];
buildInputs = [
pcre
(python3.withPackages (ps: [ ps.pygments ]))
];
makeFlags = [ "PREFIX=$(out)" "MATCHCOMPILER=yes" "FILESDIR=$(out)/share/cppcheck" "HAVE_RULES=yes" ];
enableParallelBuilding = true;
strictDeps = true;
# test/testcondition.cpp:4949(TestCondition::alwaysTrueContainer): Assertion failed.
doCheck = !(stdenv.isLinux && stdenv.isAarch64);
doInstallCheck = true;
postPatch = ''
substituteInPlace Makefile \
--replace 'PCRE_CONFIG = $(shell which pcre-config)' 'PCRE_CONFIG = $(PKG_CONFIG) libpcre'
'';
postBuild = ''
make DB2MAN=${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl man
'';
postInstall = ''
installManPage cppcheck.1
'';
installCheckPhase = ''
runHook preInstallCheck
echo 'int main() {}' > ./installcheck.cpp
$out/bin/cppcheck ./installcheck.cpp > /dev/null
runHook postInstallCheck
'';
meta = {
description = "A static analysis tool for C/C++ code";
homepage = "http://cppcheck.sourceforge.net";
license = lib.licenses.gpl3Plus;
longDescription = ''
Check C/C++ code for memory leaks, mismatching allocation-deallocation,
buffer overruns and more.
'';
maintainers = with lib.maintainers; [ joachifm paveloom ];
platforms = lib.platforms.unix;
};
})
|