anchor.diff:      for script in ${scripts}; do
         test ! -e $script.orig || cp $script.orig ${dest}/$script
       done
  -  '';
  +    '';
  +
     make = "make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES";
   
     skip_tests = [
  
positive.code:     name = "rethinkdb-dependencies-src";
      builder = mkBuilder ("mkdir $out\n" +
        concatStringsSep "\n"
          (map (dep: "cp -rv --no-preserve=all ${"$"}${dep}/* $out/") fetch_list));
      buildInputs = [ <rethinkdb> ];
    } // listToAttrs (map (dep: let info = depInfo dep; in {
      name = dep;
  
negative.code:       echo report test_results $out/*/test_results.html > $out/nix-support/hydra-build-products
      '';
    };
  
    vmBuild = { diskImage, name, builder, attrs ? {}, ncpu ? 6, memSize ? 4096 }:
      pkgs.vmTools.runInLinuxImage ((derivation (rec {
        inherit name;
        builder = "${pkgs.bash}/bin/bash";
        system = builtins.currentSystem;
        args = [ (toFile "builder.sh" ''
          set -ex
          PATH=/usr/bin:/bin:/usr/sbin:/sbin
        '' + builder) ];
        QEMU_OPTS = "-smp ${toString ncpu}";
      } // attrs)) // {
        inherit diskImage;
      });
  
    debs = with pkgs.vmTools.diskImageFuns;
      listToAttrs (concatLists (for [
        { name = "xenial";
          b64 = ubuntu1604x86_64;
  	b32 = ubuntu1604i386; }
        { name = "wily";
  	b64 = ubuntu1510x86_64;
  	b32 = ubuntu1510i386; }
      ] ({ name, b64, b32, extra ? [] }: let
        dsc = vmBuild {
          name = "rethinkdb-${sourcePrep.version}-${name}-src";
          attrs = { src = sourcePrep; };
          builder = ''
            cp -r $src rethinkdb
            cd rethinkdb
            ./configure
            make build-deb-src UBUNTU_RELEASE=${name} SIGN_PACKAGE=0
            cp build/packages/*.{dsc,build,changes,tar.?z} $out
          '';
          memSize = 4096;
          diskImage = b64 { extraPackages = debBuildDeps ++ extra; };
        };
        deb = arch: diskImage: vmBuild {
          name = replace "-src$" "-${arch}" dsc.name;
          attrs = { src = dsc; };
  	builder = ''
            PATH=/usr/bin:/bin:/usr/sbin:/sbin
            mkdir /build
            dpkg-source -x $src/*.dsc /build/source
            cd /build/source
            debuild -b -us -uc -j6
            cp ../*.deb $out
          '';
          memSize = 8192;
          diskImage = diskImage {extraPackages = debBuildDeps ++ extra; };
        };
      in [
        { name = "${name}-src"; value = dsc; }
        { name = "${name}-i386"; value = deb "i386" b32; }
        { name = "${name}-amd64"; value = deb "amd64" b64; }
      ])));
  
  in {
    inherit sourcePrep fetchDependencies fastTests;
  } // debs # // rpms
  