2015-12-20 02:15:36 +00:00
|
|
|
{ stdenv, fetchurl, cmake, llvmPackages_37 }:
|
2015-02-10 23:14:15 +00:00
|
|
|
|
2015-06-11 23:17:11 +01:00
|
|
|
let
|
2015-12-20 02:15:36 +00:00
|
|
|
version = "0.5";
|
|
|
|
llvmPackages = llvmPackages_37;
|
2015-06-11 23:17:11 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
2015-02-10 23:14:15 +00:00
|
|
|
name = "include-what-you-use-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2015-06-11 23:17:11 +01:00
|
|
|
sha256 = "19pwhgwvfr86n8ks099p9r02v7zh8d3qs7g7snzkhpdgq1azww85";
|
2015-02-10 23:14:15 +00:00
|
|
|
url = "${meta.homepage}/downloads/${name}.src.tar.gz";
|
|
|
|
};
|
|
|
|
|
2015-11-26 17:44:44 +00:00
|
|
|
buildInputs = with llvmPackages; [ clang llvm ];
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DIWYU_LLVM_ROOT_PATH=${llvmPackages.clang-unwrapped}" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-02-10 23:14:15 +00:00
|
|
|
meta = with stdenv.lib; {
|
2015-11-26 17:44:44 +00:00
|
|
|
inherit version;
|
2015-02-10 23:14:15 +00:00
|
|
|
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-25 23:25:09 +00: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-10 23:14:15 +00:00
|
|
|
replacing #includes with forward-declares when possible.
|
|
|
|
'';
|
2015-06-11 23:17:11 +01:00
|
|
|
homepage = http://include-what-you-use.org;
|
2015-05-28 18:20:29 +01:00
|
|
|
license = licenses.bsd3;
|
2015-11-17 20:29:29 +00:00
|
|
|
platforms = platforms.linux;
|
2015-02-10 23:14:15 +00:00
|
|
|
maintainers = with maintainers; [ nckx ];
|
|
|
|
};
|
|
|
|
}
|