From c3c40d562c254c260b959f513424db6fba3cb7e9 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 2 Mar 2023 15:13:33 +0200 Subject: [PATCH 1/2] uhd: 4.1.0.5 -> 4.4.0.0 Diff: https://github.com/EttusResearch/uhd/compare/v4.1.0.5...4.4.0.0 --- pkgs/applications/radio/uhd/default.nix | 13 +++++++++---- .../radio/uhd/no-adapter-tests.patch | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 pkgs/applications/radio/uhd/no-adapter-tests.patch diff --git a/pkgs/applications/radio/uhd/default.nix b/pkgs/applications/radio/uhd/default.nix index 6fa8462ec10c..3eb5b9a679dc 100644 --- a/pkgs/applications/radio/uhd/default.nix +++ b/pkgs/applications/radio/uhd/default.nix @@ -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" ] diff --git a/pkgs/applications/radio/uhd/no-adapter-tests.patch b/pkgs/applications/radio/uhd/no-adapter-tests.patch new file mode 100644 index 000000000000..38865f418101 --- /dev/null +++ b/pkgs/applications/radio/uhd/no-adapter-tests.patch @@ -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 + ######################################################################## From 22ee36406c6aebb2a4df228a932e48944e9eca72 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 2 Mar 2023 15:13:05 +0200 Subject: [PATCH 2/2] volk: 2.5.0 -> 3.0.0 Diff: https://github.com/gnuradio/volk/compare/v2.5.0...3.0.0 --- pkgs/development/libraries/volk/2.5.0.nix | 61 +++++++++++++++++++++ pkgs/development/libraries/volk/default.nix | 19 ++----- pkgs/top-level/all-packages.nix | 6 +- 3 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 pkgs/development/libraries/volk/2.5.0.nix diff --git a/pkgs/development/libraries/volk/2.5.0.nix b/pkgs/development/libraries/volk/2.5.0.nix new file mode 100644 index 000000000000..76dbf133be9a --- /dev/null +++ b/pkgs/development/libraries/volk/2.5.0.nix @@ -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; + }; +} + diff --git a/pkgs/development/libraries/volk/default.nix b/pkgs/development/libraries/volk/default.nix index 503615926433..f5cec86e1400 100644 --- a/pkgs/development/libraries/volk/default.nix +++ b/pkgs/development/libraries/volk/default.nix @@ -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) '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ef967f8e43ed..62bf709b93f2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };