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