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-12-17 10:02:37 +00:00
|
|
|
version = "1.73";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "error27";
|
|
|
|
repo = "smatch";
|
|
|
|
rev = version;
|
2022-12-17 10:02:37 +00:00
|
|
|
sha256 = "sha256-Pv3bd2cjnQKnhH7TrkYWfDEeaq6u/q/iK1ZErzn6bME=";
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Semantic analysis tool for C";
|
2022-12-17 10:02:37 +00:00
|
|
|
homepage = "https://sparse.docs.kernel.org/";
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2022-06-16 17:23:12 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|