about summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/apple-source-releases
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/darwin/apple-source-releases')
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix4
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix69
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/configd/default.nix15
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/default.nix25
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix10
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix25
6 files changed, 87 insertions, 61 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix
index ce04be0e0836..16cfa9e554b6 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, appleDerivation, ed, unifdef, Libc_old, Libc_10-9 }:
+{ stdenv, appleDerivation, ed, unifdef, Libc_old }:
 
 appleDerivation {
   phases = [ "unpackPhase" "installPhase" ];
@@ -13,8 +13,6 @@ appleDerivation {
     export PRIVATE_HEADERS_FOLDER_PATH=include
     bash xcodescripts/headers.sh
 
-    cp ${Libc_10-9}/include/NSSystemDirectories.h $out/include
-
     # Ugh Apple stopped releasing this stuff so we need an older one...
     cp    ${Libc_old}/include/spawn.h    $out/include
     cp    ${Libc_old}/include/setjmp.h   $out/include
diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
index 27d2360a9800..1c9b5879e6ec 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
@@ -5,7 +5,42 @@
 appleDerivation rec {
   phases = [ "unpackPhase" "installPhase" ];
 
-  buildInputs = [ cpio ];
+  buildInputs = [ cpio libpthread ];
+
+  systemlibs = [ "cache"
+                 "commonCrypto"
+                 "compiler_rt"
+                 "copyfile"
+                 "corecrypto"
+                 "dispatch"
+                 "dyld"
+                 "keymgr"
+                 "kxld"
+                 "launch"
+                 "macho"
+                 "quarantine"
+                 "removefile"
+                 "system_asl"
+                 "system_blocks"
+                 # "system_c" # special re-export here to hide newer functions
+                 "system_configuration"
+                 "system_dnssd"
+                 "system_info"
+                 # "system_kernel" # special re-export here to hide newer functions
+                 "system_m"
+                 "system_malloc"
+                 "system_network"
+                 "system_notify"
+                 "system_platform"
+                 "system_pthread"
+                 "system_sandbox"
+                 # does not exist in El Capitan beta
+                 # FIXME: does anything on yosemite actually need this?
+                 # "system_stats"
+                 "unc"
+                 "unwind"
+                 "xpc"
+               ];
 
   installPhase = ''
     export NIX_ENFORCE_PURITY=
@@ -19,7 +54,7 @@ appleDerivation rec {
 
     for dep in ${Libc} ${Libm} ${Libinfo} ${dyld} ${architecture} ${libclosure} ${CarbonHeaders} \
                ${libdispatch} ${ncurses.dev} ${CommonCrypto} ${copyfile} ${removefile} ${libresolv} \
-               ${Libnotify} ${mDNSResponder} ${launchd} ${libutil} ${libpthread}; do
+               ${Libnotify} ${mDNSResponder} ${launchd} ${libutil}; do
       (cd $dep/include && find . -name '*.h' | cpio -pdm $out/include)
     done
 
@@ -56,9 +91,33 @@ appleDerivation rec {
     # The startup object files
     cp ${Csu}/lib/* $out/lib
 
-    # OMG impurity
-    ln -s /usr/lib/libSystem.B.dylib $out/lib/libSystem.B.dylib
-    ln -s /usr/lib/libSystem.dylib $out/lib/libSystem.dylib
+    # selectively re-export functions from libsystem_c and libsystem_kernel
+    # to provide a consistent interface across OSX verions
+    mkdir -p $out/lib/system
+    ld -macosx_version_min 10.7 -arch x86_64 -dylib \
+       -o $out/lib/system/libsystem_c.dylib \
+       /usr/lib/libSystem.dylib \
+       -reexported_symbols_list ${./system_c_symbols}
+
+    ld -macosx_version_min 10.7 -arch x86_64 -dylib \
+       -o $out/lib/system/libsystem_kernel.dylib \
+       /usr/lib/libSystem.dylib \
+       -reexported_symbols_list ${./system_kernel_symbols}
+
+    # Set up the actual library link
+    clang -c -o CompatibilityHacks.o -Os CompatibilityHacks.c
+    clang -c -o init.o -Os init.c
+    ld -macosx_version_min 10.7 \
+       -arch x86_64 \
+       -dylib \
+       -o $out/lib/libSystem.dylib \
+       CompatibilityHacks.o init.o \
+       -compatibility_version 1.0 \
+       -current_version 1197.1.1 \
+       -reexport_library $out/lib/system/libsystem_c.dylib \
+       -reexport_library $out/lib/system/libsystem_kernel.dylib \
+        ${stdenv.lib.concatStringsSep " "
+          (map (l: "-reexport_library /usr/lib/system/lib${l}.dylib") systemlibs)}
 
     # Set up links to pretend we work like a conventional unix (Apple's design, not mine!)
     for name in c dbm dl info m mx poll proc pthread rpcsvc util gcc_s.10.4 gcc_s.10.5; do
diff --git a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix
index 24797fc286a7..1fbacfb92845 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix
@@ -3,7 +3,7 @@
 appleDerivation {
   meta.broken = stdenv.cc.nativeLibc;
 
-  buildInputs = [ launchd bootstrap_cmds ppp IOKit eap8021x ];
+  buildInputs = [ launchd bootstrap_cmds xnu ppp IOKit eap8021x ];
 
   propagatedBuildInputs = [ Security ];
 
@@ -12,11 +12,6 @@ appleDerivation {
   '';
 
   patchPhase = ''
-    HACK=$PWD/hack
-    mkdir $HACK
-    cp -r ${xnu}/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/net $HACK
-
-
     substituteInPlace SystemConfiguration.fproj/SCNetworkReachabilityInternal.h \
       --replace '#include <xpc/xpc.h>' ""
 
@@ -177,9 +172,9 @@ appleDerivation {
     cc -I. -Ihelper -Iderived -F. -c DHCP.c -o DHCP.o
     cc -I. -Ihelper -Iderived -F. -c moh.c -o moh.o
     cc -I. -Ihelper -Iderived -F. -c DeviceOnHold.c -o DeviceOnHold.o
-    cc -I. -Ihelper -Iderived -I $HACK -F. -c LinkConfiguration.c -o LinkConfiguration.o
+    cc -I. -Ihelper -Iderived -I${xnu}/Library/Frameworks/System.framework/Versions/B/PrivateHeaders -F. -c LinkConfiguration.c -o LinkConfiguration.o
     cc -I. -Ihelper -Iderived -F. -c dy_framework.c -o dy_framework.o
-    cc -I. -Ihelper -Iderived -I $HACK -F. -c VLANConfiguration.c -o VLANConfiguration.o
+    cc -I. -Ihelper -Iderived -I${xnu}/Library/Frameworks/System.framework/Versions/B/PrivateHeaders -F. -c VLANConfiguration.c -o VLANConfiguration.o
     cc -I. -Ihelper -Iderived -F. -c derived/configUser.c -o configUser.o
     cc -I. -Ihelper -Iderived -F. -c SCPreferencesPathKey.c -o SCPreferencesPathKey.o
     cc -I. -Ihelper -Iderived -I../dnsinfo -F. -c derived/shared_dns_infoUser.c -o shared_dns_infoUser.o
@@ -188,8 +183,8 @@ appleDerivation {
     cc -I. -Ihelper -Iderived -F. -c SCNetworkProtocol.c -o SCNetworkProtocol.o
     cc -I. -Ihelper -Iderived -F. -c SCNetworkService.c -o SCNetworkService.o
     cc -I. -Ihelper -Iderived -F. -c SCNetworkSet.c -o SCNetworkSet.o
-    cc -I. -Ihelper -Iderived -I $HACK -F. -c BondConfiguration.c -o BondConfiguration.o
-    cc -I. -Ihelper -Iderived -I $HACK -F. -c BridgeConfiguration.c -o BridgeConfiguration.o
+    cc -I. -Ihelper -Iderived -I${xnu}/Library/Frameworks/System.framework/Versions/B/PrivateHeaders -F. -c BondConfiguration.c -o BondConfiguration.o
+    cc -I. -Ihelper -Iderived -I${xnu}/Library/Frameworks/System.framework/Versions/B/PrivateHeaders -F. -c BridgeConfiguration.c -o BridgeConfiguration.o
     cc -I. -Ihelper -Iderived -F. -c helper/SCHelper_client.c -o SCHelper_client.o
     cc -I. -Ihelper -Iderived -F. -c SCPreferencesKeychainPrivate.c -o SCPreferencesKeychainPrivate.o
     cc -I. -Ihelper -Iderived -F. -c SCNetworkSignature.c -o SCNetworkSignature.o
diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix
index d7710abf291b..ce128f14530b 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchzip, pkgs }:
+{ stdenv, fetchurl, pkgs }:
 
 let
   # This attrset can in theory be computed automatically, but for that to work nicely we need
@@ -6,13 +6,9 @@ let
   # a stdenv out of something like this. With some care we can probably get rid of this, but for
   # now it's staying here.
   versions = {
-    "osx-10.11.6" = {
-      dtrace        = "168";
-      xnu           = "3248.60.10";
-      libpthread    = "138.10.4";
-    };
-    "osx-10.11.5" = {
-      Libc          = "1082.50.1"; # 10.11.6 still unreleased :/
+    "osx-10.11.2" = {
+      dtrace = "168";
+      xnu    = "3248.20.55";
     };
     "osx-10.10.5" = {
       adv_cmds      = "158";
@@ -189,18 +185,13 @@ let
     CoreOSMakefiles = applePackage "CoreOSMakefiles"   "osx-10.5"        "0kxp53spbn7109l7cvhi88pmfsi81lwmbws819b6wr3hm16v84f4" {};
     Csu             = applePackage "Csu"               "osx-10.10.5"     "0yh5mslyx28xzpv8qww14infkylvc1ssi57imhi471fs91sisagj" {};
     dtrace          = applePackage "dtrace"            "osx-10.10.5"     "0pp5x8dgvzmg9vvg32hpy2brm17dpmbwrcr4prsmdmfvd4767wcf" {};
-    dtracen         = applePackage "dtrace"            "osx-10.11.6"     "04mi0jy8gy0w59rk9i9dqznysv6fzz1v5mq779s41cp308yi0h1c" {};
+    dtracen         = applePackage "dtrace"            "osx-10.11.2"     "04mi0jy8gy0w59rk9i9dqznysv6fzz1v5mq779s41cp308yi0h1c" {};
     dyld            = applePackage "dyld"              "osx-10.10.5"     "167f74ln8pmfimwn6kwh199ylvy3fw72fd15da94mf34ii0zar6k" {};
     eap8021x        = applePackage "eap8021x"          "osx-10.10.5"     "1f37dpbcgrd1b14nrv2lpqrkap74myjbparz9masx92df6kcn7l2" {};
     IOKit           = applePackage "IOKit"             "osx-10.10.5"     "0kcbrlyxcyirvg5p95hjd9k8a01k161zg0bsfgfhkb90kh2s8x0m" { inherit IOKitSrcs; };
     launchd         = applePackage "launchd"           "osx-10.9.5"      "0w30hvwqq8j5n90s3qyp0fccxflvrmmjnicjri4i1vd2g196jdgj" {};
     libauto         = applePackage "libauto"           "osx-10.9.5"      "17z27yq5d7zfkwr49r7f0vn9pxvj95884sd2k6lq6rfaz9gxqhy3" {};
-    Libc            = applePackage "Libc"              "osx-10.11.5"     "1qv7r0dgz06jy9i5agbqzxgdibb0m8ylki6g5n5pary88lzrawfd" {
-      Libc_10-9 = fetchzip {
-        url    = "http://www.opensource.apple.com/tarballs/Libc/Libc-997.90.3.tar.gz";
-        sha256 = "1xchgxkxg5288r2b9yfrqji2gsgdap92k4wx2dbjwslixws12pq7";
-      };
-    };
+    Libc            = applePackage "Libc"              "osx-10.9.5"      "1jz5bx9l4q484vn28c6n9b28psja3rpxiqbj6zwrwvlndzmq1yz5" {};
     Libc_old        = applePackage "Libc/825_40_1.nix" "osx-10.8.5"      "0xsx1im52gwlmcrv4lnhhhn9dyk5ci6g27k6yvibn9vj8fzjxwcf" {};
     libclosure      = applePackage "libclosure"        "osx-10.10.5"     "1zqy1zvra46cmqv6vsf1mcsz3a76r9bky145phfwh4ab6y15vjpq" {};
     libdispatch     = applePackage "libdispatch"       "osx-10.9.5"      "1lc5033cmkwxy3r26gh9plimxshxfcbgw6i0j7mgjlnpk86iy5bk" {};
@@ -208,7 +199,7 @@ let
     Libinfo         = applePackage "Libinfo"           "osx-10.10.5"     "19n72s652rrqnc9hzlh4xq3h7xsfyjyklmcgyzyj0v0z68ww3z6h" {};
     Libm            = applePackage "Libm"              "osx-10.7.4"      "02sd82ig2jvvyyfschmb4gpz6psnizri8sh6i982v341x6y4ysl7" {};
     Libnotify       = applePackage "Libnotify"         "osx-10.9.5"      "164rx4za5z74s0mk9x0m1815r1m9kfal8dz3bfaw7figyjd6nqad" {};
-    libpthread      = applePackage "libpthread"        "osx-10.11.6"     "1kbw738cmr9pa7pz1igmajs307clfq7gv2vm1sqdzhcnnjxbl28w" {};
+    libpthread      = applePackage "libpthread"        "osx-10.10.5"     "1p2y6xvsfqyakivr6d48fgrd163b5m9r045cxyfwrf8w0r33nfn3" {};
     libresolv       = applePackage "libresolv"         "osx-10.10.5"     "0nvssf4qaqgs1dxwayzdy66757k99969f6c7n68n58n2yh6f5f6a" {};
     Libsystem       = applePackage "Libsystem"         "osx-10.9.5"      "1yfj2qdrf9vrzs7p9m4wlb7zzxcrim1gw43x4lvz4qydpp5kg2rh" {};
     libutil         = applePackage "libutil"           "osx-10.10.5"     "12gsvmj342n5d81kqwba68bmz3zf2757442g1sz2y5xmcapa3g5f" {};
@@ -218,7 +209,7 @@ let
     ppp             = applePackage "ppp"               "osx-10.10.5"     "01v7i0xds185glv8psvlffylfcfhbx1wgsfg74kx5rh3lyrigwrb" {};
     removefile      = applePackage "removefile"        "osx-10.10.5"     "1f2jw5irq6fz2jv5pag1w2ivfp8659v74f0h8kh0yx0rqw4asm33" {};
     Security        = applePackage "Security"          "osx-10.9.5"      "1nv0dczf67dhk17hscx52izgdcyacgyy12ag0jh6nl5hmfzsn8yy" {};
-    xnu             = applePackage "xnu"               "osx-10.11.6"     "0yhziq4dqqcbjpf6vyqn8xhwva2zb525gndkx8cp8alzwp76jnr9" {};
+    xnu             = applePackage "xnu"               "osx-10.9.5"      "1ssw5fzvgix20bw6y13c39ib0zs7ykpig3irlwbaccpjpci5jl0s" {};
 
     # Pending work... we can't change the above packages in place because the bootstrap depends on them, so we detach the expressions
     # here so we can work on them.
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix
index c9d4b654a589..027784e2ea6d 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix
@@ -6,14 +6,8 @@ appleDerivation {
   propagatedBuildInputs = [ libdispatch xnu ];
 
   installPhase = ''
-    mkdir -p $out/include/pthread/
-    mkdir -p $out/include/sys/_types
+    mkdir -p $out/include/pthread
     cp pthread/*.h $out/include/pthread/
-
-    # This overwrites qos.h, and is probably not necessary, but I'll leave it here for now
-    # cp private/*.h $out/include/pthread/
-
-    cp -r sys $out/include
-    cp -r sys/_pthread/*.h $out/include/sys/_types/
+    cp private/*.h $out/include/pthread/
   '';
 }
diff --git a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
index 0ce9c54e48c4..4933f94d4a93 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
@@ -30,12 +30,11 @@ appleDerivation {
     substituteInPlace libsyscall/xcodescripts/mach_install_mig.sh \
       --replace "/usr/include" "/include" \
       --replace "/usr/local/include" "/include" \
-      --replace 'MIG=`' "# " \
-      --replace 'MIGCC=`' "# " \
+      --replace "MIG=" "# " \
+      --replace "MIGCC=" "# " \
       --replace " -o 0" "" \
       --replace '$SRC/$mig' '-I$DSTROOT/include $SRC/$mig' \
-      --replace '$SRC/servers/netname.defs' '-I$DSTROOT/include $SRC/servers/netname.defs' \
-      --replace '$BUILT_PRODUCTS_DIR/mig_hdr' '$BUILT_PRODUCTS_DIR'
+      --replace '$SRC/servers/netname.defs' '-I$DSTROOT/include $SRC/servers/netname.defs'
 
     patchShebangs .
   '';
@@ -47,9 +46,9 @@ appleDerivation {
     cat > sdk/usr/local/libexec/availability.pl <<EOF
       #!$SHELL
       if [ "\$1" == "--macosx" ]; then
-        echo 10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11
+        echo 10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9
       elif [ "\$1" == "--ios" ]; then
-        echo 2.0 2.1 2.2 3.0 3.1 3.2 4.0 4.1 4.2 4.3 5.0 5.1 6.0 6.1 7.0 8.0 9.0
+        echo 2.0 2.1 2.2 3.0 3.1 3.2 4.0 4.1 4.2 4.3 5.0 5.1 6.0 6.1 7.0
       fi
     EOF
     chmod +x sdk/usr/local/libexec/availability.pl
@@ -57,7 +56,7 @@ appleDerivation {
     export SDKROOT_RESOLVED=$PWD/sdk
     export HOST_SDKROOT_RESOLVED=$PWD/sdk
     export PLATFORM=MacOSX
-    export SDKVERSION=10.11
+    export SDKVERSION=10.7
 
     export CC=cc
     export CXX=c++
@@ -88,13 +87,13 @@ appleDerivation {
     make installhdrs
 
     mv $out/usr/include $out
+    rmdir $out/usr
 
     # TODO: figure out why I need to do this
     cp libsyscall/wrappers/*.h $out/include
     mkdir -p $out/include/os
     cp libsyscall/os/tsd.h $out/include/os/tsd.h
     cp EXTERNAL_HEADERS/AssertMacros.h $out/include
-    cp EXTERNAL_HEADERS/Availability*.h $out/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/
 
     # Build the mach headers we crave
     export MIGCC=cc
@@ -102,21 +101,11 @@ appleDerivation {
     export SRCROOT=$PWD/libsyscall
     export DERIVED_SOURCES_DIR=$out/include
     export SDKROOT=$out
-    export OBJROOT=$PWD
-    export BUILT_PRODUCTS_DIR=$out
     libsyscall/xcodescripts/mach_install_mig.sh
 
     # Get rid of the System prefix
     mv $out/System/* $out/
 
-    # TODO: do I need this?
-    mv $out/internal_hdr/include/mach/*.h $out/include/mach
-
-    # Get rid of some junk lying around
-    rm -rf $out/internal_hdr
-    rm -rf $out/usr
-    rm -rf $out/local
-
     # Add some symlinks
     ln -s $out/Library/Frameworks/System.framework/Versions/B \
           $out/Library/Frameworks/System.framework/Versions/Current