volk: 2.5.0 -> 3.0.0

Diff: https://github.com/gnuradio/volk/compare/v2.5.0...3.0.0
This commit is contained in:
Doron Behar 2023-03-02 15:13:05 +02:00
parent c3c40d562c
commit 22ee36406c
3 changed files with 72 additions and 14 deletions

View File

@ -0,0 +1,61 @@
{ stdenv
, lib
, fetchFromGitHub
, cmake
, 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 {
owner = "gnuradio";
repo = pname;
rev = "v${version}";
sha256 = "sha256-kI4IuO6TLplo5lLAGIPWQWtePcjIEWB9XaJDA6WlqSg=";
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"
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
# offset 14335 in1: -1.03372 in2: -1.03371 tolerance was: 1e-05
# volk_32f_log2_32f: fail on arch neon
"-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;qa_volk_32f_log2_32f"
];
postInstall = lib.optionalString (!stdenv.isDarwin) ''
${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;
};
}

View File

@ -1,41 +1,34 @@
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, cmake
, 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";
version = "3.0.0";
src = fetchFromGitHub {
owner = "gnuradio";
repo = pname;
rev = "v${version}";
sha256 = "XvX6emv30bSB29EFm6aC+j8NGOxWqHCNv0Hxtdrq/jc=";
hash = "sha256-kI4IuO6TLplo5lLAGIPWQWtePcjIEWB9XaJDA6WlqSg=";
fetchSubmodules = true;
};
patches = [
# Remove a failing test
(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 = "";
url = "https://github.com/gnuradio/volk/commit/fe2e4a73480bf2ac2e566052ea682817dddaf61f.patch";
hash = "sha256-Vko/Plk7u6UAr32lieU+T9G34Dkg9EW3Noi/NArpRL4=";
})
];
cmakeFlags = lib.optionals (!enableModTool) [
"-DENABLE_MODTOOL=OFF"
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
# offset 14335 in1: -1.03372 in2: -1.03371 tolerance was: 1e-05
# volk_32f_log2_32f: fail on arch neon
"-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;qa_volk_32f_log2_32f"
];
postInstall = lib.optionalString (!stdenv.isDarwin) ''

View File

@ -6967,7 +6967,11 @@ with pkgs;
volctl = callPackage ../tools/audio/volctl { };
volk = callPackage ../development/libraries/volk { };
volk = if (stdenv.isDarwin && stdenv.isAarch64) then
(callPackage ../development/libraries/volk/2.5.0.nix { })
else
(callPackage ../development/libraries/volk { })
;
vorta = libsForQt5.callPackage ../applications/backup/vorta { };