monitorcontrol: 4.2.0 → 4.3.3 (#375061)
[NixPkgs.git] / pkgs / applications / video / mpv / scripts / autosubsync-mpv.nix
blobd162da18c018a184fd0eb72f4c6ba468c0ee9864
2   lib,
3   fetchFromGitHub,
4   buildLua,
5   alass,
6 }:
8 buildLua {
9   pname = "autosubsync-mpv";
10   version = "0-unstable-2022-12-26";
12   src = fetchFromGitHub {
13     owner = "joaquintorres";
14     repo = "autosubsync-mpv";
15     rev = "22cb928ecd94cc8cadaf8c354438123c43e0c70d";
16     sha256 = "sha256-XQPFC7l9MTZAW5FfULRQJfu/7FuGj9bbjQUZhNv0rlc=";
17   };
19   # While nixpkgs only packages alass, we might as well make that the default
20   patchPhase = ''
21     runHook prePatch
22     substituteInPlace autosubsync.lua                                            \
23       --replace-warn 'alass_path = ""' 'alass_path = "${alass}/bin/alass-cli"'   \
24       --replace-warn 'audio_subsync_tool = "ask"' 'audio_subsync_tool = "alass"' \
25       --replace-warn 'altsub_subsync_tool = "ask"' 'altsub_subsync_tool = "alass"'
26     runHook postPatch
27   '';
29   scriptPath = "./";
30   passthru.scriptName = "autosubsync-mpv";
32   meta = with lib; {
33     description = "Automatically sync subtitles in mpv using the `n` button";
34     homepage = "https://github.com/joaquintorres/autosubsync-mpv";
35     maintainers = with maintainers; [ kovirobi ];
36     license = licenses.mit;
37   };