anchor.diff:    # see issue facebook/xcbuild#188
     # buildInputs = [ xcbuild ];
   
  -  buildInputs = [ Librpcsvc apple_sdk.frameworks.OpenDirectory pam CF
  +  buildInputs = [ libutil Librpcsvc apple_sdk.frameworks.OpenDirectory pam CF
                     apple_sdk.frameworks.IOKit openbsm ];
     # NIX_CFLAGS_COMPILE = lib.optionalString hostPlatform.isi686 "-D__i386__"
     #                    + lib.optionalString hostPlatform.isx86_64 "-D__x86_64__"
  
positive.code: { stdenv, appleDerivation, lib
  , Librpcsvc, apple_sdk, pam, CF, openbsm }:
  
  appleDerivation {
    # xcbuild fails with:
  
negative.code:       --replace bsm/audit_session.h bsm/audit.h
      substituteInPlace login.tproj/login_audit.c \
        --replace bsm/audit_session.h bsm/audit.h
    '' + lib.optionalString stdenv.isAarch64 ''
      substituteInPlace sysctl.tproj/sysctl.c \
        --replace "GPROF_STATE" "0"
      substituteInPlace login.tproj/login.c \
        --replace "defined(__arm__)" "defined(__arm__) || defined(__arm64__)"
    '';
  
    buildPhase = ''
  