mpvScripts.uosc: refactor with buildLua

This commit is contained in:
nicoo 2023-11-29 13:24:05 +00:00
parent ce2dcc6dcb
commit 492f662817
2 changed files with 6 additions and 13 deletions

View file

@ -22,7 +22,7 @@ in lib.recurseIntoAttrs
sponsorblock = callPackage ./sponsorblock.nix { };
thumbfast = callPackage ./thumbfast.nix { inherit buildLua; };
thumbnail = callPackage ./thumbnail.nix { inherit buildLua; };
uosc = callPackage ./uosc.nix { };
uosc = callPackage ./uosc.nix { inherit buildLua; };
visualizer = callPackage ./visualizer.nix { };
vr-reversal = callPackage ./vr-reversal.nix { };
webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };

View file

@ -1,6 +1,6 @@
{ stdenvNoCC, lib, fetchFromGitHub, makeFontsConf }:
{ buildLua, lib, fetchFromGitHub, makeFontsConf }:
stdenvNoCC.mkDerivation (finalAttrs: {
buildLua (finalAttrs: {
pname = "uosc";
version = "4.7.0";
@ -16,19 +16,12 @@ stdenvNoCC.mkDerivation (finalAttrs: {
--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
scriptPath = "scripts/uosc.lua";
postInstall = ''
cp -r scripts/uosc_shared $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 = [