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; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A semantic analysis tool for C";
|
2022-12-17 10:02:37 +00:00
|
|
|
homepage = "https://sparse.docs.kernel.org/";
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2022-06-16 17:23:12 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|