1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 future,
7 ipython,
8 numpy,
9 pyserial,
10 pyusb,
11 pytestCheckHook,
12 pythonOlder,
13 udevCheckHook,
14}:
15
16buildPythonPackage rec {
17 pname = "rfcat";
18 version = "2.0.1";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "atlas0fd00m";
25 repo = "rfcat";
26 tag = "v${version}";
27 hash = "sha256-hdRsVbDXRC1EOhBoFJ9T5ZE6hwOgDWSdN5sIpxJ0x3E=";
28 };
29
30 propagatedBuildInputs = [
31 future
32 ipython
33 numpy
34 pyserial
35 pyusb
36 ];
37
38 nativeBuildInputs = [
39 udevCheckHook
40 ];
41
42 postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
43 mkdir -p $out/etc/udev/rules.d
44 cp etc/udev/rules.d/20-rfcat.rules $out/etc/udev/rules.d
45 '';
46
47 nativeCheckInputs = [ pytestCheckHook ];
48
49 pythonImportsCheck = [ "rflib" ];
50
51 meta = with lib; {
52 description = "Swiss Army knife of sub-GHz ISM band radio";
53 homepage = "https://github.com/atlas0fd00m/rfcat";
54 license = licenses.bsd3;
55 maintainers = with maintainers; [ trepetti ];
56 changelog = "https://github.com/atlas0fd00m/rfcat/releases/tag/v${version}";
57 };
58}