about summary refs log tree commit diff
path: root/pkgs/applications/radio
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2023-04-21 03:16:32 -0700
committerGitHub <noreply@github.com>2023-04-21 03:16:32 -0700
commit0038a3c5faeb75f2e9625307b4a0843040a67504 (patch)
tree2f2a8f7b0f5c9ce6816deb44ad307df0ba4d7ab0 /pkgs/applications/radio
parentd6fea845512027025810cef221360aab2aadfa18 (diff)
parent25665063b9077c9cdc6db1549ebb3d3ae070b892 (diff)
Merge pull request #226676 from doronbehar/pkg/uhd-cross
uhd: Better cross compilation support
Diffstat (limited to 'pkgs/applications/radio')
-rw-r--r--pkgs/applications/radio/uhd/default.nix25
-rw-r--r--pkgs/applications/radio/uhd/neon.patch19
2 files changed, 10 insertions, 34 deletions
diff --git a/pkgs/applications/radio/uhd/default.nix b/pkgs/applications/radio/uhd/default.nix
index 476a954f8181a..873c49dd9a7c8 100644
--- a/pkgs/applications/radio/uhd/default.nix
+++ b/pkgs/applications/radio/uhd/default.nix
@@ -11,9 +11,9 @@
 # requires numpy
 , enablePythonApi ? false
 , python3
+, buildPackages
 , enableExamples ? false
 , enableUtils ? false
-, enableSim ? false
 , libusb1
 , enableDpdk ? false
 , dpdk
@@ -34,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 {
@@ -84,22 +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
-    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
-    # dependency
-    ++ optionals (!enablePythonApi && !enableUtils) [ pythonEnv ]
-  ;
+    # Present both here and in buildInputs for cross compilation.
+    (buildPackages.python3.withPackages pythonEnvArg)
+  ];
   buildInputs = [
     boost
     libusb1
@@ -122,8 +119,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 18ec59c1d64be..0000000000000
--- 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 <paultag@debian.org>
-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()
- 
- ########################################################################