lol

include-what-you-use: 0.19 -> 0.21

also add a compiler-wrapper similar to clang-tools so it can find dependencies in nix-shell environments.

authored by

Jörg Thalheim and committed by
Jörg Thalheim
f37be825 6f6435de

+39 -3
+12 -2
pkgs/development/tools/analysis/include-what-you-use/default.nix
··· 3 3 stdenv.mkDerivation rec { 4 4 pname = "include-what-you-use"; 5 5 # Also bump llvmPackages in all-packages.nix to the supported version! 6 - version = "0.19"; 6 + version = "0.21"; 7 7 8 8 src = fetchurl { 9 9 url = "${meta.homepage}/downloads/${pname}-${version}.src.tar.gz"; 10 - hash = "sha256-KxAVe2DqCK3AjjiWtJIcc/yt1exOtlKymjQSnVAeXuA="; 10 + hash = "sha256-ajUZGf+JvafJXIlUcmAYaNs9qrlqlYs44DYokNWHYLY="; 11 11 }; 12 12 13 13 postPatch = '' ··· 17 17 nativeBuildInputs = with llvmPackages; [ cmake llvm.dev llvm python3 ]; 18 18 buildInputs = with llvmPackages; [ libclang clang-unwrapped python3 ]; 19 19 20 + clang = llvmPackages.clang; 21 + 20 22 cmakeFlags = [ "-DCMAKE_PREFIX_PATH=${llvmPackages.llvm.dev}" ]; 21 23 22 24 postInstall = '' 23 25 substituteInPlace $out/bin/iwyu_tool.py \ 24 26 --replace "'include-what-you-use'" "'$out/bin/include-what-you-use'" 27 + 28 + 29 + mv $out/bin/include-what-you-use $out/bin/.include-what-you-use-unwrapped 30 + mv $out/bin/iwyu_tool.py $out/bin/.iwyu_tool.py-unwrapped 31 + substituteAll ${./wrapper} $out/bin/include-what-you-use 32 + ln -s $out/bin/include-what-you-use $out/bin/iwyu_tool.py 33 + chmod +x $out/bin/include-what-you-use 34 + patchShebangs $out/bin/include-what-you-use 25 35 ''; 26 36 27 37 meta = with lib; {
+26
pkgs/development/tools/analysis/include-what-you-use/wrapper
··· 1 + #!/bin/sh 2 + 3 + buildcpath() { 4 + local path after 5 + while (( $# )); do 6 + case $1 in 7 + -isystem) 8 + shift 9 + path=$path${path:+':'}$1 10 + ;; 11 + -idirafter) 12 + shift 13 + after=$after${after:+':'}$1 14 + ;; 15 + esac 16 + shift 17 + done 18 + echo $path${after:+':'}$after 19 + } 20 + 21 + export CPATH=${CPATH}${CPATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \ 22 + $(<@clang@/nix-support/libc-cflags)):@clang@/resource-root/include 23 + export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \ 24 + $(<@clang@/nix-support/libcxx-cxxflags) \ 25 + $(<@clang@/nix-support/libc-cflags)):@clang@/resource-root/include 26 + exec -a "$0" @out@/bin/.$(basename $0)-unwrapped "$@"
+1 -1
pkgs/top-level/all-packages.nix
··· 19390 19390 img = callPackage ../development/tools/img { }; 19391 19391 19392 19392 include-what-you-use = callPackage ../development/tools/analysis/include-what-you-use { 19393 - llvmPackages = llvmPackages_15; 19393 + llvmPackages = llvmPackages_17; 19394 19394 }; 19395 19395 19396 19396 indent = callPackage ../development/tools/misc/indent { };