2021-04-09 10:18:40 +03:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-04-29 11:40:43 +03:00
|
|
|
, fetchFromGitHub
|
2021-04-09 10:18:40 +03:00
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, libusb1
|
|
|
|
}:
|
2014-03-08 03:42:42 +04:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "rtl-sdr";
|
2022-04-29 11:40:43 +03:00
|
|
|
version = "0.8.0";
|
2014-03-08 03:42:42 +04:00
|
|
|
|
2022-04-29 11:40:43 +03:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "librtlsdr";
|
|
|
|
repo = "librtlsdr";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1fgxlkgmdchbrf0nn98ivjr6css5hak3608nr4xrf2qzf7xy2kdk";
|
2014-03-08 03:42:42 +04:00
|
|
|
};
|
|
|
|
|
2021-04-09 10:18:40 +03:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace '/etc/udev/rules.d' "$out/etc/udev/rules.d"
|
|
|
|
|
|
|
|
substituteInPlace rtl-sdr.rules \
|
|
|
|
--replace 'MODE:="0666"' 'ENV{ID_SOFTWARE_RADIO}="1", MODE="0660", GROUP="plugdev"'
|
|
|
|
'';
|
2020-08-29 02:28:51 +03:00
|
|
|
|
2021-01-17 05:09:27 +03:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
2021-04-09 10:18:40 +03:00
|
|
|
|
2020-03-12 17:15:31 +03:00
|
|
|
buildInputs = [ libusb1 ];
|
2014-03-08 03:42:42 +04:00
|
|
|
|
2022-10-06 19:38:53 +03:00
|
|
|
cmakeFlags = lib.optionals stdenv.isLinux [
|
2022-04-29 11:40:43 +03:00
|
|
|
"-DINSTALL_UDEV_RULES=ON"
|
|
|
|
"-DWITH_RPC=ON"
|
|
|
|
];
|
2018-12-09 13:18:13 +03:00
|
|
|
|
2021-01-11 10:54:33 +03:00
|
|
|
meta = with lib; {
|
2014-03-08 03:42:42 +04:00
|
|
|
description = "Turns your Realtek RTL2832 based DVB dongle into a SDR receiver";
|
2021-04-17 18:59:08 +03:00
|
|
|
homepage = "https://github.com/librtlsdr/librtlsdr";
|
2014-03-08 03:42:42 +04:00
|
|
|
license = licenses.gpl2Plus;
|
2021-04-09 10:18:40 +03:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2017-07-15 03:24:15 +03:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2014-03-08 03:42:42 +04:00
|
|
|
};
|
|
|
|
}
|