anchor.diff:      postFetch = "cd $out && git tag ${rev}";
     };
   
  -  nudb = fetchgit rec {
  -    url = "https://github.com/CPPAlliance/NuDB.git";
  -    rev = "2.0.1";
  -    sha256 = "0h7hmwavrxzj1v547h3z0031ckwphjayfpv1mgcr6q86wm9p5468";
  -    leaveDotGit = true;
  -    fetchSubmodules = true; # submodules are needed, rocksdb is dependency
  -    postFetch = "cd $out && git tag ${rev}";
  -  };
  -
  -  protobuf = fetchgit rec {
  -    url = "https://github.com/protocolbuffers/protobuf.git";
  -    rev = "v3.6.1";
  -    sha256 = "0zl09q25ggfw95lakcs3mkq5pvsj17mx29b4nqr09g0mnbw9709c";
  +  cares = fetchgit rec {
  +    url = "https://github.com/c-ares/c-ares.git";
  +    rev = "cares-1_15_0";
  +    sha256 = "1fkzsyhfk5p5hr4dx4r36pg9xzs0md6cyj1q2dni3cjgqj3s518v";
       leaveDotGit = true;
       fetchSubmodules = false;
       postFetch = "cd $out && git tag ${rev}";
  
positive.code: 
    google-test = fetchgit {
      url = "https://github.com/google/googletest.git";
      rev = "c3bb0ee2a63279a803aaad956b9b26d74bf9e6e2";
      sha256 = "0pj5b6jnrj5lrccz2disr8hklbnzd8hwmrwbfqmvhiwb9q9p0k2k";
      fetchSubmodules = false;
      leaveDotGit = true;
    };
  
    google-benchmark = fetchgit {
      url = "https://github.com/google/benchmark.git";
      rev = "5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8";
      sha256 = "0qg70j47zqnrbszlgrzmxpr4g88kq0gyq6v16bhaggfm83c6mg6i";
      fetchSubmodules = false;
      leaveDotGit = true;
    };
  
    # hack to merge rocksdb revisions from rocksdb and nudb, so build process
    # will find both
    rocksdb-merged = runCommand "rocksdb-merged" {
      buildInputs = [ git ];
    } ''
      commit=$(cd ${nudb} && git ls-tree HEAD extras/rocksdb | awk '{ print $3  }')
      git clone ${rocksdb} $out && cd $out
      git fetch ${nudb}/extras/rocksdb $commit
      git checkout $commit
    '';
  in stdenv.mkDerivation rec {
    pname = "rippled";
    version = "1.4.0";
  
    src = fetchFromGitHub {
      owner = "ripple";
      repo = "rippled";
      rev = version;
      sha256 = "1z04378bg8lcyrnn7sl3j2zfxbwwy2biasg1d4fbaq4snxg5d1pq";
    };
  
    hardeningDisable = ["format"];
    cmakeFlags = [
      "-Dstatic=OFF"
      "-DBOOST_LIBRARYDIR=${boost.out}/lib"
      "-DBOOST_INCLUDEDIR=${boost.dev}/include"
    ];
  
    nativeBuildInputs = [ pkgconfig cmake git ];
    buildInputs = [ openssl openssl.dev zlib ];
  
    preConfigure = ''
      export HOME=$PWD
  
      git config --global url."file://${docca}".insteadOf "${docca.url}"
      git config --global url."file://${rocksdb-merged}".insteadOf "${rocksdb.url}"
      git config --global url."file://${lz4}".insteadOf "${lz4.url}"
      git config --global url."file://${libarchive}".insteadOf "${libarchive.url}"
      git config --global url."file://${soci}".insteadOf "${soci.url}"
      git config --global url."file://${snappy}".insteadOf "${snappy.url}"
      git config --global url."file://${nudb}".insteadOf "${nudb.url}"
      git config --global url."file://${protobuf}".insteadOf "${protobuf.url}"
      git config --global url."file://${google-benchmark}".insteadOf "${google-benchmark.url}"
      git config --global url."file://${google-test}".insteadOf "${google-test.url}"
  
      substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "URL ${sqlite3.url}" "URL ${sqlite3}"
    '';
  
negative.code: { stdenv, fetchFromGitHub, fetchgit, fetchurl, runCommand, git, cmake, pkgconfig
  , openssl,  zlib, boost, grpc, c-ares, abseil-cpp, protobuf3_8 }:
  
  let
    sqlite3 = fetchurl rec {
  