2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchpatch
|
2021-06-28 23:13:55 +00:00
|
|
|
, async-timeout
|
|
|
|
, docopt
|
|
|
|
, pyserial
|
|
|
|
, pyserial-asyncio
|
|
|
|
, setuptools
|
|
|
|
, pytestCheckHook
|
2022-05-18 14:49:53 +00:00
|
|
|
, pythonAtLeast
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rflink";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "0.0.63";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aequitas";
|
|
|
|
repo = "python-rflink";
|
2022-07-14 12:49:19 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "sha256-BNKcXtsBB90KQe4HXmfJ7H3yepk1dEkozSEy5v8KSAA=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/aequitas/python-rflink/pull/70
|
|
|
|
(fetchpatch {
|
|
|
|
name = "python311-compat.patch";
|
|
|
|
url = "https://github.com/aequitas/python-rflink/commit/ba807ddd2fde823b8d50bc50bb500a691d9e331f.patch";
|
|
|
|
hash = "sha256-4Wh7b7j8qsvzYKdFwaY+B5Jd8EkyjAe1awlY0BDu2YA=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
async-timeout
|
|
|
|
docopt
|
|
|
|
pyserial
|
|
|
|
pyserial-asyncio
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
disabledTestPaths = lib.optionals (pythonAtLeast "3.10") [
|
|
|
|
# https://github.com/aequitas/python-rflink/issues/65
|
|
|
|
"tests/test_proxy.py"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "version=version_from_git()" "version='${version}'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"rflink.protocol"
|
|
|
|
];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library and CLI tools for interacting with RFlink 433MHz transceiver";
|
|
|
|
homepage = "https://github.com/aequitas/python-rflink";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|