summary refs log tree commit diff
path: root/pkgs/development/python-modules/nxt-python/default.nix
blob: fb953bce13ddf402696e299c2fbeba0892e1bf15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, buildPythonPackage
, fetchFromGitHub
, pybluez
, pytestCheckHook
, pythonOlder
, pyusb
}:

buildPythonPackage rec {
  pname = "nxt-python";
  version = "3.2.0";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "schodet";
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-PWeR8xteLMxlOHcJJCtTI0o8QNzwGJVkUACmvf4tXWY=";
  };

  propagatedBuildInputs = [
    pyusb
  ];

  passthru.optional-dependencies = {
    bluetooth = [
      pybluez
    ];
  };

  nativeCheckInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "nxt"
  ];

  meta = with lib; {
    description = "Python driver/interface for Lego Mindstorms NXT robot";
    homepage = "https://github.com/schodet/nxt-python";
    changelog = "https://github.com/schodet/nxt-python/releases/tag/${version}";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ ibizaman ];
  };
}