mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-16 06:47:09 +03:00
Merge pull request #27598 from LnL7/darwin-cf-rpath
CoreFoundation: use rpath to fix issues when using frameworks
This commit is contained in:
commit
adca58c2e7
@ -145,6 +145,10 @@ if [ "$NIX_@infixSalt@_DONT_SET_RPATH" != 1 ]; then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -n "${NIX_COREFOUNDATION_RPATH:-}" ]; then
|
||||||
|
extraAfter+=(-rpath $NIX_COREFOUNDATION_RPATH)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ let
|
|||||||
propagatedBuildInputs = deps;
|
propagatedBuildInputs = deps;
|
||||||
|
|
||||||
# don't use pure CF for dylibs that depend on frameworks
|
# 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
|
# allows building the symlink tree
|
||||||
__impureHostDeps = [ "/System/Library/Frameworks/${name}.framework" ];
|
__impureHostDeps = [ "/System/Library/Frameworks/${name}.framework" ];
|
||||||
|
@ -29,3 +29,14 @@ fixDarwinFrameworksIn() {
|
|||||||
local dir="$1"
|
local dir="$1"
|
||||||
fixDarwinFrameworks $(find "$dir" -name "*.dylib")
|
fixDarwinFrameworks $(find "$dir" -name "*.dylib")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# 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)
|
@ -18,7 +18,7 @@ appleDerivation {
|
|||||||
--replace "/usr/sbin/" "" \
|
--replace "/usr/sbin/" "" \
|
||||||
--replace "/bin/" "" \
|
--replace "/bin/" "" \
|
||||||
--replace "INSTALLNAME=/System" "INSTALLNAME=$out" \
|
--replace "INSTALLNAME=/System" "INSTALLNAME=$out" \
|
||||||
--replace "install_name_tool -id /System" "install_name_tool -id $out" \
|
--replace "install_name_tool -id /System/Library/Frameworks" "install_name_tool -id @rpath" \
|
||||||
--replace 'chown -RH -f root:wheel $(DSTBASE)/CoreFoundation.framework' "" \
|
--replace 'chown -RH -f root:wheel $(DSTBASE)/CoreFoundation.framework' "" \
|
||||||
--replace 'chmod -RH' 'chmod -R'
|
--replace 'chmod -RH' 'chmod -R'
|
||||||
|
|
||||||
|
@ -300,6 +300,7 @@ in rec {
|
|||||||
targetPlatform = localSystem;
|
targetPlatform = localSystem;
|
||||||
|
|
||||||
preHook = commonPreHook + ''
|
preHook = commonPreHook + ''
|
||||||
|
export NIX_COREFOUNDATION_RPATH=${pkgs.darwin.CF}/Library/Frameworks
|
||||||
export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
|
export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -328,8 +328,6 @@ with pkgs;
|
|||||||
|
|
||||||
fixDarwinDylibNames = makeSetupHook { } ../build-support/setup-hooks/fix-darwin-dylib-names.sh;
|
fixDarwinDylibNames = makeSetupHook { } ../build-support/setup-hooks/fix-darwin-dylib-names.sh;
|
||||||
|
|
||||||
fixDarwinFrameworks = makeSetupHook { } ../build-support/setup-hooks/fix-darwin-frameworks.sh;
|
|
||||||
|
|
||||||
keepBuildTree = makeSetupHook { } ../build-support/setup-hooks/keep-build-tree.sh;
|
keepBuildTree = makeSetupHook { } ../build-support/setup-hooks/keep-build-tree.sh;
|
||||||
|
|
||||||
enableGCOVInstrumentation = makeSetupHook { } ../build-support/setup-hooks/enable-coverage-instrumentation.sh;
|
enableGCOVInstrumentation = makeSetupHook { } ../build-support/setup-hooks/enable-coverage-instrumentation.sh;
|
||||||
|
Loading…
Reference in New Issue
Block a user