depot/third_party/nixpkgs/pkgs/applications/radio/hackrf/default.nix
Default email c594a97518 Project import generated by Copybara.
GitOrigin-RevId: 301aada7a64812853f2e2634a530ef5d34505048
2022-10-21 20:38:19 +02:00

42 lines
999 B
Nix

{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libusb1, fftwSinglePrec }:
stdenv.mkDerivation rec {
pname = "hackrf";
version = "2022.09.1";
src = fetchFromGitHub {
owner = "greatscottgadgets";
repo = "hackrf";
rev = "v${version}";
sha256 = "sha256-c+9DEMxioIbEDNTdLSOnxX1zpFk07K9rlGP9goEJMlU=";
};
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
libusb1
fftwSinglePrec
];
cmakeFlags = [ "-DUDEV_RULES_GROUP=plugdev" "-DUDEV_RULES_PATH=lib/udev/rules.d" ];
preConfigure = ''
cd host
'';
postPatch = ''
substituteInPlace host/cmake/modules/FindFFTW.cmake \
--replace "find_library (FFTW_LIBRARIES NAMES fftw3)" "find_library (FFTW_LIBRARIES NAMES fftw3f)"
'';
meta = with lib; {
description = "An open source SDR platform";
homepage = "https://greatscottgadgets.com/hackrf/";
license = licenses.gpl2;
platforms = platforms.all;
maintainers = with maintainers; [ sjmackenzie ];
};
}