2014-04-30 02:36:43 +02:00
|
|
|
{ stdenv, fetchurl, clang, llvmPackages, perl, makeWrapper }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "clang-analyzer";
|
2014-04-30 02:36:43 +02:00
|
|
|
version = "3.4";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://llvm.org/releases/${version}/clang-${version}.src.tar.gz";
|
|
|
|
sha256 = "06rb4j1ifbznl3gfhl98s7ilj0ns01p7y7zap4p7ynmqnc6pia92";
|
|
|
|
};
|
|
|
|
|
2014-05-02 20:22:48 +02:00
|
|
|
patches = [ ./0001-Fix-scan-build-to-use-NIX_CFLAGS_COMPILE.patch ];
|
2014-04-30 02:36:43 +02:00
|
|
|
buildInputs = [ clang llvmPackages.clang perl makeWrapper ];
|
2016-05-04 12:08:35 +02:00
|
|
|
|
|
|
|
dontBuild = true;
|
2014-04-30 02:36:43 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/libexec
|
|
|
|
cp -R tools/scan-view $out/libexec
|
|
|
|
cp -R tools/scan-build $out/libexec
|
|
|
|
|
|
|
|
makeWrapper $out/libexec/scan-view/scan-view $out/bin/scan-view
|
2014-05-02 20:22:48 +02:00
|
|
|
makeWrapper $out/libexec/scan-build/scan-build $out/bin/scan-build \
|
|
|
|
--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 02:36:43 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Clang Static Analyzer";
|
|
|
|
homepage = "http://clang-analyzer.llvm.org";
|
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
|
|
|
};
|
2014-05-02 20:22:48 +02:00
|
|
|
}
|