3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #234861 from reckenrode/corefoundation-rpath

swift-corelibs: set NIX_COREFOUNDATION_RPATH in a hook
This commit is contained in:
toonn 2023-06-11 17:13:54 +02:00 committed by GitHub
commit b7d4899ad5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -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
@ -104,4 +104,6 @@ stdenv.mkDerivation {
ln -s Versions/Current/$i $base/$i
done
'';
darwinEnvHook = makeSetupHook { name = "darwin-env-hook"; } ./pure-corefoundation-hook.sh;
}

View file

@ -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

View file

@ -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
'';