Merge pull request #219909 from apfelkuchen6/mpv-uosc

mpvScripts.uosc: init at 4.6.0

Changed files
+52
pkgs
applications
video
mpv
top-level
+48
pkgs/applications/video/mpv/scripts/uosc.nix
···
···
+
{ 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 ];
+
};
+
})
+3
pkgs/applications/video/mpv/wrapper.nix
···
# expected to have a `scriptName` passthru attribute that points to the
# name of the script that would reside in the script's derivation's
# `$out/share/mpv/scripts/`.
scripts ? [],
extraUmpvWrapperArgs ? []
}:
···
# attribute of the script derivation from the `scripts`
"--script=${script}/share/mpv/scripts/${script.scriptName}"
]
) scripts
)) ++ extraMakeWrapperArgs)
;
···
# expected to have a `scriptName` passthru attribute that points to the
# name of the script that would reside in the script's derivation's
# `$out/share/mpv/scripts/`.
+
# A script can optionally also provide an `extraWrapperArgs` passthru attribute.
scripts ? [],
extraUmpvWrapperArgs ? []
}:
···
# attribute of the script derivation from the `scripts`
"--script=${script}/share/mpv/scripts/${script.scriptName}"
]
+
# scripts can also set the `extraWrapperArgs` passthru
+
++ (script.extraWrapperArgs or [])
) scripts
)) ++ extraMakeWrapperArgs)
;
+1
pkgs/top-level/all-packages.nix
···
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 { };
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 { };
···
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 { };