2012-10-30 16:14:06 +00:00
|
|
|
{ stdenv, fetchgit, sqlite, pkgconfig, perl
|
2012-10-05 02:24:09 +01:00
|
|
|
, buildllvmsparse ? true
|
|
|
|
, buildc2xml ? true
|
|
|
|
, llvm ? null, libxml2 ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert buildllvmsparse -> llvm != null;
|
|
|
|
assert buildc2xml -> libxml2 != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2013-06-07 01:13:54 +01:00
|
|
|
name = "smatch-20120924";
|
2012-10-05 02:24:09 +01:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = git://repo.or.cz/smatch.git;
|
|
|
|
rev = "23656e3e578b700cbf96d043f039e6341a3ba5b9";
|
|
|
|
sha256 = "09a44967d4cff026c67062f778e251d0b432af132e9d59a47b7d3167f379adfa";
|
|
|
|
};
|
|
|
|
|
2012-10-30 16:14:06 +00:00
|
|
|
buildInputs = [sqlite pkgconfig perl]
|
2012-10-05 02:24:09 +01:00
|
|
|
++ stdenv.lib.optional buildllvmsparse llvm
|
|
|
|
++ stdenv.lib.optional buildc2xml libxml2;
|
|
|
|
|
2012-10-30 14:07:20 +00:00
|
|
|
preBuild =
|
|
|
|
'' sed -i Makefile \
|
|
|
|
-e "s|^PREFIX=.*|PREFIX = $out|g"
|
|
|
|
'';
|
2012-10-05 02:24:09 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A semantic analysis tool for C";
|
|
|
|
homepage = "http://smatch.sourceforge.net/";
|
|
|
|
license = "free"; /* OSL, see http://www.opensource.org */
|
|
|
|
};
|
|
|
|
}
|