about summary refs log tree commit diff
path: root/pkgs/development/tools/analysis/smatch/default.nix
blob: 2100b72c9878452e485da2e0af047048b97a983f (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
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, sqlite
, openssl
, buildllvmsparse ? false
, buildc2xml ? false
, libllvm
, libxml2
}:

stdenv.mkDerivation rec {
  pname = "smatch";
  version = "1.73";

  src = fetchFromGitHub {
    owner = "error27";
    repo = "smatch";
    rev = version;
    sha256 = "sha256-Pv3bd2cjnQKnhH7TrkYWfDEeaq6u/q/iK1ZErzn6bME=";
  };

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [ sqlite openssl ]
    ++ lib.optionals buildllvmsparse [ libllvm ]
    ++ lib.optionals buildc2xml [ libxml2.dev ];

  makeFlags = [ "PREFIX=${placeholder "out"}" "CXX=${stdenv.cc.targetPrefix}c++" ];

  meta = with lib; {
    description = "A semantic analysis tool for C";
    homepage = "https://sparse.docs.kernel.org/";
    maintainers = with maintainers; [ marsam ];
    license = licenses.gpl2Plus;
    platforms = platforms.all;
  };
}