1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 setuptools,
7 pyusb,
8 influxdb-client,
9 pyserial,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "openant-unstable";
15 version = "1.3.1";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "Tigge";
22 repo = "openant";
23 rev = "refs/tags/v${version}";
24 hash = "sha256-wDtHlkVyD7mMDXZ4LGMgatr9sSlQKVbgkYsKvHGr9Pc=";
25 };
26
27 nativeBuildInputs = [ setuptools ];
28
29 postInstall = ''
30 install -dm755 "$out/etc/udev/rules.d"
31 install -m644 resources/42-ant-usb-sticks.rules "$out/etc/udev/rules.d/99-ant-usb-sticks.rules"
32 '';
33
34 propagatedBuildInputs = [ pyusb ];
35
36 passthru.optional-dependencies = {
37 serial = [ pyserial ];
38 influx = [ influxdb-client ];
39 };
40
41 nativeCheckInputs = [ pytestCheckHook ];
42
43 pythonImportsCheck = [ "openant" ];
44
45 meta = with lib; {
46 homepage = "https://github.com/Tigge/openant";
47 description = "ANT and ANT-FS Python Library";
48 mainProgram = "openant";
49 license = licenses.mit;
50 };
51}