···1{ lib
2, stdenv
3, fetchFromGitLab
4+, fetchpatch
5, cmake
6}:
7···1819 patches = [
20 ./include-dir.patch
21+22+ # Fixes e.g. onnxruntime on aarch64-darwin:
23+ # https://hydra.nixos.org/build/248915128/nixlog/1,
24+ # originally suggested in https://github.com/NixOS/nixpkgs/pull/258392.
25+ #
26+ # The patch is from
27+ # ["Fix vectorized reductions for Eigen::half"](https://gitlab.com/libeigen/eigen/-/merge_requests/699)
28+ # which is two years old,
29+ # but Eigen hasn't had a release in two years either:
30+ # https://gitlab.com/libeigen/eigen/-/issues/2699.
31+ (fetchpatch {
32+ url = "https://gitlab.com/libeigen/eigen/-/commit/d0e3791b1a0e2db9edd5f1d1befdb2ac5a40efe0.patch";
33+ hash = "sha256-8qiNpuYehnoiGiqy0c3Mcb45pwrmc6W4rzCxoLDSvj0=";
34+ })
35 ];
3637 nativeBuildInputs = [ cmake ];