2022-01-07 04:07:37 +00:00
|
|
|
{ lib
|
2024-01-02 11:29:13 +00:00
|
|
|
, buildLua
|
2022-01-07 04:07:37 +00:00
|
|
|
, fetchFromGitHub
|
2024-01-13 08:15:51 +00:00
|
|
|
, gitUpdater
|
2022-01-07 04:07:37 +00:00
|
|
|
, curl
|
|
|
|
, wl-clipboard
|
|
|
|
, xclip
|
|
|
|
}:
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
buildLua rec {
|
2021-02-05 17:12:51 +00:00
|
|
|
pname = "mpvacious";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.25";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Ajatt-Tools";
|
|
|
|
repo = "mpvacious";
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
sha256 = "sha256-XTnib4cguWFEvZtmsLfkesbjFbkt2YoyYLT587ajyUM=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
passthru.updateScript = gitUpdater {
|
|
|
|
rev-prefix = "v";
|
|
|
|
};
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2022-09-09 14:08:57 +00:00
|
|
|
substituteInPlace utils/forvo.lua \
|
|
|
|
--replace "'curl" "'${curl}/bin/curl"
|
|
|
|
substituteInPlace platform/nix.lua \
|
|
|
|
--replace "'curl" "'${curl}/bin/curl" \
|
|
|
|
--replace "'wl-copy" "'${wl-clipboard}/bin/wl-copy" \
|
|
|
|
--replace "'xclip" "'${xclip}/bin/xclip"
|
2021-02-05 17:12:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2024-01-02 11:29:13 +00:00
|
|
|
make PREFIX=$out/share/mpv install
|
2021-02-05 17:12:51 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
passthru.scriptName = "mpvacious";
|
2021-02-05 17:12:51 +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;
|
|
|
|
maintainers = with maintainers; [ kmicklas ];
|
|
|
|
};
|
|
|
|
}
|