diff --git a/pkgs/development/python-modules/pyrtlsdr/default.nix b/pkgs/development/python-modules/pyrtlsdr/default.nix new file mode 100644 index 000000000000..4ce373ee7ad2 --- /dev/null +++ b/pkgs/development/python-modules/pyrtlsdr/default.nix @@ -0,0 +1,31 @@ +{ lib +, buildPythonPackage +, fetchPypi +, rtl-sdr +}: + +buildPythonPackage rec { + pname = "pyrtlsdr"; + version = "0.2.5"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "dd041143b68628c713c2227c78c40b0b4a0cb5d08df116f7bdc5f83c529be0e4"; + }; + + 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; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ bjornfor ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3b16bd364449..359e50f0cbf6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8452,26 +8452,7 @@ in { }; - pyrtlsdr = buildPythonPackage rec { - name = "pyrtlsdr-0.2.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/p/pyrtlsdr/${name}.zip"; - sha256 = "cbb9086efe4320858c48f4856d09f7face191c4156510b1459ef4e5588935b6a"; - }; - - postPatch = '' - sed "s|driver_files =.*|driver_files = ['${pkgs.rtl-sdr}/lib/librtlsdr.so']|" -i rtlsdr/librtlsdr.py - ''; - - meta = { - description = "Python wrapper for librtlsdr (a driver for Realtek RTL2832U based SDR's)"; - homepage = https://github.com/roger-/pyrtlsdr; - license = licenses.gpl3; - platforms = platforms.linux; - maintainers = with maintainers; [ bjornfor ]; - }; - }; + pyrtlsdr = callPackage ../development/python-modules/pyrtlsdr { }; random2 = self.buildPythonPackage rec { name = "random2-1.0.1";