anchor.diff:      })
     ];
   
  -  # TODO: build server, and move .so's to lib output
  -  outputs = [ "out" "dev" ];
  -
     nativeBuildInputs = [
       cmake
       pkg-config
       python3
  +    gtest
     ];
   
     buildInputs = [
       libpng
       zlib
       protobuf
  -    nsync
  -    flatbuffers
       howard-hinnant-date
  -    re2
       nlohmann_json
       boost
       oneDNN
     ];
  +
  +  # TODO: build server, and move .so's to lib output
  +  outputs = [ "out" "dev" ];
  +
  +  enableParallelBuilding = true;
   
     cmakeDir = "../cmake";
   
  
positive.code:       compatibility.
      '';
      homepage = "https://github.com/microsoft/onnxruntime";
      changelog = "https://github.com/microsoft/onnxruntime/releases";
      # https://github.com/microsoft/onnxruntime/blob/master/BUILD.md#architectures
      platforms = lib.platforms.unix;
      license = lib.licenses.mit;
      maintainers = with lib.maintainers; [ jonringer puffnfresh ];
    };
  }
  
negative.code: , lib
  , fetchFromGitHub
  , fetchpatch
  , fetchurl
  , pkg-config
  , cmake
  , python3
  , libpng
  , zlib
  , eigen
  , protobuf
  , howard-hinnant-date
  , nlohmann_json
  , boost
  , oneDNN
  , gtest
  }:
  
  let
    # prefetch abseil
    # Note: keep URL in sync with `cmake/external/abseil-cpp.cmake`
    abseil = fetchurl {
      url = "https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.zip";
      sha256 = "sha256-pFZ/8C+spnG5XjHTFbqxi0K2xvGmDpHG6oTlohQhEsI=";
    };
  in
  stdenv.mkDerivation rec {
    pname = "onnxruntime";
    version = "1.12.1";
  
    src = fetchFromGitHub {
      owner = "microsoft";
      repo = "onnxruntime";
      rev = "v${version}";
      sha256 = "sha256-wwllEemiHTp9aJcCd1gsTS4WUVMp5wW+4i/+6DzmAeM=";
      fetchSubmodules = true;
    };
  
    patches = [
      # Use dnnl from nixpkgs instead of submodules
      (fetchpatch {
        name = "system-dnnl.patch";
        url = "https://aur.archlinux.org/cgit/aur.git/plain/system-dnnl.diff?h=python-onnxruntime&id=0185531906bda3a9aba93bbb0f3dcfeb0ae671ad";
  