anchor.diff:      zlib
     ];
   
  -  patches = [
  -    # Hopefully remove this in 3.4.7+
  -    (fetchTritonPatch {
  -      rev = "2e0d2f49a92924986bacbcf32c1594d834336095";
  -      file = "m/mongodb/0001-boost-1.60.patch";
  -      sha256 = "0e9da35f4303e53daf51e78961c517895f2d12f4fa49298f01e1665e15246d73";
  -    })
  -    (fetchTritonPatch {
  -      rev = "2e0d2f49a92924986bacbcf32c1594d834336095";
  -      file = "m/mongodb/0002-boost-1.62.patch";
  -      sha256 = "8ad9640407be6f945b38275ff75014c8ba2c6118a25fba63a490c640267b4b66";
  -    })
  -    (fetchTritonPatch {
  -      rev = "2e0d2f49a92924986bacbcf32c1594d834336095";
  -      file = "m/mongodb/0003-fix-scons-boost.patch";
  -      sha256 = "200abbd070d5fad9f894375fcd2810008b33985112392f2e00929933347eea0d";
  -    })
  -  ];
  -
     # Fix environment variable reading and reduces file size generation by removing debugging symbols
     postPatch = ''
  +    grep -q '\-ggdb' SConstruct
  +    grep -q 'env = Environment(' SConstruct
       sed \
         -e '/-ggdb/d' \
         -e 's#env = Environment(#env = Environment(ENV = os.environ,#' \
         -i SConstruct
  +  '';
  +
  +  NIX_LDFLAGS = flip concatMap buildInputs (n: [
  +    "-rpath" "${n.lib or n}/lib"
  +  ]);
  +
  +  preConfigure = ''
  +    export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $(cat $NIX_CC/nix-support/orig-cc)/lib"
     '';
   
     makeFlags = [
  
positive.code: }:
  
  let
    version = "3.4.9";
  
    inherit (stdenv.lib)
      concatStringsSep;
  in
  stdenv.mkDerivation rec {
    name = "mongodb-${version}";
  
    src = fetchurl {
      url = "https://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
      sha256 = "2fd0f47a5f9175e71d3d381e81a1b6a2500c9c414dd6ae0940ad6194a0e85549";
    };
  
    nativeBuildInputs = [
      scons
    ];
  
    buildInputs = [
      boost
      cyrus-sasl
      gperftools
      libpcap
      openssl_1-0-2
      pcre
      snappy
      wiredtiger
  
negative.code: { stdenv
  , fetchTritonPatch
  , fetchurl
  , pythonPackages
  
  , boost
  , cyrus-sasl
  , gperftools
  , icu
  , libbson
  , libpcap
  , mongo-c-driver
  , openssl
  , pcre
  , snappy
  , wiredtiger
  