1{ lib, stdenv, fetchFromGitHub, fetchpatch
2, doxygen, fontconfig, graphviz-nox, libxml2, pkg-config, which
3, systemd }:
4
5stdenv.mkDerivation rec {
6 pname = "openzwave";
7 version = "1.6";
8
9 src = fetchFromGitHub {
10 owner = "OpenZWave";
11 repo = "open-zwave";
12 rev = "v${version}";
13 sha256 = "0xgs4mmr0480c269wx9xkk67ikjzxkh8xcssrdx0f5xcl1lyd333";
14 };
15
16 patches = [
17 (fetchpatch {
18 name = "fix-strncat-build-failure.patch";
19 url = "https://github.com/OpenZWave/open-zwave/commit/601e5fb16232a7984885e67fdddaf5b9c9dd8105.patch";
20 sha256 = "1n1k5arwk1dyc12xz6xl4n8yw28vghzhv27j65z1nca4zqsxgza1";
21 })
22 (fetchpatch {
23 name = "fix-text-uninitialized.patch";
24 url = "https://github.com/OpenZWave/open-zwave/commit/3b029a467e83bc7f0054e4dbba1e77e6eac7bc7f.patch";
25 sha256 = "183mrzjh1zx2b2wzkj4jisiw8br7g7bbs167afls4li0fm01d638";
26 })
27 ];
28
29 outputs = [ "out" "doc" ];
30
31 nativeBuildInputs = [ doxygen fontconfig graphviz-nox libxml2 pkg-config which ];
32
33 buildInputs = [ systemd ];
34
35 hardeningDisable = [ "format" ];
36
37 enableParallelBuilding = true;
38
39 makeFlags = [
40 "PREFIX=${placeholder "out"}"
41 ];
42
43 FONTCONFIG_FILE="${fontconfig.out}/etc/fonts/fonts.conf";
44 FONTCONFIG_PATH="${fontconfig.out}/etc/fonts/";
45
46 postPatch = ''
47 substituteInPlace cpp/src/Options.cpp \
48 --replace /etc/openzwave $out/etc/openzwave
49 '';
50
51 meta = with lib; {
52 description = "C++ library to control Z-Wave Networks via a USB Z-Wave Controller";
53 homepage = "http://www.openzwave.net/";
54 license = licenses.gpl3;
55 maintainers = with maintainers; [ ];
56 platforms = platforms.linux;
57 };
58}