···1111# requires numpy
1212, enablePythonApi ? false
1313, python3
1414+, buildPackages
1415, enableExamples ? false
1516, enableUtils ? false
1616-, enableSim ? false
1717, libusb1
1818, enableDpdk ? false
1919, dpdk
···3434let
3535 onOffBool = b: if b then "ON" else "OFF";
3636 inherit (lib) optionals;
3737+ # Later used in pythonEnv generation. Python + mako are always required for the build itself but not necessary for runtime.
3838+ pythonEnvArg = (ps: with ps; [ mako ]
3939+ ++ optionals (enablePythonApi) [ numpy setuptools ]
4040+ ++ optionals (enableUtils) [ requests six ]
4141+ );
3742in
38433944stdenv.mkDerivation rec {
···8489 ++ [ (lib.optionalString stdenv.isAarch32 "-DCMAKE_CXX_FLAGS=-Wno-psabi") ]
8590 ;
86918787- # Python + mako are always required for the build itself but not necessary for runtime.
8888- pythonEnv = python3.withPackages (ps: with ps; [ mako ]
8989- ++ optionals (enablePythonApi) [ numpy setuptools ]
9090- ++ optionals (enableUtils) [ requests six ]
9191- );
9292+ pythonEnv = python3.withPackages pythonEnvArg;
92939394 nativeBuildInputs = [
9495 cmake
9596 pkg-config
9696- python3
9797- ]
9898- # If both enableLibuhd_Python_api and enableUtils are off, we don't need
9999- # pythonEnv in buildInputs as it's a 'build' dependency and not a runtime
100100- # dependency
101101- ++ optionals (!enablePythonApi && !enableUtils) [ pythonEnv ]
102102- ;
9797+ # Present both here and in buildInputs for cross compilation.
9898+ (buildPackages.python3.withPackages pythonEnvArg)
9999+ ];
103100 buildInputs = [
104101 boost
105102 libusb1
···122119 patches = [
123120 # Disable tests that fail in the sandbox
124121 ./no-adapter-tests.patch
125125- ] ++ lib.optionals stdenv.isAarch32 [
126126- ./neon.patch
127122 ];
128123129124 postPhases = [ "installFirmware" "removeInstalledTests" ]
-19
pkgs/applications/radio/uhd/neon.patch
···11-Description: When building for armhf, enable NEON
22- NEON is part of the armhf baseline, so this will always be enabled on
33- armhf.
44-Author: Paul Tagliamonte <paultag@debian.org>
55-Bug-Debian: https://bugs.debian.org/873608
66-Origin: vendor
77-Last-Update: 2017-08-29
88-99---- uhd-3.10.2.0.orig/host/lib/convert/CMakeLists.txt
1010-+++ uhd-3.10.2.0/host/lib/convert/CMakeLists.txt
1111-@@ -67,6 +67,8 @@ IF(HAVE_ARM_NEON_H AND (${CMAKE_SIZEOF_V
1212- ${CMAKE_CURRENT_SOURCE_DIR}/convert_with_neon.cpp
1313- ${CMAKE_CURRENT_SOURCE_DIR}/convert_neon.S
1414- )
1515-+
1616-+ SET ( CMAKE_CXX_FLAGS "-mfpu=neon" )
1717- ENDIF()
1818-1919- ########################################################################