Unverified Commit 930722ac authored by Sizhe Zhao's avatar Sizhe Zhao Committed by GitHub
Browse files

mpvScripts.mpv-cheatsheet-ng: init at 0.1.0 (#490264)

parents 0cf3e9f7 ed0a5a63
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ let
      encode
      seekTo
      ; # added 2024-11-28
    mpv-cheatsheet = throw "'mpv-cheatsheet' is no longer maintained, use 'mpv-cheatsheet-ng' instead"; # added 2026-02-13
    youtube-quality = throw "'youtube-quality' is no longer maintained, use 'quality-menu' instead"; # added 2023-07-14
  };
in
+27 −0
Original line number Diff line number Diff line
{
  lib,
  buildLua,
  fetchFromGitHub,
  gitUpdater,
}:
buildLua (finalAttrs: {
  pname = "mpv-cheatsheet-ng";
  version = "0.1.0";
  scriptPath = "cheatsheet.lua";

  src = fetchFromGitHub {
    owner = "ambroisie";
    repo = "mpv-cheatsheet-ng";
    tag = "v${finalAttrs.version}";
    hash = "sha256-5CVEf5SPNiYaKKp0tn4zhwUvP5R75HU5/B+l8KCXJNg=";
  };

  passthru.updateScript = gitUpdater { rev-prefix = "v"; };

  meta = {
    description = "mpv script for looking up keyboard shortcuts";
    homepage = "https://github.com/ambroisie/mpv-cheatsheet-ng";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.ambroisie ];
  };
})
+0 −46
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  gitUpdater,
  nodePackages,
  stdenvNoCC,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "mpv-cheatsheet";
  version = "0.30.0.2";

  src = fetchFromGitHub {
    owner = "ento";
    repo = "mpv-cheatsheet";
    rev = "v${finalAttrs.version}";
    hash = "sha256-MWK0CYto3zgn3fivmL43tvgZn6XrjPxKLp0lgTFdplM=";
  };
  passthru.updateScript = gitUpdater { rev-prefix = "v"; };

  nativeBuildInputs = [ nodePackages.browserify ];

  buildPhase = ''
    runHook preBuild

    make dist/${finalAttrs.passthru.scriptName}

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    install -D dist/${finalAttrs.passthru.scriptName} $out/share/mpv/scripts/${finalAttrs.passthru.scriptName}

    runHook postInstall
  '';

  passthru.scriptName = "cheatsheet.js";

  meta = {
    description = "mpv script for looking up keyboard shortcuts";
    homepage = "https://github.com/ento/mpv-cheatsheet";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ ambroisie ];
  };
})