about summary refs log tree commit diff
path: root/pkgs/applications/video
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-01-17 13:42:05 +0100
committerGitHub <noreply@github.com>2021-01-17 13:42:05 +0100
commitec64627b97a65213d11b05801e4cb08cdf4d158e (patch)
treef7ca87e3044528cbd0a18219100b445c2dfe46bf /pkgs/applications/video
parent2964ee515be02e1709116644ce995b778250cd14 (diff)
parent6960160acb50275fa8d343243bd9ee4cd78c90e8 (diff)
downloadnixlib-ec64627b97a65213d11b05801e4cb08cdf4d158e.tar
nixlib-ec64627b97a65213d11b05801e4cb08cdf4d158e.tar.gz
nixlib-ec64627b97a65213d11b05801e4cb08cdf4d158e.tar.bz2
nixlib-ec64627b97a65213d11b05801e4cb08cdf4d158e.tar.lz
nixlib-ec64627b97a65213d11b05801e4cb08cdf4d158e.tar.xz
nixlib-ec64627b97a65213d11b05801e4cb08cdf4d158e.tar.zst
nixlib-ec64627b97a65213d11b05801e4cb08cdf4d158e.zip
Merge pull request #109545 from kmicklas/mpvacious
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/mpv/scripts/mpvacious.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/applications/video/mpv/scripts/mpvacious.nix b/pkgs/applications/video/mpv/scripts/mpvacious.nix
new file mode 100644
index 000000000000..5bfcd2ac32c0
--- /dev/null
+++ b/pkgs/applications/video/mpv/scripts/mpvacious.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, curl, xclip }:
+
+stdenv.mkDerivation rec {
+  pname = "mpvacious";
+  version = "0.12";
+
+  src = fetchFromGitHub {
+    owner = "Ajatt-Tools";
+    repo = "mpvacious";
+    rev = "v${version}";
+    sha256 = "1xz4qh2ibfv03m3pfdasim9byvlm78wigx1linmih19vgg99vky2";
+  };
+
+  postPatch = ''
+    substituteInPlace subs2srs.lua \
+      --replace "'curl'" "'${curl}/bin/curl'" \
+      --replace "xclip" "${xclip}/bin/xclip"
+  '';
+
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/share/mpv/scripts
+    cp subs2srs.lua $out/share/mpv/scripts
+    runHook postInstall
+  '';
+
+  passthru.scriptName = "subs2srs.lua";
+
+  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 ];
+  };
+}