biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / video / mpv / scripts / cutter.nix
blob69eba782cc1d7397e04ed314b907ca1c00033ef8
1 { lib, buildLua, fetchFromGitHub, makeWrapper, unstableGitUpdater }:
3 buildLua {
4   pname = "video-cutter";
5   version = "unstable-2023-11-09";
7   src = fetchFromGitHub {
8     owner = "rushmj";
9     repo = "mpv-video-cutter";
10     rev = "01a0396c075d5f8bbd1de5b571e6231f8899ab65";
11     sha256 = "sha256-veoRFzUCRH8TrvR7x+WWoycpDyxqrJZ/bnp61dVc0pE=";
12   };
13   passthru.updateScript = unstableGitUpdater {};
15   nativeBuildInputs = [ makeWrapper ];
17   postPatch = ''
18     substituteInPlace cutter.lua \
19       --replace '~/.config/mpv/scripts/c_concat.sh' '${placeholder "out"}/share/mpv/scripts/c_concat.sh'
21     # needs to be ran separately so that we can replace everything, and not every single mention explicitly
22     # original script places them in the scripts folder, just spawning unnecessary errors
23     # i know that hardcoding .config and especially the .mpv directory isn't best practice, but I didn't want to deviate too much from upstream
24     substituteInPlace cutter.lua \
25       --replace '~/.config/mpv/scripts' "''${XDG_CONFIG_HOME:-~/.config}/mpv/cutter"
26   '';
28   passthru.scriptName = "cutter.lua";
29   extraScripts = [ "c_concat.sh" ];
31   postInstall = ''
32     chmod 0755 $out/share/mpv/scripts/c_concat.sh
33     wrapProgram $out/share/mpv/scripts/c_concat.sh \
34       --run "mkdir -p ~/.config/mpv/cutter/"
35   '';
37   meta = with lib; {
38     description = "Cut videos and concat them automatically";
39     homepage = "https://github.com/rushmj/mpv-video-cutter";
40     license = licenses.mit;
41     maintainers = with maintainers; [ lom ];
42   };