about summary refs log tree commit diff
path: root/pkgs/applications/video/ani-cli/default.nix
blob: 375a930b02940fe3c319a55929975a6b4be4eddd (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
57
58
59
60
61
62
63
{ fetchFromGitHub
, makeWrapper
, stdenvNoCC
, lib
, gnugrep
, gnused
, curl
, catt
, syncplay
, ffmpeg
, fzf
, aria2
, withMpv ? true, mpv
, withVlc ? false, vlc
, withIina ? false, iina
, chromecastSupport ? false
, syncSupport ? false
}:

assert withMpv || withVlc || withIina;

stdenvNoCC.mkDerivation rec {
  pname = "ani-cli";
  version = "4.7";

  src = fetchFromGitHub {
    owner = "pystardust";
    repo = "ani-cli";
    rev = "v${version}";
    hash = "sha256-Ll4bHKrDZukoQX35iiMI6rMSgiTC6wp7fHUnOMPagOA=";
  };

  nativeBuildInputs = [ makeWrapper ];
  runtimeDependencies =
    let player = []
        ++ lib.optional withMpv mpv
        ++ lib.optional withVlc vlc
        ++ lib.optional withIina iina;
    in [ gnugrep gnused curl fzf ffmpeg aria2 ]
      ++ player
      ++ lib.optional chromecastSupport catt
      ++ lib.optional syncSupport syncplay;

  installPhase = ''
    runHook preInstall

    install -Dm755 ani-cli $out/bin/ani-cli

    wrapProgram $out/bin/ani-cli \
      --prefix PATH : ${lib.makeBinPath runtimeDependencies}

    runHook postInstall
  '';

  meta = with lib; {
    homepage = "https://github.com/pystardust/ani-cli";
    description = "A cli tool to browse and play anime";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ skykanin ];
    platforms = platforms.unix;
    mainProgram = "ani-cli";
  };
}