summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/rpi/433Utils/default.nix
blob: 136e3dbca402a81e258418e067912ec403303eef (plain)
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
{ fetchFromGitHub, lib, stdenv
, wiringPi ? WiringPi.wiringPi
, wiringPiDev ? WiringPi.wiringPiDev
, WiringPi ? rpiPackages.WiringPi
, rpiPackages
}:

stdenv.mkDerivation {
  pname = "433Utils-RPi_utils";
  version = "2018-06-07";

  src = fetchFromGitHub (lib.importJSON ./src.json);

  patches = [
    ./rc-switch.protocols.patch
    ./RPi_utils.codesend.codestring.patch
  ];

  buildPhase = ''
    runHook postBuild

    make -C RPi_utils

    runHook preBuild
  '';

  buildInputs = [
    wiringPi
    wiringPiDev
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    for name in send codesend RFSniffer; do
      cp RPi_utils/$name $out/bin/
    done

    runHook postInstall
  '';
}