anchor.diff:      ++ [ (stdenv.lib.optionalString stdenv.isAarch32 "-DCMAKE_CXX_FLAGS=-Wno-psabi") ]
     ;
   
  +  # Python + Mako are always required for the build itself but not necessary for runtime.
  +  pythonEnv = python.withPackages (ps: with ps; [ Mako ]
  +    ++ optionals (enableLibuhd_Python_api) [ numpy setuptools ]
  +    ++ optionals (enableUtils) [ requests six ]
  +  );
  +
     nativeBuildInputs = [
       cmake
       pkgconfig
  -    # Python + Mako are always required for the build itself but not necessary for runtime
  -    (python.withPackages (ps: with ps; [ Mako ]))
  -  ];
  +  ]
  +    # 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 (!enableLibuhd_Python_api && !enableUtils) [ pythonEnv ]
  +  ;
     buildInputs = [
  +    boost
       libusb1
  -    boost
  -  ];
  +  ]
  +    # However, if enableLibuhd_Python_api *or* enableUtils is on, we need
  +    # pythonEnv for runtime as well. The utilities' runtime dependencies are
  +    # handled at the environment
  +    ++ optionals (enableLibuhd_Python_api || enableUtils) [ pythonEnv ]
  +    ++ optionals (enableLiberio) [ liberio ]
  +    ++ optionals (enableDpdk) [ dpdk ]
  +  ;
  +
  +  doCheck = true;
   
     # Build only the host software
     preConfigure = "cd host";
  
positive.code:   enableParallelBuilding = true;
  
    cmakeFlags = [
    ]
      # TODO: Check if this still needed
      # ABI differences GCC 7.1
  
negative.code: , fetchFromGitHub
  , cmake
  , pkgconfig
  # See https://files.ettus.com/manual_archive/v3.15.0.0/html/page_build_guide.html for dependencies explanations
  , boost
  , enableLibuhd_C_api ? true
  # requires numpy
  , enableLibuhd_Python_api ? false
  , python ? null
  , enableExamples ? false
  , enableUtils ? false
  , enableLiberio ? false
  , liberio ? null
  , libusb1 ? null
  , enableDpdk ? false
  , dpdk ? null
  # Devices
  , enableOctoClock ? true
  , enableMpmd ? true
  , enableB100 ? true
  , enableB200 ? true
  , enableUsrp1 ? true
  , enableUsrp2 ? true
  , enableX300 ? true
  , enableN230 ? true
  , enableN300 ? true
  , enableN320 ? true
  , enableE300 ? true
  , enableE320 ? true
  }:
  
  # You need these udev rules to not have to run as root (copied from
  