@@ -33,7 +33,6 @@ common =
3333 version = lib.getVersion name;
3434
3535 is24 = lib.versionAtLeast version "2.4pre";
36− isExactly24 = lib.versionAtLeast version "2.4" && lib.versionOlder version "2.4";
3736
3837 VERSION_SUFFIX = suffix;
3938
@@ -93,9 +92,15 @@ common =
9392 patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
9493 ''}
9594 '' +
96− # For Nix 2.4, patch around an issue where the Nix configure step pulls in the
97− # build system's bash and other utilities when cross-compiling
98− lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform && isExactly24) ''
95+ # On all versions before c9f51e87057652db0013289a95deffba495b35e7,
96+ # released with 2.3.8, we need to patch around an issue where the Nix
97+ # configure step pulls in the build system's bash and other utilities
98+ # when cross-compiling.
99+ lib.optionalString (
100+ stdenv.buildPlatform != stdenv.hostPlatform &&
101+ (lib.versionOlder "2.3.8" (lib.traceVal version) && !is24)
102+ # The additional is24 condition is required as versionOlder doesn't understand nixUnstable version strings
103+ ) ''
99104 mkdir tmp/
100105 substitute corepkgs/config.nix.in tmp/config.nix.in \
101106 --subst-var-by bash ${bash}/bin/bash \