lol

Merge pull request #249147 from chayleaf/ccache

authored by

Artturi and committed by
GitHub
411b1527 f754085a

+11 -2
+11 -2
pkgs/development/tools/misc/ccache/default.nix
··· 86 86 }; 87 87 inherit (unwrappedCC) lib; 88 88 nativeBuildInputs = [ makeWrapper ]; 89 - buildCommand = '' 89 + # Unwrapped clang does not have a targetPrefix because it is multi-target 90 + # target is decided with argv0. 91 + buildCommand = let 92 + targetPrefix = if unwrappedCC.isClang or false 93 + then 94 + "" 95 + else 96 + (lib.optionalString (unwrappedCC ? targetConfig && unwrappedCC.targetConfig != null && unwrappedCC.targetConfig != "") "${unwrappedCC.targetConfig}-"); 97 + in '' 90 98 mkdir -p $out/bin 91 99 92 100 wrap() { 93 - local cname="$1" 101 + local cname="${targetPrefix}$1" 94 102 if [ -x "${unwrappedCC}/bin/$cname" ]; then 95 103 makeWrapper ${finalAttrs.finalPackage}/bin/ccache $out/bin/$cname \ 96 104 --run ${lib.escapeShellArg extraConfig} \ ··· 127 135 builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version 128 136 }"; 129 137 license = licenses.gpl3Plus; 138 + mainProgram = "ccache"; 130 139 maintainers = with maintainers; [ kira-bruneau r-burns ]; 131 140 platforms = platforms.unix; 132 141 };