diff options
author | Jude Taylor <me@jude.bio> | 2015-10-26 17:12:45 -0700 |
---|---|---|
committer | Jude Taylor <me@jude.bio> | 2015-10-26 17:13:29 -0700 |
commit | 5ea8770263051f593208df57d938709e0636fb25 (patch) | |
tree | 083ce88d3c6b24fafc232eb9c77561f204a6ff0c /pkgs/os-specific/darwin/cf-private | |
parent | 0a23e412b42c93df1c258a300109268f026e5456 (diff) | |
download | nixlib-5ea8770263051f593208df57d938709e0636fb25.tar nixlib-5ea8770263051f593208df57d938709e0636fb25.tar.gz nixlib-5ea8770263051f593208df57d938709e0636fb25.tar.bz2 nixlib-5ea8770263051f593208df57d938709e0636fb25.tar.lz nixlib-5ea8770263051f593208df57d938709e0636fb25.tar.xz nixlib-5ea8770263051f593208df57d938709e0636fb25.tar.zst nixlib-5ea8770263051f593208df57d938709e0636fb25.zip |
cf-private: prepend self to system includes
Diffstat (limited to 'pkgs/os-specific/darwin/cf-private')
-rw-r--r-- | pkgs/os-specific/darwin/cf-private/default.nix | 20 | ||||
-rw-r--r-- | pkgs/os-specific/darwin/cf-private/setup-hook.sh | 12 |
2 files changed, 28 insertions, 4 deletions
diff --git a/pkgs/os-specific/darwin/cf-private/default.nix b/pkgs/os-specific/darwin/cf-private/default.nix index 8c91e7fb2973..17b2861a107b 100644 --- a/pkgs/os-specific/darwin/cf-private/default.nix +++ b/pkgs/os-specific/darwin/cf-private/default.nix @@ -3,16 +3,28 @@ let headers = [ "CFAttributedString.h" + "CFFileDescriptor.h" + "CFFileSecurity.h" "CFNotificationCenter.h" + "CFStringTokenizer.h" + "CFURLEnumerator.h" "CoreFoundation.h" ]; in stdenv.mkDerivation { name = "${CF.name}-private"; - unpackPhase = ":"; - buildPhase = ":"; + phases = [ "installPhase" "fixupPhase" ]; installPhase = '' - mkdir -p $out/include/CoreFoundation - install -m 0644 ${osx_private_sdk}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/{${stdenv.lib.concatStringsSep "," headers}} $out/include/CoreFoundation + dest=$out/Library/Frameworks/CoreFoundation.framework/Headers + mkdir -p $dest + pushd $dest + for file in ${CF}/Library/Frameworks/CoreFoundation.framework/Headers/*; do + ln -s $file + done + popd + + install -m 0644 ${osx_private_sdk}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/{${stdenv.lib.concatStringsSep "," headers}} $dest ''; + + setupHook = ./setup-hook.sh; } diff --git a/pkgs/os-specific/darwin/cf-private/setup-hook.sh b/pkgs/os-specific/darwin/cf-private/setup-hook.sh new file mode 100644 index 000000000000..a83a1323bf83 --- /dev/null +++ b/pkgs/os-specific/darwin/cf-private/setup-hook.sh @@ -0,0 +1,12 @@ +prependSearchPath() { + NIX_CFLAGS_COMPILE="-F@out@/Library/Frameworks ${NIX_CFLAGS_COMPILE/"-F@out@/Library/Frameworks"/}" +} + +linkWithRealCF() { + # gross! many symbols (such as _OBJC_CLASS_$_NSArray) are defined in system CF, but not + # in the opensource release + # if the package needs private headers, we assume they also want to link with system CF + NIX_LDFLAGS+=" /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" +} + +preConfigureHooks+=(prependSearchPath linkWithRealCF) |