···11-{ lib
22-, stdenv
33-, fetchurl
44-, fetchFromGitHub
55-, cmake
66-, pkg-config
77-# See https://files.ettus.com/manual_archive/v3.15.0.0/html/page_build_guide.html for dependencies explanations
88-, boost
99-, enableLibuhd_C_api ? true
1010-# requires numpy
1111-, enableLibuhd_Python_api ? false
1212-, python3
1313-, enableExamples ? false
1414-, enableUtils ? false
1515-, enableLiberio ? false
1616-, liberio
1717-, libusb1
1818-, enableDpdk ? false
1919-, dpdk
2020-# Devices
2121-, enableOctoClock ? true
2222-, enableMpmd ? true
2323-, enableB100 ? true
2424-, enableB200 ? true
2525-, enableUsrp1 ? true
2626-, enableUsrp2 ? true
2727-, enableX300 ? true
2828-, enableN230 ? true
2929-, enableN300 ? true
3030-, enableN320 ? true
3131-, enableE300 ? true
3232-, enableE320 ? true
3333-}:
3434-3535-let
3636- onOffBool = b: if b then "ON" else "OFF";
3737- inherit (lib) optionals;
3838-in
3939-4040-stdenv.mkDerivation rec {
4141- pname = "uhd";
4242- # UHD seems to use three different version number styles: x.y.z, xxx_yyy_zzz
4343- # and xxx.yyy.zzz. Hrmpf... style keeps changing
4444- version = "3.15.0.0";
4545-4646- src = fetchFromGitHub {
4747- owner = "EttusResearch";
4848- repo = "uhd";
4949- rev = "v${version}";
5050- sha256 = "0jknln88a69fh244670nb7qrflbyv0vvdxfddb5g8ncpb6hcg8qf";
5151- };
5252- # Firmware images are downloaded (pre-built) from the respective release on Github
5353- uhdImagesSrc = fetchurl {
5454- url = "https://github.com/EttusResearch/uhd/releases/download/v${version}/uhd-images_${version}.tar.xz";
5555- sha256 = "1fir1a13ac07mqhm4sr34cixiqj2difxq0870qv1wr7a7cbfw6vp";
5656- };
5757-5858- cmakeFlags = [
5959- "-DENABLE_LIBUHD=ON"
6060- "-DENABLE_USB=ON"
6161- "-DENABLE_TESTS=ON" # This installs tests as well so we delete them via postPhases
6262- "-DENABLE_EXAMPLES=${onOffBool enableExamples}"
6363- "-DENABLE_UTILS=${onOffBool enableUtils}"
6464- "-DENABLE_LIBUHD_C_API=${onOffBool enableLibuhd_C_api}"
6565- "-DENABLE_LIBUHD_PYTHON_API=${onOffBool enableLibuhd_Python_api}"
6666- "-DENABLE_LIBERIO=${onOffBool enableLiberio}"
6767- "-DENABLE_DPDK=${onOffBool enableDpdk}"
6868- # Devices
6969- "-DENABLE_OCTOCLOCK=${onOffBool enableOctoClock}"
7070- "-DENABLE_MPMD=${onOffBool enableMpmd}"
7171- "-DENABLE_B100=${onOffBool enableB100}"
7272- "-DENABLE_B200=${onOffBool enableB200}"
7373- "-DENABLE_USRP1=${onOffBool enableUsrp1}"
7474- "-DENABLE_USRP2=${onOffBool enableUsrp2}"
7575- "-DENABLE_X300=${onOffBool enableX300}"
7676- "-DENABLE_N230=${onOffBool enableN230}"
7777- "-DENABLE_N300=${onOffBool enableN300}"
7878- "-DENABLE_N320=${onOffBool enableN320}"
7979- "-DENABLE_E300=${onOffBool enableE300}"
8080- "-DENABLE_E320=${onOffBool enableE320}"
8181- ]
8282- # TODO: Check if this still needed
8383- # ABI differences GCC 7.1
8484- # /nix/store/wd6r25miqbk9ia53pp669gn4wrg9n9cj-gcc-7.3.0/include/c++/7.3.0/bits/vector.tcc:394:7: note: parameter passing for argument of type 'std::vector<uhd::range_t>::iterator {aka __gnu_cxx::__normal_iterator<uhd::range_t*, std::vector<uhd::range_t> >}' changed in GCC 7.1
8585- ++ [ (lib.optionalString stdenv.isAarch32 "-DCMAKE_CXX_FLAGS=-Wno-psabi") ]
8686- ;
8787-8888- # Python + mako are always required for the build itself but not necessary for runtime.
8989- pythonEnv = python3.withPackages (ps: with ps; [ mako ]
9090- ++ optionals (enableLibuhd_Python_api) [ numpy setuptools ]
9191- ++ optionals (enableUtils) [ requests six ]
9292- );
9393-9494- nativeBuildInputs = [
9595- cmake
9696- pkg-config
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 (!enableLibuhd_Python_api && !enableUtils) [ pythonEnv ]
102102- ;
103103- buildInputs = [
104104- boost
105105- libusb1
106106- ]
107107- # However, if enableLibuhd_Python_api *or* enableUtils is on, we need
108108- # pythonEnv for runtime as well. The utilities' runtime dependencies are
109109- # handled at the environment
110110- ++ optionals (enableLibuhd_Python_api || enableUtils) [ pythonEnv ]
111111- ++ optionals (enableLiberio) [ liberio ]
112112- ++ optionals (enableDpdk) [ dpdk ]
113113- ;
114114-115115- doCheck = true;
116116-117117- # Build only the host software
118118- preConfigure = "cd host";
119119- # TODO: Check if this still needed, perhaps relevant:
120120- # https://files.ettus.com/manual_archive/v3.15.0.0/html/page_build_guide.html#build_instructions_unix_arm
121121- patches = if stdenv.isAarch32 then ./neon.patch else null;
122122-123123- postPhases = [ "installFirmware" "removeInstalledTests" ]
124124- ++ optionals (enableUtils) [ "moveUdevRules" ]
125125- ;
126126-127127- # UHD expects images in `$CMAKE_INSTALL_PREFIX/share/uhd/images`
128128- installFirmware = ''
129129- mkdir -p "$out/share/uhd/images"
130130- tar --strip-components=1 -xvf "${uhdImagesSrc}" -C "$out/share/uhd/images"
131131- '';
132132-133133- # -DENABLE_TESTS=ON installs the tests, we don't need them in the output
134134- removeInstalledTests = ''
135135- rm -r $out/lib/uhd/tests
136136- '';
137137-138138- # Moves the udev rules to the standard location, needed only if utils are
139139- # enabled
140140- moveUdevRules = ''
141141- mkdir -p $out/lib/udev/rules.d
142142- mv $out/lib/uhd/utils/uhd-usrp.rules $out/lib/udev/rules.d/
143143- '';
144144-145145- meta = with lib; {
146146- broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
147147- description = "USRP Hardware Driver (for Software Defined Radio)";
148148- longDescription = ''
149149- The USRP Hardware Driver (UHD) software is the hardware driver for all
150150- USRP (Universal Software Radio Peripheral) devices.
151151-152152- USRP devices are designed and sold by Ettus Research, LLC and its parent
153153- company, National Instruments.
154154- '';
155155- homepage = "https://uhd.ettus.com/";
156156- license = licenses.gpl3Plus;
157157- platforms = platforms.linux ++ platforms.darwin;
158158- maintainers = with maintainers; [ bjornfor fpletz tomberek ];
159159- };
160160-}
+12-2
pkgs/applications/radio/uhd/default.nix
···88, boost
99, ncurses
1010, enableCApi ? true
1111-# requires numpy
1111+# Although we handle the Python API's dependencies in pythonEnvArg, this
1212+# feature is currently disabled as upstream attempts to run `python setup.py
1313+# install` by itself, and it fails because the Python's environment's prefix is
1414+# not a writable directly. Adding support for this feature would require using
1515+# python's pypa/build nad pypa/install hooks directly, and currently it is hard
1616+# to do that because it all happens after a long buildPhase of the C API.
1217, enablePythonApi ? false
1318, python3
1419, buildPackages
1520, enableExamples ? false
1616-, enableUtils ? false
2121+, enableUtils ? true
1722, libusb1
2323+# Disable dpdk for now due to compilation issues.
1824, enableDpdk ? false
1925, dpdk
2026# Devices
···143149 mkdir -p $out/lib/udev/rules.d
144150 mv $out/lib/uhd/utils/uhd-usrp.rules $out/lib/udev/rules.d/
145151 '';
152152+153153+ disallowedReferences = optionals (!enablePythonApi && !enableUtils) [
154154+ python3
155155+ ];
146156147157 meta = with lib; {
148158 description = "USRP Hardware Driver (for Software Defined Radio)";
+1
pkgs/top-level/aliases.nix
···816816 uade123 = uade; # Added 2022-07-30
817817 uberwriter = apostrophe; # Added 2020-04-23
818818 ubootBeagleboneBlack = ubootAmx335xEVM; # Added 2020-01-21
819819+ uhd3_5 = throw "uhd3_5 has been removed, because it was no longer needed"; # Added 2023-10-07
819820 uhhyou.lv2 = throw "'uhhyou.lv2' has been removed, upstream gone"; # Added 2023-06-21
820821 unicorn-emu = unicorn; # Added 2020-10-29
821822 uniffi-bindgen = throw "uniffi-bindgen has been removed since upstream no longer provides a standalone package for the CLI";