2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
future,
|
|
|
|
ipython,
|
|
|
|
numpy,
|
|
|
|
pyserial,
|
|
|
|
pyusb,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rfcat";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "2.0.1";
|
2022-08-21 13:32:41 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "atlas0fd00m";
|
|
|
|
repo = "rfcat";
|
2022-08-21 13:32:41 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-hdRsVbDXRC1EOhBoFJ9T5ZE6hwOgDWSdN5sIpxJ0x3E=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
future
|
|
|
|
ipython
|
|
|
|
numpy
|
|
|
|
pyserial
|
|
|
|
pyusb
|
|
|
|
];
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
|
2021-03-09 03:18:52 +00:00
|
|
|
mkdir -p $out/etc/udev/rules.d
|
|
|
|
cp etc/udev/rules.d/20-rfcat.rules $out/etc/udev/rules.d
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "rflib" ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Swiss Army knife of sub-GHz ISM band radio";
|
|
|
|
homepage = "https://github.com/atlas0fd00m/rfcat";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ trepetti ];
|
|
|
|
changelog = "https://github.com/atlas0fd00m/rfcat/releases/tag/v${version}";
|
|
|
|
};
|
|
|
|
}
|