anchor.diff:        substituteInPlace tools/objc/j2objc_dead_code_pruner.py --replace "$!/usr/bin/python2.7" "#!${python27}/bin/python"
   
         # md5sum is part of coreutils
  -      sed -i 's|/sbin/md5|md5sum|' \
  +      sed -i 's|/sbin/md5|md5sum|g' \
           src/BUILD
   
         # substituteInPlace is rather slow, so prefilter the files with grep
  
positive.code:     '';
    };
  
  in
  stdenv.mkDerivation rec {
    pname = "bazel";
    inherit version;
  
  
negative.code: 
        # libcxx includes aren't added by libcxx hook
        # https://github.com/NixOS/nixpkgs/pull/41589
        export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${llvmPackages_8.libcxx}/include/c++/v1"
  
        # don't use system installed Xcode to run clang, use Nix clang instead
        sed -i -E "s;/usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.9;${stdenv'.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \
          scripts/bootstrap/compile.sh \
          src/tools/xcode/realpath/BUILD \
          src/tools/xcode/stdredirect/BUILD \
  