2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, clang, llvmPackages, perl, makeWrapper, python3 }:
|
2014-04-30 01:36:43 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "clang-analyzer";
|
2020-07-31 09:42:19 +01:00
|
|
|
inherit (llvmPackages.clang-unwrapped) src version;
|
2014-04-30 01:36:43 +01:00
|
|
|
|
2014-05-02 19:22:48 +01:00
|
|
|
patches = [ ./0001-Fix-scan-build-to-use-NIX_CFLAGS_COMPILE.patch ];
|
2020-07-31 09:42:19 +01:00
|
|
|
buildInputs = [ clang llvmPackages.clang perl python3 ];
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2016-05-04 11:08:35 +01:00
|
|
|
|
|
|
|
dontBuild = true;
|
2014-04-30 01:36:43 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2020-07-31 09:42:19 +01:00
|
|
|
mkdir -p $out/share/scan-view $out/bin
|
|
|
|
cp -R tools/scan-view/share/* $out/share/scan-view
|
|
|
|
cp -R tools/scan-view/bin/* $out/bin/scan-view
|
|
|
|
cp -R tools/scan-build/* $out
|
|
|
|
|
|
|
|
rm $out/bin/*.bat $out/libexec/*.bat $out/CMakeLists.txt
|
2014-04-30 01:36:43 +01:00
|
|
|
|
2020-07-31 09:42:19 +01:00
|
|
|
wrapProgram $out/bin/scan-build \
|
2014-05-02 19:22:48 +01:00
|
|
|
--add-flags "--use-cc=${clang}/bin/clang" \
|
|
|
|
--add-flags "--use-c++=${clang}/bin/clang++" \
|
|
|
|
--add-flags "--use-analyzer='${llvmPackages.clang}/bin/clang'"
|
2014-04-30 01:36:43 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Clang Static Analyzer";
|
|
|
|
homepage = "http://clang-analyzer.llvm.org";
|
2021-01-23 12:26:19 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = [ lib.maintainers.thoughtpolice ];
|
2014-04-30 01:36:43 +01:00
|
|
|
};
|
2014-05-02 19:22:48 +01:00
|
|
|
}
|