2021-03-15 08:37:03 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2023-03-08 16:32:21 +00:00
|
|
|
, fetchpatch
|
2021-03-15 08:37:03 +00:00
|
|
|
, cmake
|
|
|
|
, python3
|
|
|
|
, enableModTool ? true
|
|
|
|
, removeReferencesTo
|
|
|
|
}:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-03-15 08:37:03 +00:00
|
|
|
pname = "volk";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "3.0.0";
|
2021-03-15 08:37:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gnuradio";
|
2023-10-09 19:29:22 +00:00
|
|
|
repo = "volk";
|
|
|
|
rev = "v${finalAttrs.version}";
|
2023-03-08 16:32:21 +00:00
|
|
|
hash = "sha256-kI4IuO6TLplo5lLAGIPWQWtePcjIEWB9XaJDA6WlqSg=";
|
2021-03-15 08:37:03 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2022-02-20 05:27:41 +00:00
|
|
|
patches = [
|
2023-03-08 16:32:21 +00:00
|
|
|
# Remove a failing test
|
2022-02-20 05:27:41 +00:00
|
|
|
(fetchpatch {
|
2023-03-08 16:32:21 +00:00
|
|
|
url = "https://github.com/gnuradio/volk/commit/fe2e4a73480bf2ac2e566052ea682817dddaf61f.patch";
|
|
|
|
hash = "sha256-Vko/Plk7u6UAr32lieU+T9G34Dkg9EW3Noi/NArpRL4=";
|
2022-02-20 05:27:41 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
cmakeFlags = lib.optionals (!enableModTool) [
|
|
|
|
"-DENABLE_MODTOOL=OFF"
|
2023-03-24 00:07:29 +00: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 12:27:35 +00:00
|
|
|
];
|
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
postInstall = lib.optionalString (!stdenv.isDarwin) ''
|
2021-03-15 08:37:03 +00:00
|
|
|
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libvolk.so)
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
python3
|
2023-03-15 16:39:30 +00:00
|
|
|
python3.pkgs.mako
|
2021-03-15 08:37:03 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "http://libvolk.org/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Vector Optimized Library of Kernels";
|
2021-03-15 08:37:03 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ doronbehar ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|