Skip to content

Commit

Permalink
swift-corelibs: set NIX_COREFOUNDATION_RPATH in a hook
Browse files Browse the repository at this point in the history
Closes #230870. Thanks to @eliasnaur for the test case and for rasining
awareness and to @veprbl for the work done on #111385.

This takes a slightly different approach from those two PRs. The hook is
set unconditionally. The stdenv bootstrap doesn’t really need CF at all,
so setting the hook is harmless. This simplifies things.
  • Loading branch information
reckenrode committed May 29, 2023
1 parent 5611fa7 commit 0d3355a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, fetchurl, ninja, python3, curl, libxml2, objc4, ICU }:
{ lib, stdenv, fetchFromGitHub, fetchurl, makeSetupHook, ninja, python3, curl, libxml2, objc4, ICU }:

let
# 10.12 adds a new sysdir.h that our version of CF in the main derivation depends on, but
Expand Down Expand Up @@ -104,4 +104,6 @@ stdenv.mkDerivation {
ln -s Versions/Current/$i $base/$i
done
'';

darwinEnvHook = makeSetupHook { name = "darwin-env-hook"; } ./pure-corefoundation-hook.sh;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
usePureCoreFoundation() {
# Avoid overriding value set by the impure CF
if [ -z "${NIX_COREFOUNDATION_RPATH:-}" ]; then
export NIX_COREFOUNDATION_RPATH=@out@/Library/Frameworks
fi
}
addEnvHooks "$hostOffset" usePureCoreFoundation

0 comments on commit 0d3355a

Please sign in to comment.