2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, sqlite
|
|
|
|
, openssl
|
|
|
|
, buildllvmsparse ? false
|
|
|
|
, buildc2xml ? false
|
|
|
|
, libllvm
|
|
|
|
, libxml2
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-07-03 03:11:41 +00:00
|
|
|
pname = "smatch";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "1.72";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "error27";
|
|
|
|
repo = "smatch";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-XVW4sAgIxaJjAk75bp/O286uddIfgfKtIA2LniUGWBM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildInputs = [ sqlite openssl ]
|
|
|
|
++ lib.optionals buildllvmsparse [ libllvm ]
|
|
|
|
++ lib.optionals buildc2xml [ libxml2.dev ];
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=${placeholder "out"}" "CXX=${stdenv.cc.targetPrefix}c++" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A semantic analysis tool for C";
|
|
|
|
homepage = "http://smatch.sourceforge.net/";
|
2022-06-16 17:23:12 +00:00
|
|
|
maintainers = with maintainers; [ marsam ];
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|