diff --git a/pkgs/development/cuda-modules/buildRedist/buildRedistHook.bash b/pkgs/development/cuda-modules/buildRedist/buildRedistHook.bash index d4393e0ae234..30b5ab5ca1e8 100644 --- a/pkgs/development/cuda-modules/buildRedist/buildRedistHook.bash +++ b/pkgs/development/cuda-modules/buildRedist/buildRedistHook.bash @@ -164,9 +164,7 @@ checkCudaHasStubsIffIncludeRemoveStubsFromRunpathHook() { # The dependency should be recorded in both propagated-native-build-inputs and propagated-build-inputs, so the # hook is propagated regardless of which dependency array includes the stubs-providing output. hasRemoveStubsFromRunpathHook=0 - if - grep --silent --no-messages removeStubsFromRunpathHook "${!outputName:?}/nix-support/propagated-native-build-inputs" && - grep --silent --no-messages removeStubsFromRunpathHook "${!outputName:?}/nix-support/propagated-build-inputs" + if grep --silent --no-messages removeStubsFromRunpathHook "${!outputName:?}/nix-support/propagated-build-inputs" then hasRemoveStubsFromRunpathHook=1 fi diff --git a/pkgs/development/cuda-modules/buildRedist/default.nix b/pkgs/development/cuda-modules/buildRedist/default.nix index ce9c6a7e7a5a..831920a57e30 100644 --- a/pkgs/development/cuda-modules/buildRedist/default.nix +++ b/pkgs/development/cuda-modules/buildRedist/default.nix @@ -343,16 +343,14 @@ extendMkDerivation { inherit allowFHSReferences; inherit includeRemoveStubsFromRunpathHook; - postFixup = - postFixup - + optionalString finalAttrs.includeRemoveStubsFromRunpathHook '' + postFixup = postFixup + '' + if [[ -n "''${includeRemoveStubsFromRunpathHook:-}" ]] ; then nixLog "installing stub removal runpath hook" mkdir -p "''${!outputStubs:?}/nix-support" - printWords >>"''${!outputStubs:?}/nix-support/propagated-native-build-inputs" \ - "${getDev removeStubsFromRunpathHook.__spliced.buildHost or removeStubsFromRunpathHook}" printWords >>"''${!outputStubs:?}/nix-support/propagated-build-inputs" \ - "${getDev removeStubsFromRunpathHook.__spliced.hostTarget or removeStubsFromRunpathHook}" - ''; + "${getDev removeStubsFromRunpathHook}" + fi + ''; passthru = passthru // { inherit redistName release;