2021-01-17 03:09:27 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libusb1, fftwSinglePrec }:
|
2015-05-08 17:31:26 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "hackrf";
|
2021-10-09 22:29:09 +02:00
|
|
|
version = "2021.03.1";
|
2015-05-08 17:31:26 +02:00
|
|
|
|
2018-12-08 16:17:25 +01:00
|
|
|
src = fetchFromGitHub {
|
2021-10-09 22:29:09 +02:00
|
|
|
owner = "greatscottgadgets";
|
2018-12-08 16:17:25 +01:00
|
|
|
repo = "hackrf";
|
|
|
|
rev = "v${version}";
|
2021-10-09 22:29:09 +02:00
|
|
|
sha256 = "sha256-2kEfTco95I9YLz/18nfjJSd7U/HE5sBCEioWL2t804k=";
|
2015-05-08 17:31:26 +02:00
|
|
|
};
|
|
|
|
|
2020-04-02 08:14:13 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2021-01-17 03:09:27 +01:00
|
|
|
pkg-config
|
2020-04-02 08:14:13 +02:00
|
|
|
];
|
|
|
|
|
2015-05-08 17:31:26 +02:00
|
|
|
buildInputs = [
|
2020-04-02 08:14:13 +02:00
|
|
|
libusb1
|
|
|
|
fftwSinglePrec
|
2015-05-08 17:31:26 +02:00
|
|
|
];
|
2017-07-26 19:01:42 +02:00
|
|
|
|
2017-07-26 19:11:58 +02:00
|
|
|
cmakeFlags = [ "-DUDEV_RULES_GROUP=plugdev" "-DUDEV_RULES_PATH=lib/udev/rules.d" ];
|
|
|
|
|
2015-05-08 17:31:26 +02:00
|
|
|
preConfigure = ''
|
2017-07-26 19:01:42 +02:00
|
|
|
cd host
|
2015-05-08 17:31:26 +02:00
|
|
|
'';
|
2017-07-26 19:01:42 +02:00
|
|
|
|
2021-10-09 22:29:09 +02:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace host/cmake/modules/FindFFTW.cmake \
|
|
|
|
--replace "find_library (FFTW_LIBRARIES NAMES fftw3)" "find_library (FFTW_LIBRARIES NAMES fftw3f)"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2015-05-08 17:31:26 +02:00
|
|
|
description = "An open source SDR platform";
|
2020-10-02 09:58:50 +02:00
|
|
|
homepage = "https://greatscottgadgets.com/hackrf/";
|
2015-05-08 17:31:26 +02:00
|
|
|
license = licenses.gpl2;
|
2015-10-31 23:47:24 +01:00
|
|
|
platforms = platforms.all;
|
2020-05-09 11:25:07 +02:00
|
|
|
maintainers = with maintainers; [ sjmackenzie ];
|
2015-05-08 17:31:26 +02:00
|
|
|
};
|
|
|
|
}
|