summary refs log tree commit diff
path: root/pkgs/development/libraries/volk/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/volk/default.nix')
-rw-r--r--pkgs/development/libraries/volk/default.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/development/libraries/volk/default.nix b/pkgs/development/libraries/volk/default.nix
index 40ae88bf71b..c795d783894 100644
--- a/pkgs/development/libraries/volk/default.nix
+++ b/pkgs/development/libraries/volk/default.nix
@@ -5,10 +5,13 @@
 , python3
 , enableModTool ? true
 , removeReferencesTo
+, fetchpatch
 }:
 
 stdenv.mkDerivation rec {
   pname = "volk";
+  # Version 2.5.1 seems to cause a build issue for aarch64-darwin, see:
+  # https://github.com/NixOS/nixpkgs/pull/160152#issuecomment-1043380478A
   version = "2.5.0";
 
   src = fetchFromGitHub {
@@ -19,6 +22,14 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
+  patches = [
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/macports/macports-ports/e83a55ef196d4283be438c052295b2fc44f3df5b/science/volk/files/patch-cpu_features-add-support-for-ARM64.diff";
+      sha256 = "sha256-MNUntVvKZC4zuQsxGQCItaUaaQ1d31re2qjyPFbySmI=";
+      extraPrefix = "";
+    })
+  ];
+
   cmakeFlags = lib.optionals (!enableModTool) [ "-DENABLE_MODTOOL=OFF" ];
   postInstall = lib.optionalString (!stdenv.isDarwin) ''
     ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libvolk.so)