nixpkgs/pkgs/applications/radio/rtl-sdr/default.nix

41 lines
1,009 B
Nix
Raw Normal View History

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