2021-04-17 00:35:05 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchgit
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, libusb1
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rtl-sdr";
|
|
|
|
version = "0.6.0";
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.osmocom.org/rtl-sdr.git";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "0lmvsnb4xw4hmz6zs0z5ilsah5hjz29g1s0050n59fllskqr3b8k";
|
|
|
|
};
|
|
|
|
|
2021-04-17 00:35:05 +00: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-10-27 00:29:36 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
2021-04-17 00:35:05 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libusb1 ];
|
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
cmakeFlags = lib.optional stdenv.isLinux "-DINSTALL_UDEV_RULES=ON";
|
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 = "Turns your Realtek RTL2832 based DVB dongle into a SDR receiver";
|
2021-04-17 00:35:05 +00:00
|
|
|
homepage = "http://github.com/librtlsdr/librtlsdr";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2021-04-17 00:35:05 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|