Commit 19f0a78c authored by apfelkuchen06's avatar apfelkuchen06
Browse files

mpvScripts.uosc: init at 4.6.0

parent 481f02f7
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
{ stdenvNoCC, lib, fetchFromGitHub, makeFontsConf }:

stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "uosc";
  version = "4.6.0";

  src = fetchFromGitHub {
    owner = "tomasklaen";
    repo = "uosc";
    rev = finalAttrs.version;
    hash = "sha256-AxApKlSaRLPl6VsXsARfaT3kWDK6AB2AAEmIHYiuFaM=";
  };

  postPatch = ''
    substituteInPlace scripts/uosc.lua \
      --replace "mp.find_config_file('scripts')" "\"$out/share/mpv/scripts\""
  '';

  dontBuild = true;

  installPhase = ''
    runHook preInstall

    mkdir -p $out/share/mpv/
    cp -r scripts $out/share/mpv
    cp -r fonts $out/share

    runHook postInstall
  '';

  passthru.scriptName = "uosc.lua";
  # the script uses custom "texture" fonts as the background for ui elements.
  # In order for mpv to find them, we need to adjust the fontconfig search path.
  passthru.extraWrapperArgs = [
    "--set"
    "FONTCONFIG_FILE"
    (toString (makeFontsConf {
      fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ];
    }))
  ];

  meta = with lib; {
    description = "Feature-rich minimalist proximity-based UI for MPV player";
    homepage = "https://github.com/tomasklaen/uosc";
    license = licenses.gpl3Only;
    maintainers = with lib.maintainers; [ apfelkuchen6 ];
  };
})
+1 −0
Original line number Diff line number Diff line
@@ -31765,6 +31765,7 @@ with pkgs;
    simple-mpv-webui = callPackage ../applications/video/mpv/scripts/simple-mpv-webui.nix {};
    sponsorblock = callPackage ../applications/video/mpv/scripts/sponsorblock.nix {};
    thumbnail = callPackage ../applications/video/mpv/scripts/thumbnail.nix { };
    uosc = callPackage ../applications/video/mpv/scripts/uosc.nix { };
    vr-reversal = callPackage ../applications/video/mpv/scripts/vr-reversal.nix {};
    webtorrent-mpv-hook = callPackage ../applications/video/mpv/scripts/webtorrent-mpv-hook.nix { };
    youtube-quality = callPackage ../applications/video/mpv/scripts/youtube-quality.nix { };