2015-06-12 00:17:11 +02:00
|
|
|
{ stdenv, fetchurl, cmake, llvmPackages_36 }:
|
2015-02-11 00:14:15 +01:00
|
|
|
|
2015-06-12 00:17:11 +02:00
|
|
|
let
|
|
|
|
version = "0.4";
|
|
|
|
llvmPackages = llvmPackages_36;
|
|
|
|
in stdenv.mkDerivation rec {
|
2015-02-11 00:14:15 +01:00
|
|
|
name = "include-what-you-use-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2015-06-12 00:17:11 +02:00
|
|
|
sha256 = "19pwhgwvfr86n8ks099p9r02v7zh8d3qs7g7snzkhpdgq1azww85";
|
2015-02-11 00:14:15 +01:00
|
|
|
url = "${meta.homepage}/downloads/${name}.src.tar.gz";
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Analyze #includes in C/C++ source files with clang";
|
|
|
|
longDescription = ''
|
|
|
|
For every symbol (type, function variable, or macro) that you use in
|
|
|
|
foo.cc, either foo.cc or foo.h should #include a .h file that exports the
|
2015-03-26 00:25:09 +01:00
|
|
|
declaration of that symbol. The main goal of include-what-you-use is to
|
|
|
|
remove superfluous #includes, both by figuring out what #includes are not
|
|
|
|
actually needed for this file (for both .cc and .h files), and by
|
2015-02-11 00:14:15 +01:00
|
|
|
replacing #includes with forward-declares when possible.
|
|
|
|
'';
|
2015-06-12 00:17:11 +02:00
|
|
|
homepage = http://include-what-you-use.org;
|
2015-05-28 19:20:29 +02:00
|
|
|
license = licenses.bsd3;
|
2015-11-17 21:29:29 +01:00
|
|
|
platforms = platforms.linux;
|
2015-02-11 00:14:15 +01:00
|
|
|
maintainers = with maintainers; [ nckx ];
|
|
|
|
};
|
|
|
|
|
2015-06-12 00:17:11 +02:00
|
|
|
buildInputs = with llvmPackages; [ clang llvm ];
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = "-DIWYU_LLVM_ROOT_PATH=${llvmPackages.clang-unwrapped}";
|
2015-02-11 00:14:15 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
}
|