nixpkgs/pkgs/applications/video/mpv/scripts/mpvacious.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.3 KiB
Nix
Raw Normal View History

2021-09-28 19:33:25 +00:00
{ lib
, stdenvNoCC
, fetchFromGitHub
, curl
, wl-clipboard
, xclip
}:
2021-01-16 16:01:38 +00:00
stdenvNoCC.mkDerivation rec {
2021-01-16 16:01:38 +00:00
pname = "mpvacious";
2021-09-28 19:33:25 +00:00
version = "0.15";
2021-01-16 16:01:38 +00:00
src = fetchFromGitHub {
owner = "Ajatt-Tools";
repo = "mpvacious";
rev = "v${version}";
2021-09-28 19:33:25 +00:00
sha256 = "1lxlgbjk4x3skg5s7kkr9llcdlmpmabfrcslwhhz5f4j3bq7498w";
2021-01-16 16:01:38 +00:00
};
postPatch = ''
2021-09-28 19:33:25 +00:00
# 'require' replaced with 'dofile' to work around
# https://github.com/mpv-player/mpv/issues/7399 until fixed in mpvacious
2021-01-16 16:01:38 +00:00
substituteInPlace subs2srs.lua \
2021-09-28 19:33:25 +00:00
--replace "require('osd_styler')" "dofile('"$out/share/mpv/scripts/mpvacious/osd_styler.lua"')" \
2021-01-16 16:01:38 +00:00
--replace "'curl'" "'${curl}/bin/curl'" \
2021-09-28 19:33:25 +00:00
--replace "'wl-copy'" "'${wl-clipboard}/bin/wl-copy'" \
2021-01-16 16:01:38 +00:00
--replace "xclip" "${xclip}/bin/xclip"
'';
dontBuild = true;
installPhase = ''
runHook preInstall
2021-09-28 19:33:25 +00:00
mkdir -p $out/share/mpv/scripts/mpvacious
cp *.lua $out/share/mpv/scripts/mpvacious
2021-01-16 16:01:38 +00:00
runHook postInstall
'';
2021-09-28 19:33:25 +00:00
passthru.scriptName = "mpvacious/subs2srs.lua";
2021-01-16 16:01:38 +00:00
meta = with lib; {
description = "Adds mpv keybindings to create Anki cards from movies and TV shows";
homepage = "https://github.com/Ajatt-Tools/mpvacious";
license = licenses.gpl3Plus;
platforms = platforms.all;
maintainers = with maintainers; [ kmicklas ];
};
}