python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / libbladeRF / default.nix
blob4b2c48824fb7c71dba89d27a6fa6614bacb3c30c
1 { stdenv, lib, fetchFromGitHub, fetchpatch, pkg-config, cmake, git, doxygen, help2man, ncurses, tecla
2 , libusb1, udev }:
3 let
4   # fetch submodule
5   noos = fetchFromGitHub {
6     owner = "analogdevicesinc";
7     repo = "no-OS";
8     rev = "0bba46e6f6f75785a65d425ece37d0a04daf6157";
9     sha256 = "0is79dhsyp9xmlnfdr1i5s1c22ipjafk9d35jpn5dynpvj86m99c";
10   };
11 in stdenv.mkDerivation rec {
12   pname = "libbladeRF";
13   version = "2.4.1";
15   src = fetchFromGitHub {
16     owner = "Nuand";
17     repo = "bladeRF";
18     rev = "libbladeRF_v${version}";
19     sha256 = "05axh51lrzxpz2qfswnjwxpfk3mlsv2wc88dd12gfr1karn5jwz9";
20   };
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 ];
29   postUnpack = ''
30     cp -r ${noos}/* source/thirdparty/analogdevicesinc/no-OS/
31   '';
33   # Fixup shebang
34   prePatch = "patchShebangs host/utilities/bladeRF-cli/src/cmd/doc/generate.bash";
36   # Let us avoid nettools as a dependency.
37   postPatch = ''
38     sed -i 's/$(hostname)/hostname/' host/utilities/bladeRF-cli/src/cmd/doc/generate.bash
39   '';
41   cmakeFlags = [
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"
47   ];
49   hardeningDisable = [ "fortify" ];
51   meta = with lib; {
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;
57   };