summary refs log tree commit diff
path: root/pkgs/development/tools/analysis/smatch/default.nix
blob: 82a32504d73a95fbe355e72ed4bf9d46e68c016c (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
{ lib, stdenv, fetchgit, sqlite, pkg-config, perl
, buildllvmsparse ? true
, buildc2xml ? true
, llvm, libxml2
}:

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

  src = fetchgit {
    url = "git://repo.or.cz/${pname}.git";
    rev = "23656e3e578b700cbf96d043f039e6341a3ba5b9";
    sha256 = "0r43qi6vryqg450fj73yjwbb7gzcgx64rhrhb3r1m6a252srijiy";
  };

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ sqlite perl ]
   ++ lib.optional buildllvmsparse llvm
   ++ lib.optional buildc2xml libxml2;

  preBuild = ''
    sed -i Makefile \
      -e "s|^PREFIX=.*|PREFIX = $out|g"
  '';

  meta = with lib; {
    description = "A semantic analysis tool for C";
    homepage = "http://smatch.sourceforge.net/";
    maintainers = with maintainers; [];
    license = licenses.free; /* OSL, see http://www.opensource.org */
    platforms = platforms.linux;
  };
}