libbladerf: enable Darwin building

This commit is contained in:
Luke Adams 2018-06-03 21:44:25 -05:00
parent 312d2897cd
commit 0f6682c97f

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, pkgconfig, cmake, git, doxygen, help2man, tecla
{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake, git, doxygen, help2man, ncurses, tecla
, libusb1, udev }:
stdenv.mkDerivation rec {
@ -13,7 +13,10 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ cmake git doxygen help2man tecla libusb1 udev ];
# 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";
@ -24,19 +27,19 @@ stdenv.mkDerivation rec {
'';
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Debug"
"-DBUILD_DOCUMENTATION=ON"
] ++ lib.optionals stdenv.isLinux [
"-DUDEV_RULES_PATH=etc/udev/rules.d"
"-DINSTALL_UDEV_RULES=ON"
"-DBUILD_DOCUMENTATION=ON"
];
hardeningDisable = [ "fortify" ];
meta = with stdenv.lib; {
meta = with lib; {
homepage = https://nuand.com/libbladeRF-doc;
description = "Supporting library of the BladeRF SDR opensource hardware";
license = licenses.lgpl21;
maintainers = with maintainers; [ funfunctor ];
platforms = with platforms; linux;
platforms = platforms.unix;
};
}