summary refs log tree commit diff
path: root/pkgs/development/libraries/openzwave/default.nix
blob: 63c51996b227119d7f797d0c3d617e6a08779a78 (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
{ stdenv, fetchFromGitHub
, doxygen, fontconfig, graphviz-nox, libxml2, pkgconfig, which
, systemd }:

let
  version = "2018-04-04";

in stdenv.mkDerivation rec {
  name = "openzwave-${version}";

  src = fetchFromGitHub {
    owner = "OpenZWave";
    repo = "open-zwave";
    rev = "ab5fe966fee882bb9e8d78a91db892a60a1863d9";
    sha256 = "0yby8ygzjn5zp5vhysxaadbzysqanwd2zakz379299qs454pr2h9";
  };

  nativeBuildInputs = [ doxygen fontconfig graphviz-nox libxml2 pkgconfig which ];

  buildInputs = [ systemd ];

  enableParallelBuilding = true;

  installPhase = ''
    runHook preInstall

    DESTDIR=$out PREFIX= pkgconfigdir=lib/pkgconfig make install $installFlags

    runHook postInstall
  '';

  FONTCONFIG_FILE="${fontconfig.out}/etc/fonts/fonts.conf";
  FONTCONFIG_PATH="${fontconfig.out}/etc/fonts/";

  postPatch = ''
    substituteInPlace cpp/src/Options.cpp \
      --replace /etc/openzwave $out/etc/openzwave
  '';

  fixupPhase = ''
    substituteInPlace $out/lib/pkgconfig/libopenzwave.pc \
      --replace prefix= prefix=$out \
      --replace dir=    dir=$out

    substituteInPlace $out/bin/ozw_config \
      --replace pcfile=${pkgconfig} pcfile=$out
  '';

  meta = with stdenv.lib; {
    description = "C++ library to control Z-Wave Networks via a USB Z-Wave Controller";
    homepage = http://www.openzwave.net/;
    license = licenses.gpl3;
    maintainers = with maintainers; [ etu ];
    platforms = platforms.linux;
  };
}