binutils-unwrapped-all-targets: fix build on Darwin

gas isn't built for Darwin, so previously this failed when trying to
install it:

make: Entering directory '/private/tmp/nix-build-binutils-2.44.drv-0/build'
make: *** /private/tmp/nix-build-binutils-2.44.drv-0/build-arm64-apple-darwin/gas: No such file or directory. Stop.
make: Leaving directory '/private/tmp/nix-build-binutils-2.44.drv-0/build'

Fixes: 437ad124ac97 ("binutils-unwrapped-all-targets: per-target gas")

+8 -1
+8 -1
pkgs/development/tools/misc/binutils/default.nix
··· 38 # on the PATH to both be usable. 39 targetPrefix = lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; 40 41 # gas isn't multi-target, even with --enable-targets=all, so we do 42 # separate builds of just gas for each target. 43 # ··· 45 # additional targets here as required. 46 allGasTargets = 47 allGasTargets' 48 - ++ lib.optional (!lib.elem targetPlatform.config allGasTargets') targetPlatform.config; 49 allGasTargets' = [ 50 "aarch64-unknown-linux-gnu" 51 "alpha-unknown-linux-gnu" ··· 328 $makeFlags "''${makeFlagsArray[@]}" $installFlags "''${installFlagsArray[@]}" \ 329 install-exec-bindir 330 done 331 ln -s $out/bin/${stdenv.targetPlatform.config}-as $out/bin/as 332 ''; 333
··· 38 # on the PATH to both be usable. 39 targetPrefix = lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; 40 41 + # gas is disabled for some targets via noconfigdirs in configure. 42 + targetHasGas = !stdenv.targetPlatform.isDarwin; 43 + 44 # gas isn't multi-target, even with --enable-targets=all, so we do 45 # separate builds of just gas for each target. 46 # ··· 48 # additional targets here as required. 49 allGasTargets = 50 allGasTargets' 51 + ++ lib.optional ( 52 + targetHasGas && !lib.elem targetPlatform.config allGasTargets' 53 + ) targetPlatform.config; 54 allGasTargets' = [ 55 "aarch64-unknown-linux-gnu" 56 "alpha-unknown-linux-gnu" ··· 333 $makeFlags "''${makeFlagsArray[@]}" $installFlags "''${installFlagsArray[@]}" \ 334 install-exec-bindir 335 done 336 + '' 337 + + lib.optionalString (withAllTargets && targetHasGas) '' 338 ln -s $out/bin/${stdenv.targetPlatform.config}-as $out/bin/as 339 ''; 340