Merge pull request #270916 from nbraud/mpvScripts/buildLua/strippedName

mpvScripts.buildLua: Strip `mpv-` from `pname` when inferring `scriptName`
This commit is contained in:
Peder Bergebakken Sundt 2023-12-13 23:37:59 +01:00 committed by GitHub
commit a42aa9875a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 6 deletions

View File

@ -20,11 +20,17 @@ lib.makeOverridable (args: stdenvNoCC.mkDerivation (extendedBy
, extraScripts ? []
, ... }@args:
let
strippedName = with builtins;
let groups = match "mpv[-_](.*)" pname; in
if groups != null
then head groups
else pname
;
# either passthru.scriptName, inferred from scriptPath, or from pname
scriptName = (args.passthru or {}).scriptName or (
if args ? scriptPath
then fileName args.scriptPath
else "${pname}.lua"
else "${strippedName}.lua"
);
scriptPath = args.scriptPath or "./${scriptName}";
in {

View File

@ -17,8 +17,6 @@ buildLua rec {
'youtube_dl_executable = "${lib.getBin yt-dlp}/bin/yt-dlp"',
'';
scriptPath = "playlistmanager.lua";
meta = with lib; {
description = "Mpv lua script to create and manage playlists";
homepage = "https://github.com/jonniek/mpv-playlistmanager";

View File

@ -15,7 +15,6 @@ buildLua rec {
hash = "sha256-yrcTxqpLnOI1Tq3khhflO3wzhyeTPuvKifyH5/P57Ns=";
};
scriptPath = "quality-menu.lua";
extraScripts = lib.optional oscSupport "quality-menu-osc.lua";
meta = with lib; {

View File

@ -11,8 +11,6 @@ buildLua {
hash = "sha256-5u5WBvWOEydJrnr/vilEgW4+fxkxM6wNjb9Fyyxx/1c=";
};
scriptPath = "thumbfast.lua";
passthru.extraWrapperArgs = [
"--prefix" "PATH" ":" "${lib.getBin mpv-unwrapped}/bin"
];