summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ko/kodi-cli/package.nix
blob: ae403df42e869ef487c5bf41c1d501ce6fc9f052 (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
43
44
45
46
47
48
49
50
51
52
53
54
{
  lib,
  stdenv,
  fetchFromGitHub,
  makeWrapper,
  curl,
  bash,
  jq,
  youtube-dl,
  zenity,
}:

stdenv.mkDerivation rec {
  pname = "kodi-cli";
  version = "1.1.1";

  src = fetchFromGitHub {
    owner = "nawar";
    repo = "kodi-cli";
    rev = version;
    sha256 = "0f9wdq2fg8hlpk3qbjfkb3imprxkvdrhxfkcvr3dwfma0j2yfwam";
  };

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    mkdir -p $out/bin
    cp -a kodi-cli $out/bin
    wrapProgram $out/bin/kodi-cli --prefix PATH : ${
      lib.makeBinPath [
        curl
        bash
      ]
    }
    cp -a playlist_to_kodi $out/bin
    wrapProgram $out/bin/playlist_to_kodi --prefix PATH : ${
      lib.makeBinPath [
        curl
        bash
        zenity
        jq
        youtube-dl
      ]
    }
  '';

  meta = {
    homepage = "https://github.com/nawar/kodi-cli";
    description = "Kodi/XBMC bash script to send Kodi commands using JSON RPC. It also allows sending YouTube videos to Kodi";
    license = lib.licenses.gpl2Only;
    platforms = lib.platforms.unix;
    maintainers = [ lib.maintainers.pstn ];
  };
}