1{ lib
2, buildPythonPackage
3, dotmap
4, fetchPypi
5, pexpect
6, protobuf
7, pygatt
8, pypubsub
9, pyqrcode
10, pyserial
11, pythonOlder
12, tabulate
13, timeago
14}:
15
16buildPythonPackage rec {
17 pname = "meshtastic";
18 version = "1.2.40";
19 disabled = pythonOlder "3.6";
20
21 src = fetchPypi {
22 inherit pname version;
23 sha256 = "be8464037d0c8085350065b38e7a7b028db15f2524764dec0e3548ea5b53500f";
24 };
25
26 propagatedBuildInputs = [
27 dotmap
28 pexpect
29 protobuf
30 pygatt
31 pypubsub
32 pyqrcode
33 pyserial
34 tabulate
35 timeago
36 ];
37
38 postPatch = ''
39 # https://github.com/meshtastic/Meshtastic-python/pull/87
40 substituteInPlace setup.py \
41 --replace 'with open("README.md", "r") as fh:' "" \
42 --replace "long_description = fh.read()" "" \
43 --replace "long_description=long_description," 'long_description="",'
44 '';
45
46 # Project only provides PyPI releases which don't contain the tests
47 # https://github.com/meshtastic/Meshtastic-python/issues/86
48 doCheck = false;
49 pythonImportsCheck = [ "meshtastic" ];
50
51 meta = with lib; {
52 description = "Python API for talking to Meshtastic devices";
53 homepage = "https://meshtastic.github.io/Meshtastic-python/";
54 license = with licenses; [ asl20 ];
55 maintainers = with maintainers; [ fab ];
56 };
57}