2015-12-20 03:22:24 +01:00
|
|
|
{ stdenv, fetchurl, cmake, llvmPackages }:
|
2015-02-11 00:14:15 +01:00
|
|
|
|
2015-12-20 03:22:24 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2015-02-11 00:14:15 +01:00
|
|
|
name = "include-what-you-use-${version}";
|
2016-01-24 20:31:44 +01:00
|
|
|
# Also bump llvmPackages in all-packages.nix to the supported version!
|
2016-05-16 18:39:12 +02:00
|
|
|
version = "0.6";
|
2015-02-11 00:14:15 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-05-16 18:39:12 +02:00
|
|
|
sha256 = "0n3z4pfbby0rl338irbs4yvcmjfnza82xg9a8r9amyl0bkfasbxb";
|
2015-02-11 00:14:15 +01:00
|
|
|
url = "${meta.homepage}/downloads/${name}.src.tar.gz";
|
|
|
|
};
|
|
|
|
|
2015-11-26 18:44:44 +01:00
|
|
|
buildInputs = with llvmPackages; [ clang llvm ];
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DIWYU_LLVM_ROOT_PATH=${llvmPackages.clang-unwrapped}" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-02-11 00:14:15 +01:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|