Unverified Commit 4a7f3ac4 authored by nicoo's avatar nicoo Committed by GitHub
Browse files

mpvScripts: smart{skip,-copy-paste-2} → eisa01.* (#388497)

parents c23bd36c b077ad8b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -101,6 +101,10 @@ let
      autodeint
      autoload
      ; # added 2024-11-28
    inherit (self.eisa01)
      smart-copy-paste-2
      smartskip
      ; # added 2025-03-09
    inherit (self.occivink)
      blacklistExtensions
      crop
+65 −0
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  unstableGitUpdater,
  buildLua,
  xclip,
}:

let
  mkScript =
    pname: args:
    let
      self = {
        inherit pname;
        version = "0-unstable-2023-11-25";

        src = fetchFromGitHub {
          owner = "Eisa01";
          repo = "mpv-scripts";
          rev = "48d68283cea47ff8e904decc9003b3abc3e2123e";
          hash = "sha256-edJfotlC5T8asqPIygR67BEWjP4i54Wx54StLfjpc48=";
          # avoid downloading screenshots and videos
          sparseCheckout = [
            "scripts/"
            "script-opts/"
          ];
        };
        passthru.updateScript = unstableGitUpdater { };

        meta = with lib; {
          homepage = "https://github.com/Eisa01/mpv-scripts";
          license = licenses.bsd2;
        };

        # Sadly needed to make `common-updaters` work here
        pos = builtins.unsafeGetAttrPos "version" self;
      };
    in
    buildLua (lib.attrsets.recursiveUpdate self args);
in
lib.recurseIntoAttrs (
  lib.mapAttrs (name: lib.makeOverridable (mkScript name)) {

    # Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.seekTo ]; }`
    smart-copy-paste-2 = {
      scriptPath = "scripts/SmartCopyPaste_II.lua";
      prePatch = ''
        substituteInPlace $scriptPath --replace-fail 'xclip' "${lib.getExe xclip}"
      '';

      meta = {
        description = "Smart copy paste with logging and clipboard support";
        maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
      };
    };

    smartskip = {
      scriptPath = "scripts/SmartSkip.lua";
      meta = {
        description = "Automatically or manually skip opening, intro, outro, and preview";
        maintainers = with lib.maintainers; [ iynaix ];
      };
    };
  }
)
+0 −33
Original line number Diff line number Diff line
{
  lib,
  buildLua,
  fetchFromGitHub,
  unstableGitUpdater,
  xclip,
}:
buildLua (finalAttrs: {
  pname = "smart-copy-paste-2";
  version = "0-unstable-2023-11-25";

  scriptPath = "scripts/SmartCopyPaste_II.lua";
  src = fetchFromGitHub {
    owner = "Eisa01";
    repo = "mpv-scripts";
    rev = "48d68283cea47ff8e904decc9003b3abc3e2123e";
    hash = "sha256-95CAKjBRELX2f7oWSHFWJnI0mikAoxhfUphe9k51Qf4=";
  };

  prePatch = ''
    substituteInPlace scripts/SmartCopyPaste_II.lua \
      --replace-fail 'xclip' "${lib.getExe xclip}"
  '';

  passthru.updateScript = unstableGitUpdater { };

  meta = with lib; {
    description = "Smart copy paste with logging and clipboard support";
    homepage = "https://github.com/Eisa01/mpv-scripts";
    license = licenses.bsd2;
    maintainers = with maintainers; [ luftmensch-luftmensch ];
  };
})
+0 −28
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  unstableGitUpdater,
  buildLua,
}:

buildLua {
  pname = "smartskip";
  version = "0-unstable-2023-11-25";

  scriptPath = "scripts/SmartSkip.lua";
  src = fetchFromGitHub {
    owner = "Eisa01";
    repo = "mpv-scripts";
    rev = "48d68283cea47ff8e904decc9003b3abc3e2123e";
    hash = "sha256-95CAKjBRELX2f7oWSHFWJnI0mikAoxhfUphe9k51Qf4=";
  };

  passthru.updateScript = unstableGitUpdater { };

  meta = {
    description = "Automatically or manually skip opening, intro, outro, and preview";
    homepage = "https://github.com/Eisa01/mpv-scripts";
    license = lib.licenses.bsd2;
    maintainers = [ lib.maintainers.iynaix ];
  };
}