10 generic = { version, pname, src, meta }:
12 inherit version pname src;
13 nativeBuildInputs = [ pkg-config cmake ];
14 propagatedBuildInputs = [ libusb1 ];
16 cmakeFlags = lib.optionals stdenv.hostPlatform.isLinux [
17 "-DINSTALL_UDEV_RULES=ON"
22 substituteInPlace CMakeLists.txt \
23 --replace '/etc/udev/rules.d' "$out/etc/udev/rules.d" \
24 --replace "VERSION_INFO_PATCH_VERSION git" "VERSION_INFO_PATCH_VERSION ${lib.versions.patch version}"
26 substituteInPlace rtl-sdr.rules \
27 --replace 'MODE:="0666"' 'ENV{ID_SOFTWARE_RADIO}="1", MODE="0660", GROUP="plugdev"'
31 inherit (meta) longDescription homepage;
32 description = "Software to turn the RTL2832U into a SDR receiver";
33 license = licenses.gpl2Plus;
34 maintainers = with maintainers; [ bjornfor skovati Tungsten842 ];
35 platforms = platforms.unix;
36 mainProgram = "rtl_sdr";
41 rtl-sdr-osmocom = generic rec {
42 pname = "rtl-sdr-osmocom";
45 src = fetchFromGitea {
46 domain = "gitea.osmocom.org";
50 hash = "sha256-+RYSCn+wAkb9e7NRI5kLY8a6OXtJu7QcSUht1R6wDX0=";
53 longDescription = "Rtl-sdr library by the Osmocom project";
54 homepage = "https://gitea.osmocom.org/sdr/rtl-sdr";
58 rtl-sdr-librtlsdr = generic rec {
59 pname = "rtl-sdr-librtlsdr";
62 src = fetchFromGitHub {
66 hash = "sha256-I1rbywQ0ZBw26wZdtMBkfpj7+kv09XKrrcoDuhIkRmw=";
70 Fork of the rtl-sdr library by the Osmocom project. A list of differences
71 can be found here: https://github.com/librtlsdr/librtlsdr/blob/master/README_improvements.md
73 homepage = "https://github.com/librtlsdr/librtlsdr";
77 rtl-sdr-blog = generic rec {
78 pname = "rtl-sdr-blog";
81 src = fetchFromGitHub {
83 repo = "rtl-sdr-blog";
85 hash = "sha256-7FpT+BoQ2U8KiKwX4NfEwrO3lMBti7RX8uKtT5dFH8M=";
89 Fork of the rtl-sdr library by the Osmocom project. A list of differences
90 can be found here: https://github.com/rtlsdrblog/rtl-sdr-blog/blob/master/README
92 homepage = "https://github.com/rtlsdrblog/rtl-sdr-blog";