From cc1bfbd9a7f0fe7f7c4f0dec81990b5ce7d6cff3 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 22 Jul 2017 13:31:48 +0200 Subject: [PATCH] darwin-frameworks: use the system CF when frameworks are used This will get propagated down to other libraries loaded because everything in nixpkgs references CF based on an rpath entry. --- pkgs/os-specific/darwin/apple-sdk/default.nix | 2 +- .../os-specific/darwin/apple-sdk/framework-setup-hook.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 73126ce1f5c..957b610f3a2 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -134,7 +134,7 @@ let propagatedBuildInputs = deps; # don't use pure CF for dylibs that depend on frameworks - setupHook = ../../../build-support/setup-hooks/fix-darwin-frameworks.sh; + setupHook = ./framework-setup-hook.sh; # allows building the symlink tree __impureHostDeps = [ "/System/Library/Frameworks/${name}.framework" ]; diff --git a/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh b/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh new file mode 100644 index 00000000000..9d96a4adbaa --- /dev/null +++ b/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh @@ -0,0 +1,9 @@ +# This configures the stdenv to use /System/Library/Frameworks/CoreFoundation.framework +# instead of the nix version by including the system frameworks path +# as an rpath entry when creating binaries. + +useSystemCoreFoundationFramework () { + export NIX_COREFOUNDATION_RPATH=/System/Library/Frameworks +} + +envHooks+=(useSystemCoreFoundationFramework)