about summary refs log tree commit diff
path: root/pkgs/applications/video/mpv
diff options
context:
space:
mode:
authornicoo <nicoo@mur.at>2023-11-29 15:34:51 +0000
committernicoo <nicoo@mur.at>2023-12-04 16:40:52 +0000
commit6444a0957bd825e454382d5e7211865afe8ab534 (patch)
tree0444b3e56575efaf113c2ff4df406d3f8a84e327 /pkgs/applications/video/mpv
parent023cd82d0402e74886696699f9b681e9dc7194f0 (diff)
downloadnixlib-6444a0957bd825e454382d5e7211865afe8ab534.tar
nixlib-6444a0957bd825e454382d5e7211865afe8ab534.tar.gz
nixlib-6444a0957bd825e454382d5e7211865afe8ab534.tar.bz2
nixlib-6444a0957bd825e454382d5e7211865afe8ab534.tar.lz
nixlib-6444a0957bd825e454382d5e7211865afe8ab534.tar.xz
nixlib-6444a0957bd825e454382d5e7211865afe8ab534.tar.zst
nixlib-6444a0957bd825e454382d5e7211865afe8ab534.zip
mpvScripts.buildLua: Generate the correct `scriptName` for directories
`wrapMpv` expects the literal file/directory name.
Bug introduced in 8438431b9f87e36df21da4ab4d025ba8b4eff937.
Diffstat (limited to 'pkgs/applications/video/mpv')
-rw-r--r--pkgs/applications/video/mpv/scripts/buildLua.nix13
1 files changed, 2 insertions, 11 deletions
diff --git a/pkgs/applications/video/mpv/scripts/buildLua.nix b/pkgs/applications/video/mpv/scripts/buildLua.nix
index 046b0fa2ea96..728cb1c41556 100644
--- a/pkgs/applications/video/mpv/scripts/buildLua.nix
+++ b/pkgs/applications/video/mpv/scripts/buildLua.nix
@@ -5,15 +5,6 @@ let
   inherit (lib) hasPrefix hasSuffix removeSuffix;
   escapedList = with lib; concatMapStringsSep " " (s: "'${escape [ "'" ] s}'");
   fileName = pathStr: lib.last (lib.splitString "/" pathStr);
-  nameFromPath = pathStr:
-    let fN = fileName pathStr; in
-    if hasSuffix ".lua" fN then
-      fN
-    else if !(hasPrefix "." fN) then
-      "${fN}.lua"
-    else
-      null
-  ;
   scriptsDir = "$out/share/mpv/scripts";
 in
 lib.makeOverridable (
@@ -23,8 +14,8 @@ lib.makeOverridable (
   let
     # either passthru.scriptName, inferred from scriptPath, or from pname
     scriptName = (args.passthru or {}).scriptName or (
-      if args ? scriptPath && nameFromPath args.scriptPath != null
-      then nameFromPath args.scriptPath
+      if args ? scriptPath
+      then fileName args.scriptPath
       else "${pname}.lua"
     );
     scriptPath = args.scriptPath or "./${scriptName}";