depot/third_party/nixpkgs/pkgs/development/python-modules/pyrtlsdr/default.nix
Default email d5f4a57cbf Project import generated by Copybara.
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
2023-08-10 09:59:29 +02:00

41 lines
934 B
Nix

{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, rtl-sdr
, setuptools
, pythonOlder
}:
buildPythonPackage rec {
pname = "pyrtlsdr";
version = "0.3.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-+z5YO6BzuGHo4LxeYvZvBzZekUf102SR3krWLyPkU2I=";
};
propagatedBuildInputs = [
setuptools
];
postPatch = ''
sed "s|driver_files =.*|driver_files = ['${rtl-sdr}/lib/librtlsdr.so']|" -i rtlsdr/librtlsdr.py
'';
# No tests that can be used.
doCheck = false;
meta = with lib; {
description = "Python wrapper for librtlsdr (a driver for Realtek RTL2832U based SDR's)";
homepage = "https://github.com/roger-/pyrtlsdr";
changelog = "https://github.com/pyrtlsdr/pyrtlsdr/releases/tag/v${version}";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ bjornfor ];
};
}