expand-response-params: Build more normally

This commit is contained in:
John Ericson 2017-08-23 16:39:15 -04:00 committed by John Ericson
parent 287fce6402
commit a470be5a16
4 changed files with 15 additions and 8 deletions

View File

@ -342,7 +342,8 @@ stdenv.mkDerivation {
inherit dynamicLinker expand-response-params; inherit dynamicLinker expand-response-params;
expandResponseParams = expand-response-params; # for substitution in utils.sh # for substitution in utils.sh
expandResponseParams = "${expand-response-params}/bin/expand-response-params";
crossAttrs = { crossAttrs = {
shell = shell.crossDrv + shell.crossDrv.shellPath; shell = shell.crossDrv + shell.crossDrv.shellPath;

View File

@ -30,7 +30,7 @@ expandResponseParams() {
if [[ "$arg" == @* ]]; then if [[ "$arg" == @* ]]; then
# phase separation makes this look useless # phase separation makes this look useless
# shellcheck disable=SC2157 # shellcheck disable=SC2157
if [ -n "@expandResponseParams@" ]; then if [ -x "@expandResponseParams@" ]; then
# params is used by caller # params is used by caller
#shellcheck disable=SC2034 #shellcheck disable=SC2034
readarray -d '' params < <("@expandResponseParams@" "$@") readarray -d '' params < <("@expandResponseParams@" "$@")

View File

@ -3,11 +3,17 @@
stdenv.mkDerivation { stdenv.mkDerivation {
name = "expand-response-params"; name = "expand-response-params";
src = ./expand-response-params.c; src = ./expand-response-params.c;
buildCommand = '' # Work around "stdenv-darwin-boot-2 is not allowed to refer to path
# Work around "stdenv-darwin-boot-2 is not allowed to refer to path /nix/store/...-expand-response-params.c" # /nix/store/...-expand-response-params.c"
unpackPhase = ''
cp "$src" expand-response-params.c cp "$src" expand-response-params.c
"$CC" -std=c99 -O3 -o "$out" expand-response-params.c src=$PWD
strip -S $out '';
${stdenv.lib.optionalString stdenv.hostPlatform.isLinux "patchelf --shrink-rpath $out"} buildPhase = ''
"$CC" -std=c99 -O3 -o "expand-response-params" expand-response-params.c
'';
installPhase = ''
mkdir -p $prefix/bin
mv expand-response-params $prefix/bin/
''; '';
} }

View File

@ -310,7 +310,7 @@ in
# More complicated cases # More complicated cases
++ [ ++ [
glibc.out glibc.dev glibc.bin/*propagated from .dev*/ linuxHeaders glibc.out glibc.dev glibc.bin/*propagated from .dev*/ linuxHeaders
gcc gcc.cc gcc.cc.lib gcc.expandResponseParams gcc gcc.cc gcc.cc.lib gcc.expand-response-params
] ]
++ lib.optionals (system == "aarch64-linux") ++ lib.optionals (system == "aarch64-linux")
[ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ]; [ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ];