depot/third_party/nixpkgs/pkgs/applications/video/ani-cli/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

63 lines
1.3 KiB
Nix

{ 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.8";
src = fetchFromGitHub {
owner = "pystardust";
repo = "ani-cli";
rev = "v${version}";
hash = "sha256-vntCiWaONndjU622c1BoCoASQxQf/i7yO0x+70OxzPU=";
};
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 = "Cli tool to browse and play anime";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ skykanin ];
platforms = platforms.unix;
mainProgram = "ani-cli";
};
}