anchor.diff:      homepage    = "https://github.com/microsoft/mimalloc";
       license     = licenses.bsd2;
       platforms   = platforms.unix;
  -    maintainers = with maintainers; [ thoughtpolice ];
  +    maintainers = with maintainers; [ kamadorueda thoughtpolice ];
     };
   }
  
positive.code: { lib, stdenv, fetchFromGitHub, cmake, ninja
  , secureBuild ? false
  }:
  
  
negative.code: in
  stdenv.mkDerivation rec {
    pname   = "mimalloc";
    version = "2.0.5";
  
    src = fetchFromGitHub {
      owner  = "microsoft";
      repo   = pname;
      rev    = "v${version}";
      sha256 = "sha256-q3W/w1Ofqt6EbKF/Jf9wcC+7jAxh59B3cOGxudWQXlA=";
    };
    patches = [
      (fetchpatch {
        name = "older-macos-fixes.patch";
        url = "https://github.com/microsoft/mimalloc/commit/40e0507a5959ee218f308d33aec212c3ebeef3bb.patch";
        sha256 = "15qx2a3axhhwbfzxdis98b8j14y9cfgca0i484aj2pjpqnm0pb8c";
      })
    ];
  
    doCheck = true;
    preCheck = let
      ldLibraryPathEnv = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
    in ''
      export ${ldLibraryPathEnv}="$(pwd)/build:''${${ldLibraryPathEnv}}"
    '';
  
    nativeBuildInputs = [ cmake ninja ];
    cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ] ++ lib.optional secureBuild [ "-DMI_SECURE=ON" ];
  