anchor.diff:  { stdenv, appleDerivation, cpio, xnu, Libc, Libm, libdispatch, cctools, Libinfo
   , dyld, Csu, architecture, libclosure, CarbonHeaders, ncurses, CommonCrypto
   , copyfile, removefile, libresolv, Libnotify, libplatform, libpthread
  -, mDNSResponder, launchd, libutil, hfs, darling }:
  +, mDNSResponder, launchd, libutil, hfs, darling, darwin-stubs }:
   
   appleDerivation {
     dontBuild = true;
  
positive.code:     chmod +w $out/lib/libresolv.9.dylib
      install_name_tool \
        -id $out/lib/libresolv.9.dylib \
        -change "$resolv_libSystem" $out/lib/libSystem.dylib \
        $out/lib/libresolv.9.dylib
      ln -s libresolv.9.dylib $out/lib/libresolv.dylib
    '';
  
    meta = with stdenv.lib; {
      description = "The Mac OS libc/libSystem (impure symlinks to binaries with pure headers)";
      maintainers = with maintainers; [ copumpkin gridaphobe ];
      platforms   = platforms.darwin;
      license     = licenses.apsl20;
  
negative.code:     # The startup object files
      cp ${Csu}/lib/* $out/lib
  
      cp -vr \
        ${darwin-stubs}/usr/lib/libSystem.B.tbd \
        ${darwin-stubs}/usr/lib/system \
        $out/lib
  
      substituteInPlace $out/lib/libSystem.B.tbd \
        --replace "/usr/lib/system/" "$out/lib/system/"
      ln -s libSystem.B.tbd $out/lib/libSystem.tbd
  
      # 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
        ln -s libSystem.tbd $out/lib/lib$name.tbd
      done
  
      # This probably doesn't belong here, but we want to stay similar to glibc, which includes resolv internally...
  