2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libusb1, fftwSinglePrec }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "hackrf";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "2022.09.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-10-11 16:52:03 +00:00
|
|
|
owner = "greatscottgadgets";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "hackrf";
|
|
|
|
rev = "v${version}";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-c+9DEMxioIbEDNTdLSOnxX1zpFk07K9rlGP9goEJMlU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libusb1
|
|
|
|
fftwSinglePrec
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DUDEV_RULES_GROUP=plugdev" "-DUDEV_RULES_PATH=lib/udev/rules.d" ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd host
|
|
|
|
'';
|
|
|
|
|
2021-10-11 16:52:03 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace host/cmake/modules/FindFFTW.cmake \
|
|
|
|
--replace "find_library (FFTW_LIBRARIES NAMES fftw3)" "find_library (FFTW_LIBRARIES NAMES fftw3f)"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An open source SDR platform";
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://greatscottgadgets.com/hackrf/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.all;
|
2020-05-15 21:57:56 +00:00
|
|
|
maintainers = with maintainers; [ sjmackenzie ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|