Unverified Commit 0038a3c5 authored by Doron Behar's avatar Doron Behar Committed by GitHub
Browse files

Merge pull request #226676 from doronbehar/pkg/uhd-cross

uhd: Better cross compilation support
parents d6fea845 25665063
Loading
Loading
Loading
Loading
+10 −15
Original line number Diff line number Diff line
@@ -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" ]
+0 −19
Original line number Diff line number Diff line
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()
 
 ########################################################################