2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchgit, lib
|
|
|
|
, yad, mkvtoolnix-cli, libnotify }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2020-05-15 21:57:56 +00:00
|
|
|
pname = "mpv-convert-script";
|
|
|
|
version = "2016-03-18";
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://gist.github.com/Zehkul/25ea7ae77b30af959be0";
|
|
|
|
rev = "f95cee43e390e843a47e8ec9d1711a12a8cd343d";
|
|
|
|
sha256 = "13m7l4sy2r8jv2sfrb3vvqvnim4a9ilnv28q5drlg09v298z3mck";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./convert.patch ];
|
|
|
|
|
|
|
|
postPatch =
|
|
|
|
let
|
|
|
|
t = k: v: '' 'local ${k} = "${v}"' '';
|
|
|
|
subs = var: orig: repl: "--replace " + t var orig + t var repl;
|
|
|
|
in ''
|
|
|
|
substituteInPlace convert_script.lua \
|
|
|
|
${subs "NOTIFY_CMD" "notify-send" "${libnotify}/bin/notify-send"} \
|
|
|
|
${subs "YAD_CMD" "yad" "${yad}/bin/yad"} \
|
|
|
|
${subs "MKVMERGE_CMD" "mkvmerge" "${mkvtoolnix-cli}/bin/mkvmerge"}
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
2020-05-15 21:57:56 +00:00
|
|
|
mkdir -p $out/share/mpv/scripts
|
|
|
|
cp convert_script.lua $out/share/mpv/scripts
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2020-05-15 21:57:56 +00:00
|
|
|
passthru.scriptName = "convert_script.lua";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Convert parts of a video while you are watching it in mpv";
|
|
|
|
homepage = "https://gist.github.com/Zehkul/25ea7ae77b30af959be0";
|
|
|
|
maintainers = [ lib.maintainers.Profpatsch ];
|
|
|
|
longDescription = ''
|
|
|
|
When this script is loaded into mpv, you can hit Alt+W to mark the beginning
|
|
|
|
and Alt+W again to mark the end of the clip. Then a settings window opens.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|