2021-01-23 19:26:19 +07:00
|
|
|
{ lib, stdenv, fetchgit, sqlite, pkg-config, perl
|
2012-10-05 03:24:09 +02:00
|
|
|
, buildllvmsparse ? true
|
|
|
|
, buildc2xml ? true
|
|
|
|
, llvm ? null, libxml2 ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert buildllvmsparse -> llvm != null;
|
|
|
|
assert buildc2xml -> libxml2 != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2013-06-07 03:13:54 +03:00
|
|
|
name = "smatch-20120924";
|
2012-10-05 03:24:09 +02:00
|
|
|
|
|
|
|
src = fetchgit {
|
2020-03-31 21:11:51 -04:00
|
|
|
url = "git://repo.or.cz/smatch.git";
|
2012-10-05 03:24:09 +02:00
|
|
|
rev = "23656e3e578b700cbf96d043f039e6341a3ba5b9";
|
2016-06-02 14:26:44 +03:00
|
|
|
sha256 = "0r43qi6vryqg450fj73yjwbb7gzcgx64rhrhb3r1m6a252srijiy";
|
2012-10-05 03:24:09 +02:00
|
|
|
};
|
|
|
|
|
2021-01-18 22:50:56 -08:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 17:26:13 -04:00
|
|
|
buildInputs = [sqlite perl]
|
2021-01-23 19:26:19 +07:00
|
|
|
++ lib.optional buildllvmsparse llvm
|
|
|
|
++ lib.optional buildc2xml libxml2;
|
2012-10-05 03:24:09 +02:00
|
|
|
|
2012-10-30 15:07:20 +01:00
|
|
|
preBuild =
|
|
|
|
'' sed -i Makefile \
|
|
|
|
-e "s|^PREFIX=.*|PREFIX = $out|g"
|
|
|
|
'';
|
2012-10-05 03:24:09 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A semantic analysis tool for C";
|
2020-03-31 21:11:51 -04:00
|
|
|
homepage = "http://smatch.sourceforge.net/";
|
2021-01-23 19:26:19 +07:00
|
|
|
license = lib.licenses.free; /* OSL, see http://www.opensource.org */
|
|
|
|
platforms = lib.platforms.linux;
|
2012-10-05 03:24:09 +02:00
|
|
|
};
|
|
|
|
}
|