anchor.diff:        source $stdenv/setup
         tar xf $src
         cd rethinkdb-*
  -      patchShebangs external/v8_*/build/gyp/gyp
  -      patchShebangs test/run
         ./configure
  -      make -j $NIX_BUILD_CORES DEBUG=1
  -      test/run -j $NIX_BUILD_CORES unit
  -      cp test/results/*/test_results.html $out
  +      ${make} DEBUG=1
  +      test/run -j $NIX_BUILD_CORES '!long' ${skip_test_filter} || :
  +      test -e test/results/*/test_results.html
  +      cp test/results/* $out
  +      echo report test_results $out/*/test_results.html > $out/nix-support/hydra-build-products
       '';
     };
   }
  -
  -# # pkgs.stdenv.mkDerivation {
  -#   name = "rethinkdb-dev";
  -#   buildInputs = with pkgs; [
  -#    gcc6
  -#    protobuf
  -#    python
  -#    nodejs
  -#    nodePackages.coffee-script
  -#    nodePackages.browserify
  -#    zlib
  -#    openssl
  -#    curl
  -#    jemalloc
  -#    boost
  -#    git
  -#   ];
  -#   shellHook = ''
  -#     export LIBRARY_PATH=${pkgs.jemalloc}/lib
  -#   '';
  -# }
  
positive.code:   };
  
    sourceTarball = pkgs.stdenv.mkDerivation rec {
      # TODO: Hydra complains that the string is not allowed to refer to a store path
      # possible workaround: builtins.unsafeDiscardStringContext
      name = builtins.unsafeDiscardStringContext "rethinkdb-${version}.tgz";
      version = builtins.readFile versionFile;
      # name = "rethinkdb-nix.tgz";
      builder = builtins.toFile "builder.sh" ''
        source $stdenv/setup
        # TODO: https://github.com/NixOS/nixpkgs/issues/13744
  
negative.code:       cp -r $src rethinkdb
        chmod -R u+w rethinkdb
        cd rethinkdb
        ${patchScripts}
        ./configure --fetch jemalloc
        ${make} dist-dir
        ${unpatchScripts "build/packages/rethinkdb-${version}"}
        cd build/packages
        tar zcf $out rethinkdb-${version}
      '';
      __noChroot = true;
      src = <rethinkdb>;
  