1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 isPy3k,
6 pkg-config,
7 systemd,
8 libyaml,
9 openzwave,
10 cython,
11 pyserial,
12 six,
13 pydispatcher,
14 urwid,
15}:
16
17buildPythonPackage rec {
18 pname = "python-openzwave";
19 version = "0.4.19";
20 format = "setuptools";
21
22 disabled = !isPy3k;
23
24 src = fetchPypi {
25 pname = "python_openzwave";
26 inherit version;
27 sha256 = "6b40c7711383eeb3535cf5504f1cf47cc1ac7018eb820f299642a5a2795aef84";
28 extension = "zip";
29 };
30
31 nativeBuildInputs = [ pkg-config ];
32 buildInputs = [
33 systemd
34 libyaml
35 openzwave
36 cython
37 ];
38 propagatedBuildInputs = [
39 six
40 urwid
41 pydispatcher
42 pyserial
43 ];
44
45 # primary location for the .xml files is in /etc/openzwave so we override the
46 # /usr/local/etc lookup instead as that allows us to dump new .xml files into
47 # /etc/openzwave if needed
48 postPatch = ''
49 substituteInPlace src-lib/libopenzwave/libopenzwave.pyx \
50 --replace /usr/local/etc/openzwave ${openzwave}/etc/openzwave
51 '';
52
53 patches = [ ./cython.patch ];
54
55 # no tests available
56 doCheck = false;
57
58 meta = with lib; {
59 description = "Python wrapper for the OpenZWave C++ library";
60 homepage = "https://github.com/OpenZWave/python-openzwave";
61 license = licenses.gpl3Plus;
62 maintainers = [ ];
63 inherit (openzwave.meta) platforms;
64 };
65}