2021-02-15 21:09:25 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2023-03-02 14:13:05 +01:00
|
|
|
, fetchpatch
|
2021-02-15 21:09:25 +01:00
|
|
|
, cmake
|
|
|
|
, python3
|
|
|
|
, enableModTool ? true
|
|
|
|
, removeReferencesTo
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "volk";
|
2023-03-02 14:13:05 +01:00
|
|
|
version = "3.0.0";
|
2021-02-15 21:09:25 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gnuradio";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-03-02 14:13:05 +01:00
|
|
|
hash = "sha256-kI4IuO6TLplo5lLAGIPWQWtePcjIEWB9XaJDA6WlqSg=";
|
2021-02-15 21:09:25 +01:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2022-02-15 13:12:38 +01:00
|
|
|
patches = [
|
2023-03-02 14:13:05 +01:00
|
|
|
# Remove a failing test
|
2022-02-15 13:12:38 +01:00
|
|
|
(fetchpatch {
|
2023-03-02 14:13:05 +01:00
|
|
|
url = "https://github.com/gnuradio/volk/commit/fe2e4a73480bf2ac2e566052ea682817dddaf61f.patch";
|
|
|
|
hash = "sha256-Vko/Plk7u6UAr32lieU+T9G34Dkg9EW3Noi/NArpRL4=";
|
2022-02-15 13:12:38 +01:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-11-04 04:18:18 +01:00
|
|
|
cmakeFlags = lib.optionals (!enableModTool) [
|
|
|
|
"-DENABLE_MODTOOL=OFF"
|
2023-03-16 21:57:13 +01:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
|
|
|
"-DVOLK_CPU_FEATURES=OFF"
|
|
|
|
# offset 17912 in1: -0.0366274 in2: -0.0366173 tolerance was: 1e-05
|
|
|
|
# volk_32f_log2_32f: fail on arch neon
|
|
|
|
"-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;qa_volk_32f_log2_32f"
|
2022-11-04 04:18:18 +01:00
|
|
|
];
|
|
|
|
|
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
|
2023-02-19 18:28:43 +01:00
|
|
|
python3.pkgs.mako
|
2021-02-15 21:09:25 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|