anchor.diff:      name = "rethinkdb-${version}";
       version = unsafeDiscardStringContext (readFile versionFile);
       builder = mkBuilder ''
  +
         # TODO: https://github.com/NixOS/nixpkgs/issues/13744
         export SSL_CERT_FILE=$cacert/etc/ssl/certs/ca-bundle.crt
  -      cp -r $src rethinkdb
  +
  +      mkdir rethinkdb
  +      cp -r $src/* rethinkdb/
         chmod -R u+w rethinkdb
         cd rethinkdb
  +
  +      # TODO: move upstream
  +      sed -i 's/reset-dist-dir: FORCE | web-assets/reset-dist-dir: FORCE/' mk/packaging.mk
  +      sed -i 's/install: build/install:/' packaging/debian/rules
  +
         echo "${version}" > VERSION.OVERRIDE
         cp -r --no-preserve=all $fetchDependencies/* .
         ${patchScripts}
  
positive.code:     '';
    };
  
    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;
  
negative.code:       dsc = vmBuild {
          name = "rethinkdb-${sourcePrep.version}-${name}-src";
          attrs = { src = sourcePrep; };
          build = ''
            cp -r $src rethinkdb
            cd rethinkdb
            ./configure
  