introduce separate cf-private package to account for no CLT

This commit is contained in:
Jude Taylor 2015-10-06 00:11:00 -07:00
parent bcf536ff3f
commit 7283bb7466
7 changed files with 36 additions and 27 deletions

View file

@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, ncurses, gettext, pkgconfig
# apple frameworks
, CoreServices, CoreData, Cocoa, Foundation, libobjc }:
, CoreServices, CoreData, Cocoa, Foundation, libobjc, cf-private }:
stdenv.mkDerivation rec {
name = "vim-${version}";
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
buildInputs = [ ncurses pkgconfig ]
++ stdenv.lib.optionals stdenv.isDarwin [ CoreData CoreServices Cocoa Foundation libobjc ];
++ stdenv.lib.optionals stdenv.isDarwin [ cf-private CoreData CoreServices Cocoa Foundation libobjc ];
nativeBuildInputs = [ gettext ];
configureFlags = [

View file

@ -50,6 +50,9 @@ let
phases = [ "installPhase" "fixupPhase" ];
# because we copy files from the system
preferLocalBuild = true;
installPhase = ''
linkFramework() {
local path="$1"

View file

@ -47,16 +47,6 @@ appleDerivation {
'';
postInstall = ''
# gross! convince apple to release these as part of CF
cp /System/Library/Frameworks/CoreFoundation.framework/Headers/{CFAttributedString,CFNotificationCenter}.h \
"$out/System/Library/Frameworks/CoreFoundation.framework/Headers"
cat >> $out/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h <<EOF
/* extra private system files [IMPURE] */
#include <CoreFoundation/CFAttributedString.h>
#include <CoreFoundation/CFNotificationCenter.h>
EOF
mv $out/System/* $out
rmdir $out/System
'';

View file

@ -0,0 +1,18 @@
{ stdenv, osx_private_sdk, CF }:
let
headers = [
"CFAttributedString.h"
"CFNotificationCenter.h"
"CoreFoundation.h"
];
in stdenv.mkDerivation {
name = "${CF.name}-private";
unpackPhase = ":";
buildPhase = ":";
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
'';
}

View file

@ -1,16 +1,7 @@
{ stdenv, fetchzip }:
{ stdenv, fetchgit }:
let full = stdenv.lib.overrideDerivation (fetchzip {
url = "https://github.com/samdmarshall/OSXPrivateSDK/tarball/69bf3c7f7140ed6ab2b6684b427bd457209858fe";
name = "osx-private-sdk-10.9";
sha256 = "1agl4kyry6m7yz3sql5mrbvmd1xkmb4nbq976phcpk19inans1zm";
}) (drv: {
postFetch = ''
unpackFile() {
tar xzf "$1"
}
'' + drv.postFetch;
}); in {
outPath = "${full}/PrivateSDK10.9";
passthru.sdk10 = "${full}/PrivateSDK10.10";
fetchgit {
url = "https://github.com/samdmarshall/OSXPrivateSDK.git";
rev = "f4d52b60e86b496abfaffa119a7d299562d99783";
sha256 = "0v1l11fqpqnzd5l2vq5c63jm1vrba56r06zpqnag87j5p1gic8lp";
}

View file

@ -43,6 +43,8 @@ in rec {
export MACOSX_DEPLOYMENT_TARGET=10.7
export SDKROOT=
export CMAKE_OSX_ARCHITECTURES=x86_64
# Workaround for https://openradar.appspot.com/22671534 on 10.11.
export gl_cv_func_getcwd_abort_bug=no
'';
# The one dependency of /bin/sh :(

View file

@ -9483,6 +9483,11 @@ let
cctools = (callPackage ../os-specific/darwin/cctools/port.nix { inherit libobjc; }).native;
cf-private = callPackage ../os-specific/darwin/cf-private {
inherit (apple-source-releases) CF;
inherit osx_private_sdk;
};
maloader = callPackage ../os-specific/darwin/maloader {
inherit opencflite;
};
@ -13000,7 +13005,7 @@ let
vim = callPackage ../applications/editors/vim {
inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData;
inherit (darwin) libobjc;
inherit (darwin) libobjc cf-private;
};
macvim = callPackage ../applications/editors/vim/macvim.nix { stdenv = clangStdenv; };