Merge pull request #219179 from doronbehar/pkg/gnuradio

This commit is contained in:
Franz Pletz 2023-03-06 15:36:07 +01:00 committed by GitHub
commit 83d926eff0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 98 additions and 18 deletions

View file

@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
pname = "uhd";
# UHD seems to use three different version number styles: x.y.z, xxx_yyy_zzz
# and xxx.yyy.zzz. Hrmpf... style keeps changing
version = "4.1.0.5";
version = "4.4.0.0";
outputs = [ "out" "dev" ];
@ -47,12 +47,12 @@ stdenv.mkDerivation rec {
owner = "EttusResearch";
repo = "uhd";
rev = "v${version}";
sha256 = "sha256-XBq4GkLRR2SFunFRvpPOMiIbTuUkMYf8tPAoHCoveRA=";
sha256 = "sha256-khVOHlvacZc4EMg4m55rxEqPvLY1xURpAfOW905/3jg=";
};
# Firmware images are downloaded (pre-built) from the respective release on Github
uhdImagesSrc = fetchurl {
url = "https://github.com/EttusResearch/uhd/releases/download/v${version}/uhd-images_${version}.tar.xz";
sha256 = "HctHB90ikOMkrYNyWmjGE/2HvA7xXKCUezdtiqzN+1A=";
sha256 = "V8ldW8bvYWbrDAvpWpHcMeLf9YvF8PIruDAyNK/bru4=";
};
cmakeFlags = [
@ -116,7 +116,12 @@ stdenv.mkDerivation rec {
preConfigure = "cd host";
# TODO: Check if this still needed, perhaps relevant:
# https://files.ettus.com/manual_archive/v3.15.0.0/html/page_build_guide.html#build_instructions_unix_arm
patches = if stdenv.isAarch32 then ./neon.patch else null;
patches = [
# Disable tests that fail in the sandbox
./no-adapter-tests.patch
] ++ lib.optionals stdenv.isAarch32 [
./neon.patch
];
postPhases = [ "installFirmware" "removeInstalledTests" ]
++ optionals (enableUtils) [ "moveUdevRules" ]

View file

@ -0,0 +1,17 @@
diff --git i/host/tests/CMakeLists.txt w/host/tests/CMakeLists.txt
index f40c252ad..b8a07d341 100644
--- i/host/tests/CMakeLists.txt
+++ w/host/tests/CMakeLists.txt
@@ -453,12 +453,6 @@ UHD_ADD_NONAPI_TEST(
${UHD_SOURCE_DIR}/lib/utils/compat_check.cpp
)
-UHD_ADD_NONAPI_TEST(
- TARGET "xport_adapter_ctrl_test.cpp"
- EXTRA_SOURCES
- ${UHD_SOURCE_DIR}/lib/usrp/cores/xport_adapter_ctrl.cpp
-)
-
########################################################################
# demo of a loadable module
########################################################################

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

@ -6973,7 +6973,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 { };