anchor.diff:  { stdenv, fetchFromGitHub, fetchgit, fetchurl, runCommand, git, cmake, pkgconfig
  -, openssl, boost, zlib }:
  +, openssl,  zlib, boost, grpc, c-ares, abseil-cpp, protobuf3_8 }:
   
   let
     sqlite3 = fetchurl rec {
  
positive.code:     passthru.url = url;
    };
  
    docca = fetchgit {
      url = "https://github.com/vinniefalco/docca.git";
      rev = "335dbf9c3613e997ed56d540cc8c5ff2e28cab2d";
      sha256 = "1yisdg7q2p9q9gz0c446796p3ggx9s4d6g8w4j1pjff55655805h";
      leaveDotGit = true;
      fetchSubmodules = false;
    };
  
    rocksdb = fetchgit rec {
      url = "https://github.com/facebook/rocksdb.git";
      rev = "v5.17.2";
      sha256 = "0d9ssggjls1hc4zhng65yg8slqlcw0lr23qr6f39shg42lzr227p";
      leaveDotGit = true;
      fetchSubmodules = false;
      postFetch = "cd $out && git tag ${rev}";
    };
  
    lz4 = fetchgit rec {
  
negative.code: 
    google-test = fetchgit {
      url = "https://github.com/google/googletest.git";
      rev = "5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081";
      sha256 = "1ch7hq16z20ddhpc08slp9bny29j88x9vr6bi9r4yf5m77xbplja";
      leaveDotGit = true;
      fetchSubmodules = false;
    };
  
    google-benchmark = fetchgit {
      url = "https://github.com/google/benchmark.git";
      rev = "5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8";
      sha256 = "0kcmb83framkncc50h0lyyz7v8nys6g19ja0h2p8x4sfafnnm6ig";
      leaveDotGit = true;
      fetchSubmodules = false;
    };
  
    date = fetchgit {
      url = "https://github.com/HowardHinnant/date.git";
      rev = "fc4cf092f9674f2670fb9177edcdee870399b829";
      sha256 = "0w618p64mx2l074b6wd0xfc4h6312mabhvzabxxwsnzj4afpajcm";
      leaveDotGit = true;
      fetchSubmodules = false;
    };
  in stdenv.mkDerivation rec {
    pname = "rippled";
    version = "1.5.0";
  
    src = fetchgit {
      url = "https://github.com/ripple/rippled.git";
      rev = version;
      sha256 = "0nh0x1ygrj3fw558vxbcp0md80qh27yrp3xhdlasrir7h1l2nplv";
      leaveDotGit = true;
      fetchSubmodules = true;
    };
  
    hardeningDisable = ["format"];
    cmakeFlags = ["-Dstatic=OFF" "-DBoost_NO_BOOST_CMAKE=ON"];
  
    nativeBuildInputs = [ pkgconfig cmake git ];
    buildInputs = [ openssl openssl.dev boostSharedStatic zlib grpc c-ares c-ares.cmake-config abseil-cpp protobuf3_8 ];
  
    preConfigure = ''
      export HOME=$PWD
  
      git config --global url."file://${rocksdb}".insteadOf "${rocksdb.url}"
      git config --global url."file://${docca}".insteadOf "${docca.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://${google-benchmark}".insteadOf "${google-benchmark.url}"
      git config --global url."file://${google-test}".insteadOf "${google-test.url}"
      git config --global url."file://${date}".insteadOf "${date.url}"
  
      substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "URL ${sqlite3.url}" "URL ${sqlite3}"
    '';
  