2021-02-15 21:09:25 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, python3
|
|
|
|
, enableModTool ? true
|
|
|
|
, removeReferencesTo
|
2022-02-15 13:12:38 +01:00
|
|
|
, fetchpatch
|
2021-02-15 21:09:25 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "volk";
|
2022-02-18 09:27:47 +01:00
|
|
|
# Version 2.5.1 seems to cause a build issue for aarch64-darwin, see:
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/160152#issuecomment-1043380478A
|
2021-06-28 12:58:44 +02:00
|
|
|
version = "2.5.0";
|
2021-02-15 21:09:25 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gnuradio";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-06-28 12:58:44 +02:00
|
|
|
sha256 = "XvX6emv30bSB29EFm6aC+j8NGOxWqHCNv0Hxtdrq/jc=";
|
2021-02-15 21:09:25 +01:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2022-02-15 13:12:38 +01:00
|
|
|
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 = "";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-15 21:09:25 +01:00
|
|
|
cmakeFlags = lib.optionals (!enableModTool) [ "-DENABLE_MODTOOL=OFF" ];
|
2021-06-28 20:47:28 +02:00
|
|
|
postInstall = lib.optionalString (!stdenv.isDarwin) ''
|
2021-02-15 21:09:25 +01:00
|
|
|
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libvolk.so)
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
python3
|
|
|
|
python3.pkgs.Mako
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "http://libvolk.org/";
|
|
|
|
description = "The Vector Optimized Library of Kernels";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ doronbehar ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|