From a67172ebf667d248c85397835e1e5f9b47d6c4c1 Mon Sep 17 00:00:00 2001 From: Matthew Leach Date: Tue, 15 Feb 2022 12:12:38 +0000 Subject: [PATCH] volk: fix build for apple silicon --- pkgs/development/libraries/volk/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/libraries/volk/default.nix b/pkgs/development/libraries/volk/default.nix index 40ae88bf71bb..bbc4189fff84 100644 --- a/pkgs/development/libraries/volk/default.nix +++ b/pkgs/development/libraries/volk/default.nix @@ -5,6 +5,7 @@ , python3 , enableModTool ? true , removeReferencesTo +, fetchpatch }: stdenv.mkDerivation rec { @@ -19,6 +20,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)