at 24.05-pre 51 lines 1.6 kB view raw
1{ stdenv, lib, fetchFromGitHub, fetchpatch, pkg-config, cmake, git, doxygen, help2man, ncurses, tecla 2, libusb1, udev }: 3 4stdenv.mkDerivation rec { 5 pname = "libbladeRF"; 6 version = "2.5.0"; 7 8 src = fetchFromGitHub { 9 owner = "Nuand"; 10 repo = "bladeRF"; 11 rev = "libbladeRF_v${version}"; 12 sha256 = "sha256-H40w5YKp6M3QLrsPhILEnJiWutCYLtbgC4a63sV397Q="; 13 fetchSubmodules = true; 14 }; 15 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.isLinux [ udev ] 20 ++ lib.optionals stdenv.isDarwin [ ncurses ]; 21 22 # Fixup shebang 23 prePatch = "patchShebangs host/utilities/bladeRF-cli/src/cmd/doc/generate.bash"; 24 25 # Let us avoid nettools as a dependency. 26 postPatch = '' 27 sed -i 's/$(hostname)/hostname/' host/utilities/bladeRF-cli/src/cmd/doc/generate.bash 28 ''; 29 30 cmakeFlags = [ 31 "-DBUILD_DOCUMENTATION=ON" 32 ] ++ lib.optionals stdenv.isLinux [ 33 "-DUDEV_RULES_PATH=etc/udev/rules.d" 34 "-DINSTALL_UDEV_RULES=ON" 35 "-DBLADERF_GROUP=bladerf" 36 ]; 37 38 env = lib.optionalAttrs stdenv.cc.isClang { 39 NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable"; 40 }; 41 42 hardeningDisable = [ "fortify" ]; 43 44 meta = with lib; { 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; 50 }; 51}