summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix
diff options
context:
space:
mode:
authorDan Peebles <thetypesaretoobig@gmail.com>2015-02-08 01:53:52 -0500
committerDan Peebles <thetypesaretoobig@gmail.com>2015-02-08 01:53:52 -0500
commit29f265dfd28ce5567106a7a1df3bd6c1fbd8406f (patch)
tree3973e0a11ae1737f8d307ec07651cf5c12498210 /pkgs/os-specific/darwin/apple-source-releases/CF/default.nix
parentf43c324cee6ed5fdbe679b70b71caaca1c4629a8 (diff)
downloadnixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar
nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar.gz
nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar.bz2
nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar.lz
nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar.xz
nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar.zst
nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.zip
Add a big bundle of packages from apple source releases. Many of them only provide headers or stubs, but are what's needed for the upcoming pure-darwin stdenv, and don't do any harm for now.
Diffstat (limited to 'pkgs/os-specific/darwin/apple-source-releases/CF/default.nix')
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/CF/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix b/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix
new file mode 100644
index 00000000000..3d4ac89e0a7
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, appleDerivation, icu, dyld, libdispatch, launchd, libclosure }:
+
+appleDerivation {
+  buildInputs = [ dyld icu libdispatch launchd libclosure ];
+
+  patches = [ ./add-cf-initialize.patch ./add-cfmachport.patch ];
+
+  preBuild = ''
+    substituteInPlace Makefile \
+      --replace "/usr/bin/clang" "clang" \
+      --replace "-arch i386 " "" \
+      --replace "/usr/bin/" "" \
+      --replace "/usr/sbin/" "" \
+      --replace "/bin/" "" \
+      --replace "INSTALLNAME=/System" "INSTALLNAME=$out" \
+      --replace "install_name_tool -id /System" "install_name_tool -id $out" \
+      --replace "-licucore.A" "-licui18n -licuuc" \
+      --replace 'chown -RH -f root:wheel $(DSTBASE)/CoreFoundation.framework' "" \
+      --replace 'chmod -RH' 'chmod -R'
+
+    replacement=''$'#define __PTK_FRAMEWORK_COREFOUNDATION_KEY5 55\n#define _pthread_getspecific_direct(key) pthread_getspecific((key))\n#define _pthread_setspecific_direct(key, val) pthread_setspecific((key), (val))'
+
+    substituteInPlace CFPlatform.c --replace "#include <pthread/tsd_private.h>" "$replacement"
+
+    substituteInPlace CFRunLoop.c --replace "#include <pthread/private.h>" ""
+
+    substituteInPlace CFURLPriv.h \
+      --replace "#include <CoreFoundation/CFFileSecurity.h>" "" \
+      --replace "#include <CoreFoundation/CFURLEnumerator.h>" "" \
+      --replace "CFFileSecurityRef" "void *" \
+      --replace "CFURLEnumeratorResult" "void *" \
+      --replace "CFURLEnumeratorRef" "void *"
+
+    export DSTROOT=$out
+  '';
+
+  postInstall = ''
+    mv $out/System/* $out
+    rmdir $out/System
+  '';
+}