1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-14 08:34:50 +00:00
nixpkgs/pkgs/development/libraries/libbladeRF/default.nix

46 lines
1.4 KiB
Nix
Raw Normal View History

2018-06-04 03:44:25 +01:00
{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake, git, doxygen, help2man, ncurses, tecla
2015-07-02 15:25:24 +01:00
, libusb1, udev }:
stdenv.mkDerivation rec {
2018-01-12 10:43:56 +00:00
version = "1.9.0";
2018-05-28 13:59:57 +01:00
name = "libbladeRF-${version}";
2015-07-02 15:25:24 +01:00
src = fetchFromGitHub {
owner = "Nuand";
repo = "bladeRF";
rev = "libbladeRF_v${version}";
2018-01-12 10:43:56 +00:00
sha256 = "0frvphp4xxdxwzmi94b0asl7b891sd3fk8iw9kfk8h6f3cdhj8xa";
};
nativeBuildInputs = [ pkgconfig ];
2018-06-04 03:44:25 +01:00
# ncurses used due to https://github.com/Nuand/bladeRF/blob/ab4fc672c8bab4f8be34e8917d3f241b1d52d0b8/host/utilities/bladeRF-cli/CMakeLists.txt#L208
buildInputs = [ cmake git doxygen help2man tecla libusb1 ]
++ lib.optionals stdenv.isLinux [ udev ]
++ lib.optionals stdenv.isDarwin [ ncurses ];
# Fixup shebang
prePatch = "patchShebangs host/utilities/bladeRF-cli/src/cmd/doc/generate.bash";
# Let us avoid nettools as a dependency.
patchPhase = ''
sed -i 's/$(hostname)/hostname/' host/utilities/bladeRF-cli/src/cmd/doc/generate.bash
'';
cmakeFlags = [
2018-06-04 03:44:25 +01:00
"-DBUILD_DOCUMENTATION=ON"
] ++ lib.optionals stdenv.isLinux [
"-DUDEV_RULES_PATH=etc/udev/rules.d"
"-DINSTALL_UDEV_RULES=ON"
];
hardeningDisable = [ "fortify" ];
2018-06-04 03:44:25 +01:00
meta = with lib; {
homepage = https://nuand.com/libbladeRF-doc;
description = "Supporting library of the BladeRF SDR opensource hardware";
2015-07-02 15:25:24 +01:00
license = licenses.lgpl21;
maintainers = with maintainers; [ funfunctor ];
2018-06-04 03:44:25 +01:00
platforms = platforms.unix;
};
}