mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-01 01:57:37 +03:00
Merge pull request #249147 from chayleaf/ccache
This commit is contained in:
commit
411b15270f
@ -86,11 +86,19 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
};
|
};
|
||||||
inherit (unwrappedCC) lib;
|
inherit (unwrappedCC) lib;
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
buildCommand = ''
|
# Unwrapped clang does not have a targetPrefix because it is multi-target
|
||||||
|
# target is decided with argv0.
|
||||||
|
buildCommand = let
|
||||||
|
targetPrefix = if unwrappedCC.isClang or false
|
||||||
|
then
|
||||||
|
""
|
||||||
|
else
|
||||||
|
(lib.optionalString (unwrappedCC ? targetConfig && unwrappedCC.targetConfig != null && unwrappedCC.targetConfig != "") "${unwrappedCC.targetConfig}-");
|
||||||
|
in ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
|
|
||||||
wrap() {
|
wrap() {
|
||||||
local cname="$1"
|
local cname="${targetPrefix}$1"
|
||||||
if [ -x "${unwrappedCC}/bin/$cname" ]; then
|
if [ -x "${unwrappedCC}/bin/$cname" ]; then
|
||||||
makeWrapper ${finalAttrs.finalPackage}/bin/ccache $out/bin/$cname \
|
makeWrapper ${finalAttrs.finalPackage}/bin/ccache $out/bin/$cname \
|
||||||
--run ${lib.escapeShellArg extraConfig} \
|
--run ${lib.escapeShellArg extraConfig} \
|
||||||
@ -127,6 +135,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version
|
builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version
|
||||||
}";
|
}";
|
||||||
license = licenses.gpl3Plus;
|
license = licenses.gpl3Plus;
|
||||||
|
mainProgram = "ccache";
|
||||||
maintainers = with maintainers; [ kira-bruneau r-burns ];
|
maintainers = with maintainers; [ kira-bruneau r-burns ];
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user