2021-03-15 08:37:03 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, qt5
|
|
|
|
, gnuradio3_8Minimal
|
2021-10-28 06:52:43 +00:00
|
|
|
, thrift
|
2021-03-15 08:37:03 +00:00
|
|
|
, log4cpp
|
|
|
|
, mpir
|
|
|
|
, fftwFloat
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib
|
2021-03-15 08:37:03 +00:00
|
|
|
, libjack2
|
2020-04-24 23:36:52 +00:00
|
|
|
# drivers (optional):
|
2021-03-15 08:37:03 +00:00
|
|
|
, rtl-sdr
|
|
|
|
, hackrf
|
2020-04-24 23:36:52 +00:00
|
|
|
, pulseaudioSupport ? true, libpulseaudio
|
2021-12-06 16:07:01 +00:00
|
|
|
, portaudioSupport ? false, portaudio
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert pulseaudioSupport -> libpulseaudio != null;
|
2021-12-06 16:07:01 +00:00
|
|
|
assert portaudioSupport -> portaudio != null;
|
|
|
|
# audio backends are mutually exclusive
|
|
|
|
assert !(pulseaudioSupport && portaudioSupport);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
gnuradio3_8Minimal.pkgs.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gqrx";
|
2022-01-03 16:56:52 +00:00
|
|
|
version = "2.15.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-12-19 01:06:50 +00:00
|
|
|
owner = "gqrx-sdr";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "gqrx";
|
|
|
|
rev = "v${version}";
|
2022-01-03 16:56:52 +00:00
|
|
|
sha256 = "sha256-OL83l3A27rggfGbfLT1CUaPAQHEKXgoGS1jYJZ9eHPQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
qt5.wrapQtAppsHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-03-15 08:37:03 +00:00
|
|
|
log4cpp
|
|
|
|
mpir
|
|
|
|
fftwFloat
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2021-03-15 08:37:03 +00:00
|
|
|
libjack2
|
|
|
|
gnuradio3_8Minimal.unwrapped.boost
|
|
|
|
qt5.qtbase
|
|
|
|
qt5.qtsvg
|
|
|
|
gnuradio3_8Minimal.pkgs.osmosdr
|
|
|
|
rtl-sdr
|
|
|
|
hackrf
|
2021-10-28 06:52:43 +00:00
|
|
|
] ++ lib.optionals (gnuradio3_8Minimal.hasFeature "gr-ctrlport") [
|
|
|
|
thrift
|
|
|
|
gnuradio3_8Minimal.unwrapped.python.pkgs.thrift
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals pulseaudioSupport [ libpulseaudio ]
|
|
|
|
++ lib.optionals portaudioSupport [ portaudio ];
|
|
|
|
|
|
|
|
cmakeFlags =
|
|
|
|
let
|
|
|
|
audioBackend =
|
|
|
|
if pulseaudioSupport
|
|
|
|
then "Pulseaudio"
|
|
|
|
else if portaudioSupport
|
|
|
|
then "Portaudio"
|
|
|
|
else "Gr-audio";
|
|
|
|
in [
|
|
|
|
"-DLINUX_AUDIO_BACKEND=${audioBackend}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -vD $src/gqrx.desktop -t "$out/share/applications/"
|
2020-12-25 13:55:36 +00:00
|
|
|
install -vD $src/resources/icons/gqrx.svg -t "$out/share/pixmaps/"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Software defined radio (SDR) receiver";
|
|
|
|
longDescription = ''
|
|
|
|
Gqrx is a software defined radio receiver powered by GNU Radio and the Qt
|
|
|
|
GUI toolkit. It can process I/Q data from many types of input devices,
|
|
|
|
including Funcube Dongle Pro/Pro+, rtl-sdr, HackRF, and Universal
|
|
|
|
Software Radio Peripheral (USRP) devices.
|
|
|
|
'';
|
|
|
|
homepage = "https://gqrx.dk/";
|
|
|
|
# Some of the code comes from the Cutesdr project, with a BSD license, but
|
|
|
|
# it's currently unknown which version of the BSD license that is.
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux; # should work on Darwin / macOS too
|
2020-05-15 21:57:56 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor fpletz ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|