lol

Merge #329526: haskell-modules/generic-builder.nix: work around useSystemCoreFoundationFramework hook

...into staging-next

+31 -1
+31 -1
pkgs/development/haskell-modules/generic-builder.nix
··· 150 150 151 151 let 152 152 153 + # This is a workaround for the 2024-07-20 staging-next cycle to avoid causing mass rebuilds. 154 + # todo(@reckenrode) Remove this workaround and remove `NIX_COREFOUNDATION_RPATH`, the related hooks, and ld-wrapper support. 155 + nixCoreFoundationRpathWorkaround = stdenv.mkDerivation { 156 + name = "nix-corefoundation-rpath-workaround"; 157 + buildCommand = '' 158 + mkdir -p "$out/nix-support" 159 + cat <<-EOF > "$out/nix-support/setup-hook" 160 + removeUseSystemCoreFoundationFrameworkHook() { 161 + unset NIX_COREFOUNDATION_RPATH 162 + local _hook 163 + for _hook in envBuildBuildHooks envBuildHostHooks envBuildTargetHooks envHostHostHooks envHostTargetHooks envTargetTargetHooks; do 164 + local _index=0 165 + local _var="\$_hook[@]" 166 + for _var in "\''${!_var}"; do 167 + if [ "\$_var" = "useSystemCoreFoundationFramework" ]; then 168 + unset "\$_hook[\$_index]" 169 + fi 170 + ((++_index)) 171 + done 172 + unset _index 173 + unset _var 174 + done 175 + unset _hook 176 + } 177 + addEnvHooks "\$hostOffset" removeUseSystemCoreFoundationFrameworkHook 178 + EOF 179 + ''; 180 + }; 181 + 153 182 inherit (lib) optional optionals optionalString versionAtLeast 154 183 concatStringsSep enableFeature optionalAttrs; 155 184 ··· 430 459 inherit depsBuildBuild nativeBuildInputs; 431 460 buildInputs = otherBuildInputs ++ optionals (!isLibrary) propagatedBuildInputs 432 461 # For patchShebangsAuto in fixupPhase 433 - ++ optionals stdenv.hostPlatform.isGhcjs [ nodejs ]; 462 + ++ optionals stdenv.hostPlatform.isGhcjs [ nodejs ] 463 + ++ optionals (stdenv.isDarwin && stdenv.isx86_64) [ nixCoreFoundationRpathWorkaround ]; 434 464 propagatedBuildInputs = optionals isLibrary propagatedBuildInputs; 435 465 436 466 LANG = "en_US.UTF-8"; # GHC needs the locale configured during the Haddock phase.