anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / libraries / eigen / default.nix
blob65493e661beb6ca92afd3d5d556ec5120455779f
1 { lib
2 , stdenv
3 , fetchFromGitLab
4 , fetchpatch
5 , cmake
6 }:
8 stdenv.mkDerivation rec {
9   pname = "eigen";
10   version = "3.4.0";
12   src = fetchFromGitLab {
13     owner = "libeigen";
14     repo = pname;
15     rev = version;
16     hash = "sha256-1/4xMetKMDOgZgzz3WMxfHUEpmdAm52RqZvz6i0mLEw=";
17   };
19   patches = [
20     ./include-dir.patch
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   ];
37   nativeBuildInputs = [ cmake ];
39   meta = with lib; {
40     homepage = "https://eigen.tuxfamily.org";
41     description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
42     license = licenses.lgpl3Plus;
43     maintainers = with maintainers; [ sander raskin ];
44     platforms = platforms.unix;
45   };