From cc419c0148131cf229b218a51d13e7cd0d764fe9 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 22 May 2024 14:33:40 -0300 Subject: [PATCH] mpv: move wrapper under mpv-unwrapped.passthru And refactor to fit. wrapper --- pkgs/applications/video/mpv/default.nix | 3 +++ pkgs/applications/video/mpv/wrapper.nix | 18 ++++++++++-------- pkgs/top-level/all-packages.nix | 7 +++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 5fd6a8955465..2e0ed7e1f92c 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -1,5 +1,6 @@ { lib , buildPackages +, callPackage , config , stdenv , fetchFromGitHub @@ -256,6 +257,8 @@ in stdenv'.mkDerivation (finalAttrs: { vapoursynthSupport vapoursynth ; + + wrapper = callPackage ./wrapper.nix { }; }; meta = { diff --git a/pkgs/applications/video/mpv/wrapper.nix b/pkgs/applications/video/mpv/wrapper.nix index b427318121ef..533ede74f874 100644 --- a/pkgs/applications/video/mpv/wrapper.nix +++ b/pkgs/applications/video/mpv/wrapper.nix @@ -7,21 +7,23 @@ , symlinkJoin , writeTextDir , yt-dlp +# the unwrapped mpv derivation +, mpv }: -# the unwrapped mpv derivation - 1st argument to `wrapMpv` -mpv: - let - # arguments to the function (exposed as `wrapMpv` in all-packages.nix) + # arguments to the function (exposed as `mpv-unwrapped.wrapper` in top-level) wrapper = { + mpv, extraMakeWrapperArgs ? [], youtubeSupport ? true, - # a set of derivations (probably from `mpvScripts`) where each is - # expected to have a `scriptName` passthru attribute that points to the - # name of the script that would reside in the script's derivation's + # a set of derivations (probably from `mpvScripts`) where each is 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. + # + # A script can optionally also provide `passthru.extraWrapperArgs` + # attribute. scripts ? [], extraUmpvWrapperArgs ? [] }: diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 32774b726b66..175aab8601a7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32942,11 +32942,10 @@ with pkgs; inherit lua; }; - shaka-packager = callPackage ../applications/video/shaka-packager { }; + # Wrap avoiding rebuild + mpv = mpv-unwrapped.wrapper { mpv = mpv-unwrapped; }; - # Wraps without triggering a rebuild - wrapMpv = callPackage ../applications/video/mpv/wrapper.nix { }; - mpv = wrapMpv mpv-unwrapped { }; + shaka-packager = callPackage ../applications/video/shaka-packager { }; mpvpaper = callPackage ../tools/wayland/mpvpaper { };