2021-04-17 00:35:05 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2024-04-21 15:54:59 +00:00
|
|
|
, fetchFromGitea
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchFromGitHub
|
2021-04-17 00:35:05 +00:00
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, libusb1
|
|
|
|
}:
|
2024-04-21 15:54:59 +00:00
|
|
|
let
|
|
|
|
generic = { version, pname, src, meta }:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit version pname src;
|
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
|
|
|
propagatedBuildInputs = [ libusb1 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
cmakeFlags = lib.optionals stdenv.hostPlatform.isLinux [
|
2024-04-21 15:54:59 +00:00
|
|
|
"-DINSTALL_UDEV_RULES=ON"
|
|
|
|
"-DWITH_RPC=ON"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace '/etc/udev/rules.d' "$out/etc/udev/rules.d" \
|
|
|
|
--replace "VERSION_INFO_PATCH_VERSION git" "VERSION_INFO_PATCH_VERSION ${lib.versions.patch version}"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
substituteInPlace rtl-sdr.rules \
|
|
|
|
--replace 'MODE:="0666"' 'ENV{ID_SOFTWARE_RADIO}="1", MODE="0660", GROUP="plugdev"'
|
|
|
|
'';
|
2021-04-17 00:35:05 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
meta = with lib; {
|
|
|
|
inherit (meta) longDescription homepage;
|
|
|
|
description = "Software to turn the RTL2832U into a SDR receiver";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ bjornfor skovati Tungsten842 ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
mainProgram = "rtl_sdr";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
rtl-sdr-osmocom = generic rec {
|
|
|
|
pname = "rtl-sdr-osmocom";
|
|
|
|
version = "2.0.1";
|
2020-10-27 00:29:36 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
src = fetchFromGitea {
|
|
|
|
domain = "gitea.osmocom.org";
|
|
|
|
owner = "sdr";
|
|
|
|
repo = "rtl-sdr";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-+RYSCn+wAkb9e7NRI5kLY8a6OXtJu7QcSUht1R6wDX0=";
|
|
|
|
};
|
|
|
|
meta = {
|
|
|
|
longDescription = "Rtl-sdr library by the Osmocom project";
|
|
|
|
homepage = "https://gitea.osmocom.org/sdr/rtl-sdr";
|
|
|
|
};
|
|
|
|
};
|
2021-04-17 00:35:05 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
rtl-sdr-librtlsdr = generic rec {
|
|
|
|
pname = "rtl-sdr-librtlsdr";
|
|
|
|
version = "0.9.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "librtlsdr";
|
|
|
|
repo = "librtlsdr";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-I1rbywQ0ZBw26wZdtMBkfpj7+kv09XKrrcoDuhIkRmw=";
|
|
|
|
};
|
|
|
|
meta = {
|
|
|
|
longDescription = ''
|
|
|
|
Fork of the rtl-sdr library by the Osmocom project. A list of differences
|
|
|
|
can be found here: https://github.com/librtlsdr/librtlsdr/blob/master/README_improvements.md
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/librtlsdr/librtlsdr";
|
|
|
|
};
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
rtl-sdr-blog = generic rec {
|
|
|
|
pname = "rtl-sdr-blog";
|
|
|
|
version = "1.3.5";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rtlsdrblog";
|
|
|
|
repo = "rtl-sdr-blog";
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-7FpT+BoQ2U8KiKwX4NfEwrO3lMBti7RX8uKtT5dFH8M=";
|
|
|
|
};
|
|
|
|
meta = {
|
|
|
|
longDescription = ''
|
|
|
|
Fork of the rtl-sdr library by the Osmocom project. A list of differences
|
|
|
|
can be found here: https://github.com/rtlsdrblog/rtl-sdr-blog/blob/master/README
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/rtlsdrblog/rtl-sdr-blog";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|