anchor.diff:  }:
   
   let
  -  version = "3.45";
  +  version = "3.47.1";
   
     baseUrl = "https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases"
       + "/NSS_${stdenv.lib.replaceStrings ["."] ["_"] version}_RTM/src";
  
positive.code:   src = fetchurl {
      url = "${baseUrl}/${name}.tar.gz";
      hashOutput = false;
      sha256 = "112f05223d1fde902c170966bfc6f011b24a838be16969b110ecf2bb7bc24e8b";
    };
  
    buildInputs = [
  
negative.code:   '';
  
    patches = [
      ../../../../../nss/0001-Add-pem-support.patch
      ../../../../../nss/0002-Fix-sharedlib-loading.patch
      ../../../../../nss/0003-Add-pkgconfig-files.patch
  	];
  
    makeFlags = [
      "SOURCE_PREFIX=${placeholder "dev"}"
      "NSPR_INCLUDE_DIR=${nspr}/include/nspr"
      "NSPR_LIB_DIR=${nspr}/lib"
      "NSDISTMODE=copy"
      "BUILD_OPT=1"
      "NSS_ENABLE_WERROR=0"
      "NSS_USE_SYSTEM_SQLITE=1"
      "NSS_USE_SYSTEM_ZLIB=1"
      "NSS_DISABLE_GTESTS=1"
    ] ++ stdenv.lib.optionals (stdenv.lib.elem stdenv.targetSystem stdenv.lib.platforms.bit64) [
      "USE_64=1"
    ];
  
    # Throws lots of errors as of 3.23 (checked 3.47.1)
    buildParallel = false;
  
    postInstall = ''
      rm -rv "$dev"/private
      rm -rv "$dev"/public/dbm
      mv -v "$dev"/public "$dev"/include
      mkdir -p "$dev"/lib
      mv -v "$dev"/*.OBJ/lib/* "$dev"/lib
  
      mkdir -p "$bin"/bin
      mv -v "$dev"/*.OBJ/bin/* "$bin"/bin
  
      mkdir -p "$lib"/lib
      mv -v "$dev"/lib*/*.so* "$lib"/lib
      ln -sv "$lib"/lib/* "$dev"/lib
  
      rm -rv "$dev"/*.OBJ
    '';
  
    outputs = [
      "dev"
      "bin"
      "lib"
    ];
  
    passthru = {
      inherit version;
  