summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/apple-source-releases/libauto/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/libauto/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/libauto/default.nix')
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libauto/default.nix74
1 files changed, 74 insertions, 0 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libauto/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libauto/default.nix
new file mode 100644
index 00000000000..1c61297c7d5
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/libauto/default.nix
@@ -0,0 +1,74 @@
+{ stdenv, appleDerivation }:
+
+appleDerivation {
+  buildPhase = ''
+    cp ${./auto_dtrace.h} ./auto_dtrace.h
+
+    substituteInPlace auto_zone.cpp \
+      --replace "#include <msgtracer_client.h>" ''$'#include <asl.h>\nstatic void msgtracer_log_with_keys(...) { };'
+
+    substituteInPlace Definitions.h \
+      --replace "#include <System/pthread_machdep.h>" ""
+
+    # getspecific_direct is more efficient, but this should be equivalent...
+    substituteInPlace Zone.h \
+      --replace "_pthread_getspecific_direct" "pthread_getspecific" \
+      --replace "_pthread_has_direct_tsd()" "0" \
+      --replace "__PTK_FRAMEWORK_GC_KEY0" "110" \
+      --replace "__PTK_FRAMEWORK_GC_KEY1" "111" \
+      --replace "__PTK_FRAMEWORK_GC_KEY2" "112" \
+      --replace "__PTK_FRAMEWORK_GC_KEY3" "113" \
+      --replace "__PTK_FRAMEWORK_GC_KEY4" "114" \
+      --replace "__PTK_FRAMEWORK_GC_KEY5" "115" \
+      --replace "__PTK_FRAMEWORK_GC_KEY6" "116" \
+      --replace "__PTK_FRAMEWORK_GC_KEY7" "117" \
+      --replace "__PTK_FRAMEWORK_GC_KEY8" "118" \
+      --replace "__PTK_FRAMEWORK_GC_KEY9" "119"
+
+    substituteInPlace auto_zone.cpp \
+      --replace "__PTK_FRAMEWORK_GC_KEY9" "119" \
+      --replace "__PTK_FRAMEWORK_GC_KEY0" "110" \
+
+    substituteInPlace Zone.cpp \
+      --replace "_pthread_getspecific_direct" "pthread_getspecific" \
+      --replace "__PTK_FRAMEWORK_GC_KEY9" "119" \
+      --replace "__PTK_FRAMEWORK_GC_KEY0" "110" \
+      --replace "__PTK_LIBDISPATCH_KEY0"  "20" \
+      --replace "struct auto_zone_cursor {" ''$'extern "C" int pthread_key_init_np(int, void (*)(void *));\nstruct auto_zone_cursor {'
+
+    substituteInPlace auto_impl_utilities.c \
+      --replace "#   include <CrashReporterClient.h>" "void CRSetCrashLogMessage(void *msg) { };"
+
+    c++ -I. -O3 -c -Wno-c++11-extensions auto_zone.cpp
+    cc  -I. -O3 -Iauto_tester -c auto_impl_utilities.c
+    c++ -I. -O3 -c auto_weak.cpp
+    c++ -I. -O3 -c Admin.cpp
+    c++ -I. -O3 -c Bitmap.cpp
+    c++ -I. -O3 -c Definitions.cpp
+    c++ -I. -O3 -c Environment.cpp
+    c++ -I. -O3 -c Large.cpp
+    c++ -I. -O3 -c Region.cpp
+    c++ -I. -O3 -c Subzone.cpp
+    c++ -I. -O3 -c WriteBarrier.cpp
+    c++ -I. -O3 -c Zone.cpp
+    c++ -I. -O3 -c Thread.cpp
+    c++ -I. -O3 -c InUseEnumerator.cpp
+    c++ -I. -O3 -c auto_gdb_interface.cpp
+    c++ -I. -O3 -c PointerHash.cpp
+    c++ -I. -O3 -c ThreadLocalCollector.cpp
+    c++ -I. -O3 -c ZoneDump.cpp
+    c++ -I. -O3 -c ZoneCollectors.cpp
+    c++ -I. -O3 -c SubzonePartition.cpp
+    c++ -I. -O3 -c ZoneCollectionChecking.cpp
+    c++ -I. -O3 -c ZoneCompaction.cpp
+    c++ -I. -O3 -c BlockRef.cpp
+
+    c++ -Wl,-no_dtrace_dof --stdlib=libc++ -dynamiclib -install_name $out/lib/libauto.dylib -o libauto.dylib *.o
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib $out/include
+    cp auto_zone.h auto_weak.h auto_tester/auto_tester.h auto_gdb_interface.h $out/include
+    cp libauto.dylib $out/lib
+  '';
+}