2021-04-25 03:57:28 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
2024-02-29 20:09:43 +00:00
|
|
|
, fetchpatch
|
2021-04-25 03:57:28 +00:00
|
|
|
, cmake
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "eigen";
|
2021-10-06 13:57:05 +00:00
|
|
|
version = "3.4.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "libeigen";
|
2021-04-25 03:57:28 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
2021-10-06 13:57:05 +00:00
|
|
|
sha256 = "sha256-1/4xMetKMDOgZgzz3WMxfHUEpmdAm52RqZvz6i0mLEw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./include-dir.patch
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
# Fixes e.g. onnxruntime on aarch64-darwin:
|
|
|
|
# https://hydra.nixos.org/build/248915128/nixlog/1,
|
|
|
|
# originally suggested in https://github.com/NixOS/nixpkgs/pull/258392.
|
|
|
|
#
|
|
|
|
# The patch is from
|
|
|
|
# ["Fix vectorized reductions for Eigen::half"](https://gitlab.com/libeigen/eigen/-/merge_requests/699)
|
|
|
|
# which is two years old,
|
|
|
|
# but Eigen hasn't had a release in two years either:
|
|
|
|
# https://gitlab.com/libeigen/eigen/-/issues/2699.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://gitlab.com/libeigen/eigen/-/commit/d0e3791b1a0e2db9edd5f1d1befdb2ac5a40efe0.patch";
|
|
|
|
hash = "sha256-8qiNpuYehnoiGiqy0c3Mcb45pwrmc6W4rzCxoLDSvj0=";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-04-25 03:57:28 +00:00
|
|
|
homepage = "https://eigen.tuxfamily.org";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
|
|
|
|
license = licenses.lgpl3Plus;
|
2021-04-25 03:57:28 +00:00
|
|
|
maintainers = with maintainers; [ sander raskin ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|