anchor.diff:  , autoPatchelfHook
   , file
   , substituteAll
  +, writeTextFile
   }:
   
   let
  
positive.code:     mv ./bazel_src/output/bazel $out/bin/bazel-real
  
      wrapProgram "$out/bin/bazel" --add-flags --server_javabase="${runJdk}"
  
      # generates the system bazelrc
      # warning: the name of the repository depends on the system, hence
      # the reference to .name
      mkdir $out/etc
      echo "build --override_repository=${remote_java_tools.name}=${remote_java_tools}" > $out/etc/bazelrc
      echo "build --distdir=${distDir}" >> $out/etc/bazelrc
  
      # shell completion files
      mkdir -p $out/share/bash-completion/completions $out/share/zsh/site-functions
  
negative.code:     '';
    };
  
    bazelRC = writeTextFile {
      name = "bazel-rc";
      text = ''
        build --override_repository=${remote_java_tools.name}=${remote_java_tools}
        build --distdir=${distDir}
      '';
    };
  
  in
  stdenv.mkDerivation rec {
    pname = "bazel";
  