2021-04-09 08:18:40 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchgit
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, libusb1
|
|
|
|
}:
|
2014-03-07 23:42:42 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "rtl-sdr";
|
2018-10-05 09:11:02 +01:00
|
|
|
version = "0.6.0";
|
2014-03-07 23:42:42 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.osmocom.org/rtl-sdr.git";
|
2018-10-05 09:11:02 +01:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "0lmvsnb4xw4hmz6zs0z5ilsah5hjz29g1s0050n59fllskqr3b8k";
|
2014-03-07 23:42:42 +00:00
|
|
|
};
|
|
|
|
|
2021-04-09 08:18:40 +01: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 00:28:51 +01:00
|
|
|
|
2021-01-17 02:09:27 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
2021-04-09 08:18:40 +01:00
|
|
|
|
2020-03-12 14:15:31 +00:00
|
|
|
buildInputs = [ libusb1 ];
|
2014-03-07 23:42:42 +00:00
|
|
|
|
2021-04-09 08:18:40 +01:00
|
|
|
cmakeFlags = lib.optional stdenv.isLinux "-DINSTALL_UDEV_RULES=ON";
|
2018-12-09 10:18:13 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-03-07 23:42:42 +00:00
|
|
|
description = "Turns your Realtek RTL2832 based DVB dongle into a SDR receiver";
|
2021-04-17 16:59:08 +01:00
|
|
|
homepage = "https://github.com/librtlsdr/librtlsdr";
|
2014-03-07 23:42:42 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2021-04-09 08:18:40 +01:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2017-07-15 01:24:15 +01:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2014-03-07 23:42:42 +00:00
|
|
|
};
|
|
|
|
}
|