Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swift-corelibs: set NIX_COREFOUNDATION_RPATH in a hook #234861

Merged
merged 2 commits into from
Jun 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
toonn marked this conversation as resolved.
Show resolved Hide resolved
fi
}
addEnvHooks "$hostOffset" usePureCoreFoundation
1 change: 0 additions & 1 deletion pkgs/stdenv/darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@ rec {
targetPlatform = localSystem;

preHook = commonPreHook + ''
export NIX_COREFOUNDATION_RPATH=${pkgs.darwin.CF}/Library/Frameworks
export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
'';

Expand Down