nixpkgs/pkgs/applications/video/mpv/scripts/uosc.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.2 KiB
Nix
Raw Normal View History

2023-03-07 00:53:20 +00:00
{ stdenvNoCC, lib, fetchFromGitHub, makeFontsConf }:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "uosc";
2023-04-15 17:36:18 +00:00
version = "4.7.0";
2023-03-07 00:53:20 +00:00
src = fetchFromGitHub {
owner = "tomasklaen";
repo = "uosc";
rev = finalAttrs.version;
2023-04-15 17:36:18 +00:00
hash = "sha256-JqlBjhwRgmXl6XfHYTwtNWZj656EDHjcdWOlCgihF5I=";
2023-03-07 00:53:20 +00:00
};
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 ];
};
})