Skip to content

Commit

Permalink
swift-corelibs: actually provide and use the hook
Browse files Browse the repository at this point in the history
@emilazy found a bug in #234861 when building e2fsprogs in that the hook
is not actually applied, so e2fsprogs fails to have its rpath set and
fails to find CoreFoundation and crashes.

To fix the bug, copy the hook into CF’s `nix-support/setup-hook`. That
will cause the hook to be used by anything that requires it. To avoid
further churn to the previous stdenv, this commit requires the rework,
which has been written to build successfully while this hook is active.
  • Loading branch information
reckenrode committed Jun 29, 2023
1 parent 8f92e69 commit 3eb551f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ stdenv.mkDerivation {
enableParallelBuilding = true;

postInstall = ''
install_name_tool -id '@rpath/CoreFoundation.framework/Versions/A/CoreFoundation' \
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"
'';
}

0 comments on commit 3eb551f

Please sign in to comment.