1 { stdenv, lib, fetchFromGitHub, fetchpatch, pkg-config, cmake, git, doxygen, help2man, ncurses, tecla
5 noos = fetchFromGitHub {
6 owner = "analogdevicesinc";
8 rev = "0bba46e6f6f75785a65d425ece37d0a04daf6157";
9 sha256 = "0is79dhsyp9xmlnfdr1i5s1c22ipjafk9d35jpn5dynpvj86m99c";
11 in stdenv.mkDerivation rec {
15 src = fetchFromGitHub {
18 rev = "libbladeRF_v${version}";
19 sha256 = "05axh51lrzxpz2qfswnjwxpfk3mlsv2wc88dd12gfr1karn5jwz9";
22 nativeBuildInputs = [ cmake pkg-config git doxygen help2man ];
23 # ncurses used due to https://github.com/Nuand/bladeRF/blob/ab4fc672c8bab4f8be34e8917d3f241b1d52d0b8/host/utilities/bladeRF-cli/CMakeLists.txt#L208
24 buildInputs = [ tecla libusb1 ]
25 ++ lib.optionals stdenv.isLinux [ udev ]
26 ++ lib.optionals stdenv.isDarwin [ ncurses ];
30 cp -r ${noos}/* source/thirdparty/analogdevicesinc/no-OS/
34 prePatch = "patchShebangs host/utilities/bladeRF-cli/src/cmd/doc/generate.bash";
36 # Let us avoid nettools as a dependency.
38 sed -i 's/$(hostname)/hostname/' host/utilities/bladeRF-cli/src/cmd/doc/generate.bash
42 "-DBUILD_DOCUMENTATION=ON"
43 ] ++ lib.optionals stdenv.isLinux [
44 "-DUDEV_RULES_PATH=etc/udev/rules.d"
45 "-DINSTALL_UDEV_RULES=ON"
46 "-DBLADERF_GROUP=bladerf"
49 hardeningDisable = [ "fortify" ];
52 homepage = "https://nuand.com/libbladeRF-doc";
53 description = "Supporting library of the BladeRF SDR opensource hardware";
54 license = licenses.lgpl21;
55 maintainers = with maintainers; [ ];
56 platforms = platforms.unix;