Merge pull request #219909 from apfelkuchen6/mpv-uosc

mpvScripts.uosc: init at 4.6.0
This commit is contained in:
Anderson Torres 2023-03-08 15:20:38 -03:00 committed by GitHub
commit a5bcb6e77a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,48 @@
{ 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 ];
};
})

View file

@ -18,6 +18,7 @@ let
# expected to have a `scriptName` passthru attribute that points to the # expected to have a `scriptName` passthru attribute that points to the
# name of the script that would reside in the script's derivation's # name of the script that would reside in the script's derivation's
# `$out/share/mpv/scripts/`. # `$out/share/mpv/scripts/`.
# A script can optionally also provide an `extraWrapperArgs` passthru attribute.
scripts ? [], scripts ? [],
extraUmpvWrapperArgs ? [] extraUmpvWrapperArgs ? []
}: }:
@ -49,6 +50,8 @@ let
# attribute of the script derivation from the `scripts` # attribute of the script derivation from the `scripts`
"--script=${script}/share/mpv/scripts/${script.scriptName}" "--script=${script}/share/mpv/scripts/${script.scriptName}"
] ]
# scripts can also set the `extraWrapperArgs` passthru
++ (script.extraWrapperArgs or [])
) scripts ) scripts
)) ++ extraMakeWrapperArgs) )) ++ extraMakeWrapperArgs)
; ;

View file

@ -31810,6 +31810,7 @@ with pkgs;
simple-mpv-webui = callPackage ../applications/video/mpv/scripts/simple-mpv-webui.nix {}; simple-mpv-webui = callPackage ../applications/video/mpv/scripts/simple-mpv-webui.nix {};
sponsorblock = callPackage ../applications/video/mpv/scripts/sponsorblock.nix {}; sponsorblock = callPackage ../applications/video/mpv/scripts/sponsorblock.nix {};
thumbnail = callPackage ../applications/video/mpv/scripts/thumbnail.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 {}; vr-reversal = callPackage ../applications/video/mpv/scripts/vr-reversal.nix {};
webtorrent-mpv-hook = callPackage ../applications/video/mpv/scripts/webtorrent-mpv-hook.nix { }; webtorrent-mpv-hook = callPackage ../applications/video/mpv/scripts/webtorrent-mpv-hook.nix { };
youtube-quality = callPackage ../applications/video/mpv/scripts/youtube-quality.nix { }; youtube-quality = callPackage ../applications/video/mpv/scripts/youtube-quality.nix { };