summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
diff options
context:
space:
mode:
authorRandy Eckenrode <randy@largeandhighquality.com>2023-06-21 08:20:55 -0400
committerRandy Eckenrode <randy@largeandhighquality.com>2023-07-02 17:56:25 -0400
commit8bee297d1517f527fbbac310e6096f573e226b9c (patch)
tree2d3bd8412897198b2433d9615d6e6a8ce90adc34 /pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
parentebc1bcf409aa6398eb6da67aa95a5c2a2b944fc2 (diff)
downloadnixpkgs-8bee297d1517f527fbbac310e6096f573e226b9c.tar
nixpkgs-8bee297d1517f527fbbac310e6096f573e226b9c.tar.gz
nixpkgs-8bee297d1517f527fbbac310e6096f573e226b9c.tar.bz2
nixpkgs-8bee297d1517f527fbbac310e6096f573e226b9c.tar.lz
nixpkgs-8bee297d1517f527fbbac310e6096f573e226b9c.tar.xz
nixpkgs-8bee297d1517f527fbbac310e6096f573e226b9c.tar.zst
nixpkgs-8bee297d1517f527fbbac310e6096f573e226b9c.zip
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.
Diffstat (limited to 'pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix')
-rw-r--r--pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
index 5bd3e201056..d77976773c6 100644
--- a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
+++ b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
@@ -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"
+  '';
 }