1 { stdenv, lib, fetchFromGitHub, pkg-config, cmake, git, doxygen, help2man, ncurses, tecla
4 stdenv.mkDerivation rec {
8 src = fetchFromGitHub {
11 rev = "libbladeRF_v${version}";
12 hash = "sha256-H40w5YKp6M3QLrsPhILEnJiWutCYLtbgC4a63sV397Q=";
13 fetchSubmodules = true;
16 nativeBuildInputs = [ cmake pkg-config git doxygen help2man ];
17 # ncurses used due to https://github.com/Nuand/bladeRF/blob/ab4fc672c8bab4f8be34e8917d3f241b1d52d0b8/host/utilities/bladeRF-cli/CMakeLists.txt#L208
18 buildInputs = [ tecla libusb1 ]
19 ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ]
20 ++ lib.optionals stdenv.hostPlatform.isDarwin [ ncurses ];
23 prePatch = "patchShebangs host/utilities/bladeRF-cli/src/cmd/doc/generate.bash";
25 # Let us avoid nettools as a dependency.
27 sed -i 's/$(hostname)/hostname/' host/utilities/bladeRF-cli/src/cmd/doc/generate.bash
31 "-DBUILD_DOCUMENTATION=ON"
32 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
33 "-DUDEV_RULES_PATH=etc/udev/rules.d"
34 "-DINSTALL_UDEV_RULES=ON"
35 "-DBLADERF_GROUP=bladerf"
38 env = lib.optionalAttrs stdenv.cc.isClang {
39 NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable";
42 hardeningDisable = [ "fortify" ];
45 homepage = "https://nuand.com/libbladeRF-doc";
46 description = "Supporting library of the BladeRF SDR opensource hardware";
47 license = licenses.lgpl21;
48 maintainers = with maintainers; [ markuskowa ];
49 platforms = platforms.unix;