From 7189efcbff841c5e8bd6c9b585949e03826859e1 Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 18 Oct 2023 08:15:20 +0000 Subject: [PATCH 1/3] mpvScripts.quality-menu: Refactor with `buildLua` --- pkgs/applications/video/mpv/scripts/default.nix | 2 +- .../video/mpv/scripts/quality-menu.nix | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix index 562e3de1645b..ef2a32772992 100644 --- a/pkgs/applications/video/mpv/scripts/default.nix +++ b/pkgs/applications/video/mpv/scripts/default.nix @@ -17,7 +17,7 @@ in lib.recurseIntoAttrs mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { }; mpv-webm = callPackage ./mpv-webm.nix { }; mpvacious = callPackage ./mpvacious.nix { }; - quality-menu = callPackage ./quality-menu.nix { }; + quality-menu = callPackage ./quality-menu.nix { inherit buildLua; }; simple-mpv-webui = callPackage ./simple-mpv-webui.nix { }; sponsorblock = callPackage ./sponsorblock.nix { }; thumbfast = callPackage ./thumbfast.nix { }; diff --git a/pkgs/applications/video/mpv/scripts/quality-menu.nix b/pkgs/applications/video/mpv/scripts/quality-menu.nix index 45d358843b37..6a2f8acf5b50 100644 --- a/pkgs/applications/video/mpv/scripts/quality-menu.nix +++ b/pkgs/applications/video/mpv/scripts/quality-menu.nix @@ -1,10 +1,10 @@ { lib -, stdenvNoCC +, buildLua , fetchFromGitHub , oscSupport ? false }: -stdenvNoCC.mkDerivation rec { +buildLua rec { pname = "mpv-quality-menu"; version = "4.1.0"; @@ -15,19 +15,8 @@ stdenvNoCC.mkDerivation rec { hash = "sha256-93WoTeX61xzbjx/tgBgUVuwyR9MkAUzCfVSrbAC7Ddc="; }; - dontBuild = true; - - installPhase = '' - runHook preInstall - mkdir -p $out/share/mpv/scripts - cp quality-menu.lua $out/share/mpv/scripts - '' + lib.optionalString oscSupport '' - cp quality-menu-osc.lua $out/share/mpv/scripts - '' + '' - runHook postInstall - ''; - passthru.scriptName = "quality-menu.lua"; + scriptPath = if oscSupport then "*.lua" else passthru.scriptName; meta = with lib; { description = "A userscript for MPV that allows you to change youtube video quality (ytdl-format) on the fly"; From a3a5bf4128f718c62341e86c3644dc9dd3eb7bdc Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 18 Oct 2023 08:25:31 +0000 Subject: [PATCH 2/3] mpvScripts.mpv-playlistmanager: Refactor with `buildLua` --- pkgs/applications/video/mpv/scripts/default.nix | 2 +- .../video/mpv/scripts/mpv-playlistmanager.nix | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix index ef2a32772992..9fde30d23ac2 100644 --- a/pkgs/applications/video/mpv/scripts/default.nix +++ b/pkgs/applications/video/mpv/scripts/default.nix @@ -14,7 +14,7 @@ in lib.recurseIntoAttrs convert = callPackage ./convert.nix { }; inhibit-gnome = callPackage ./inhibit-gnome.nix { }; mpris = callPackage ./mpris.nix { }; - mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { }; + mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { inherit buildLua; }; mpv-webm = callPackage ./mpv-webm.nix { }; mpvacious = callPackage ./mpvacious.nix { }; quality-menu = callPackage ./quality-menu.nix { inherit buildLua; }; diff --git a/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix b/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix index 720fdaae5b3f..8ec05a3cf691 100644 --- a/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix +++ b/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix @@ -1,6 +1,6 @@ -{ lib, stdenvNoCC, fetchFromGitHub, yt-dlp }: +{ lib, buildLua, fetchFromGitHub, yt-dlp }: -stdenvNoCC.mkDerivation rec { +buildLua rec { pname = "mpv-playlistmanager"; version = "unstable-2023-08-09"; @@ -17,21 +17,12 @@ stdenvNoCC.mkDerivation rec { 'youtube_dl_executable = "${lib.getBin yt-dlp}/bin/yt-dlp"', ''; - dontBuild = true; - - installPhase = '' - runHook preInstall - install -D -t $out/share/mpv/scripts playlistmanager.lua - runHook postInstall - ''; - - passthru.scriptName = "playlistmanager.lua"; + scriptPath = "playlistmanager.lua"; meta = with lib; { description = "Mpv lua script to create and manage playlists"; homepage = "https://github.com/jonniek/mpv-playlistmanager"; license = licenses.unlicense; - platforms = platforms.all; maintainers = with maintainers; [ lunik1 ]; }; } From c9f5c80a1fe6513c0028819480731076240f6b9e Mon Sep 17 00:00:00 2001 From: nicoo Date: Thu, 9 Nov 2023 16:26:32 +0000 Subject: [PATCH 3/3] =?UTF-8?q?mpvScripts.quality-menu:=204.1.0=20?= =?UTF-8?q?=E2=86=92=204.1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/applications/video/mpv/scripts/quality-menu.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/video/mpv/scripts/quality-menu.nix b/pkgs/applications/video/mpv/scripts/quality-menu.nix index 6a2f8acf5b50..d0eb2ca0119b 100644 --- a/pkgs/applications/video/mpv/scripts/quality-menu.nix +++ b/pkgs/applications/video/mpv/scripts/quality-menu.nix @@ -6,13 +6,13 @@ buildLua rec { pname = "mpv-quality-menu"; - version = "4.1.0"; + version = "4.1.1"; src = fetchFromGitHub { owner = "christoph-heinrich"; repo = "mpv-quality-menu"; rev = "v${version}"; - hash = "sha256-93WoTeX61xzbjx/tgBgUVuwyR9MkAUzCfVSrbAC7Ddc="; + hash = "sha256-yrcTxqpLnOI1Tq3khhflO3wzhyeTPuvKifyH5/P57Ns="; }; passthru.scriptName = "quality-menu.lua";