16 stdenv.mkDerivation rec {
20 src = fetchFromGitHub {
23 rev = "libbladeRF_v${version}";
24 hash = "sha256-H40w5YKp6M3QLrsPhILEnJiWutCYLtbgC4a63sV397Q=";
25 fetchSubmodules = true;
29 # https://github.com/Nuand/bladeRF/issues/994
30 ./gcc-14-calloc-fixes.diff
40 # ncurses used due to https://github.com/Nuand/bladeRF/blob/ab4fc672c8bab4f8be34e8917d3f241b1d52d0b8/host/utilities/bladeRF-cli/CMakeLists.txt#L208
46 ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ]
47 ++ lib.optionals stdenv.hostPlatform.isDarwin [ ncurses ];
50 prePatch = "patchShebangs host/utilities/bladeRF-cli/src/cmd/doc/generate.bash";
52 # Let us avoid nettools as a dependency.
54 sed -i 's/$(hostname)/hostname/' host/utilities/bladeRF-cli/src/cmd/doc/generate.bash
59 "-DBUILD_DOCUMENTATION=ON"
61 ++ lib.optionals stdenv.hostPlatform.isLinux [
62 "-DUDEV_RULES_PATH=etc/udev/rules.d"
63 "-DINSTALL_UDEV_RULES=ON"
64 "-DBLADERF_GROUP=bladerf"
67 env = lib.optionalAttrs stdenv.cc.isClang {
68 NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable";
71 hardeningDisable = [ "fortify" ];
74 homepage = "https://nuand.com/libbladeRF-doc";
75 description = "Supporting library of the BladeRF SDR opensource hardware";
76 license = licenses.lgpl21;
77 maintainers = with maintainers; [ markuskowa ];
78 platforms = platforms.unix;