From 492f662817bfd1191b409fb7ee09cf6af847361b Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 29 Nov 2023 13:24:05 +0000 Subject: [PATCH] mpvScripts.uosc: refactor with `buildLua` --- pkgs/applications/video/mpv/scripts/default.nix | 2 +- pkgs/applications/video/mpv/scripts/uosc.nix | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix index fb75464ab98e..4083c52b3d90 100644 --- a/pkgs/applications/video/mpv/scripts/default.nix +++ b/pkgs/applications/video/mpv/scripts/default.nix @@ -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 { }; diff --git a/pkgs/applications/video/mpv/scripts/uosc.nix b/pkgs/applications/video/mpv/scripts/uosc.nix index b88cd2c5b968..311b31549ca7 100644 --- a/pkgs/applications/video/mpv/scripts/uosc.nix +++ b/pkgs/applications/video/mpv/scripts/uosc.nix @@ -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 = [