forked from mirrors/nixpkgs
responsie file logic
This commit is contained in:
parent
ece4c62d4b
commit
11b4d6c633
|
@ -180,7 +180,18 @@ fi
|
|||
|
||||
PATH="$path_backup"
|
||||
# Old bash workaround, see above.
|
||||
exec @prog@ \
|
||||
${extraBefore+"${extraBefore[@]}"} \
|
||||
${params+"${params[@]}"} \
|
||||
${extraAfter+"${extraAfter[@]}"}
|
||||
|
||||
if (( "${NIX_CC_USE_RESPONSE_FILE:-@use_response_file_by_default@}" >= 1 )); then
|
||||
RESPONSE_FILE=$(mktemp)
|
||||
printf "%q\n" \
|
||||
${extraBefore+"${extraBefore[@]}"} \
|
||||
${params+"${params[@]}"} \
|
||||
${extraAfter+"${extraAfter[@]}"} \
|
||||
> "${RESPONSE_FILE}"
|
||||
exec @prog@ "@${RESPONSE_FILE}"
|
||||
else
|
||||
exec @prog@ \
|
||||
${extraBefore+"${extraBefore[@]}"} \
|
||||
${params+"${params[@]}"} \
|
||||
${extraAfter+"${extraAfter[@]}"}
|
||||
fi
|
||||
|
|
|
@ -121,6 +121,7 @@ stdenv.mkDerivation {
|
|||
local dst="$1"
|
||||
local wrapper="$2"
|
||||
export prog="$3"
|
||||
export use_response_file_by_default=${if isClang then "1" else "0"}
|
||||
substituteAll "$wrapper" "$out/bin/$dst"
|
||||
chmod +x "$out/bin/$dst"
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ stdenv.mkDerivation {
|
|||
src=$PWD
|
||||
'';
|
||||
buildPhase = ''
|
||||
"$CC" -std=c99 -O3 -o "expand-response-params" expand-response-params.c
|
||||
NIX_CC_USE_RESPONSE_FILE=0 "$CC" -std=c99 -O3 -o "expand-response-params" expand-response-params.c
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $prefix/bin
|
||||
|
|
Loading…
Reference in a new issue