From 9c8a86d52f66d64cb5d268398fd5269a3cbb024b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 17 Apr 2023 19:22:18 +0300 Subject: [PATCH 1/4] Revert "uhd: fix cross" This reverts commit ec1631a06f864c5303c86f63862e5bc3c4ee3e67. It was merged too fast, without giving a chance to maintainers to suggest the changes in the upcoming commits. --- pkgs/applications/radio/uhd/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/applications/radio/uhd/default.nix b/pkgs/applications/radio/uhd/default.nix index 476a954f8181..b810af6e2ea6 100644 --- a/pkgs/applications/radio/uhd/default.nix +++ b/pkgs/applications/radio/uhd/default.nix @@ -93,7 +93,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config - python3 ] # If both enableLibuhd_Python_api and enableUtils are off, we don't need # pythonEnv in buildInputs as it's a 'build' dependency and not a runtime From 3697ccb4b1444c1cd4259da5bb875308b091488b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 17 Apr 2023 19:27:27 +0300 Subject: [PATCH 2/4] uhd: Remove neon.patch not applying anymore --- pkgs/applications/radio/uhd/default.nix | 2 -- pkgs/applications/radio/uhd/neon.patch | 19 ------------------- 2 files changed, 21 deletions(-) delete mode 100644 pkgs/applications/radio/uhd/neon.patch diff --git a/pkgs/applications/radio/uhd/default.nix b/pkgs/applications/radio/uhd/default.nix index b810af6e2ea6..678236ebbefe 100644 --- a/pkgs/applications/radio/uhd/default.nix +++ b/pkgs/applications/radio/uhd/default.nix @@ -121,8 +121,6 @@ stdenv.mkDerivation rec { patches = [ # Disable tests that fail in the sandbox ./no-adapter-tests.patch - ] ++ lib.optionals stdenv.isAarch32 [ - ./neon.patch ]; postPhases = [ "installFirmware" "removeInstalledTests" ] diff --git a/pkgs/applications/radio/uhd/neon.patch b/pkgs/applications/radio/uhd/neon.patch deleted file mode 100644 index 18ec59c1d64b..000000000000 --- a/pkgs/applications/radio/uhd/neon.patch +++ /dev/null @@ -1,19 +0,0 @@ -Description: When building for armhf, enable NEON - NEON is part of the armhf baseline, so this will always be enabled on - armhf. -Author: Paul Tagliamonte -Bug-Debian: https://bugs.debian.org/873608 -Origin: vendor -Last-Update: 2017-08-29 - ---- uhd-3.10.2.0.orig/host/lib/convert/CMakeLists.txt -+++ uhd-3.10.2.0/host/lib/convert/CMakeLists.txt -@@ -67,6 +67,8 @@ IF(HAVE_ARM_NEON_H AND (${CMAKE_SIZEOF_V - ${CMAKE_CURRENT_SOURCE_DIR}/convert_with_neon.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/convert_neon.S - ) -+ -+ SET ( CMAKE_CXX_FLAGS "-mfpu=neon" ) - ENDIF() - - ######################################################################## From be4ae4fbfdbb44c44e74cc01b35739aecd56cf35 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 17 Apr 2023 19:30:30 +0300 Subject: [PATCH 3/4] uhd: Remove unused enableSim flag --- pkgs/applications/radio/uhd/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/applications/radio/uhd/default.nix b/pkgs/applications/radio/uhd/default.nix index 678236ebbefe..0658402dea1b 100644 --- a/pkgs/applications/radio/uhd/default.nix +++ b/pkgs/applications/radio/uhd/default.nix @@ -13,7 +13,6 @@ , python3 , enableExamples ? false , enableUtils ? false -, enableSim ? false , libusb1 , enableDpdk ? false , dpdk From 25665063b9077c9cdc6db1549ebb3d3ae070b892 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 17 Apr 2023 19:32:10 +0300 Subject: [PATCH 4/4] uhd: Add a buildPackages pythonEnv for nativeBuildInputs --- pkgs/applications/radio/uhd/default.nix | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/radio/uhd/default.nix b/pkgs/applications/radio/uhd/default.nix index 0658402dea1b..873c49dd9a7c 100644 --- a/pkgs/applications/radio/uhd/default.nix +++ b/pkgs/applications/radio/uhd/default.nix @@ -11,6 +11,7 @@ # requires numpy , enablePythonApi ? false , python3 +, buildPackages , enableExamples ? false , enableUtils ? false , libusb1 @@ -33,6 +34,11 @@ let onOffBool = b: if b then "ON" else "OFF"; inherit (lib) optionals; + # Later used in pythonEnv generation. Python + mako are always required for the build itself but not necessary for runtime. + pythonEnvArg = (ps: with ps; [ mako ] + ++ optionals (enablePythonApi) [ numpy setuptools ] + ++ optionals (enableUtils) [ requests six ] + ); in stdenv.mkDerivation rec { @@ -83,21 +89,14 @@ stdenv.mkDerivation rec { ++ [ (lib.optionalString stdenv.isAarch32 "-DCMAKE_CXX_FLAGS=-Wno-psabi") ] ; - # Python + mako are always required for the build itself but not necessary for runtime. - pythonEnv = python3.withPackages (ps: with ps; [ mako ] - ++ optionals (enablePythonApi) [ numpy setuptools ] - ++ optionals (enableUtils) [ requests six ] - ); + pythonEnv = python3.withPackages pythonEnvArg; nativeBuildInputs = [ cmake pkg-config - ] - # If both enableLibuhd_Python_api and enableUtils are off, we don't need - # pythonEnv in buildInputs as it's a 'build' dependency and not a runtime - # dependency - ++ optionals (!enablePythonApi && !enableUtils) [ pythonEnv ] - ; + # Present both here and in buildInputs for cross compilation. + (buildPackages.python3.withPackages pythonEnvArg) + ]; buildInputs = [ boost libusb1