about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/rflink/default.nix
blob: 82374a8a0423e0fbffa87e0866a71e69331d49cc (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
50
51
52
53
54
55
56
57
58
59
60
61
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, async-timeout
, docopt
, pyserial
, pyserial-asyncio
, setuptools
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "rflink";
  version = "0.0.58";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "aequitas";
    repo = "python-rflink";
    rev = version;
    sha256 = "1zab55lsw419gg0jfrl69ap6128vbi3wdmg5z7qin65ijpjdhasc";
  };

  propagatedBuildInputs = [
    async-timeout
    docopt
    pyserial
    pyserial-asyncio
    setuptools
  ];

  checkInputs = [
    pytestCheckHook
  ];

  patches = [
    # Remove loop, https://github.com/aequitas/python-rflink/pull/61
    (fetchpatch {
      name = "remove-loop.patch";
      url = "https://github.com/aequitas/python-rflink/commit/777e19b5bde3398df5b8f142896c34a01ae18d52.patch";
      sha256 = "sJmihxY3fNSfZVFhkvQ/+9gysQup/1jklKDMyDDLOs8=";
    })
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "version=version_from_git()" "version='${version}'"
  '';

  pythonImportsCheck = [
    "rflink.protocol"
  ];

  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 ];
  };
}