swift-corelibs: actually provide and use the hook

@emilazy found a bug in #234861. Specifically, the hook is not actually
applied. e2fsprogs links against darwin.CF, but since it cannot find the
framework by rpath, it crashes.

Since the hook should always be used, it is copied directly to
`nix-support/setup-hook` instead of providing it as an attribute. This
preserves dropping the hook in the cross-compilation case while
providing it for everything else that needs it.

To avoid further churn and due to the complexity of building the stdenv
with the hook active, this change required the stdenv rework.
This commit is contained in:
Randy Eckenrode 2023-06-21 08:20:55 -04:00
parent ebc1bcf409
commit 8bee297d15
No known key found for this signature in database
GPG Key ID: 64C1CD4EC2A600D9

View File

@ -84,7 +84,8 @@ stdenv.mkDerivation {
postInstall = ''
install_name_tool -id '@rpath/CoreFoundation.framework/Versions/A/CoreFoundation' \
"$out/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"
'';
darwinEnvHook = makeSetupHook { name = "darwin-env-hook"; } ./pure-corefoundation-hook.sh;
mkdir -p "$out/nix-support"
substituteAll ${./pure-corefoundation-hook.sh} "$out/nix-support/setup-hook"
'';
}