depot/third_party/nixpkgs/pkgs/applications/video/mpv/scripts/buildLua.nix

23 lines
550 B
Nix
Raw Normal View History

{ lib
, stdenvNoCC }:
let fileName = pathStr: lib.last (lib.splitString "/" pathStr);
in
lib.makeOverridable (
{ pname, scriptPath ? "${pname}.lua", ... }@args:
stdenvNoCC.mkDerivation (lib.attrsets.recursiveUpdate {
dontBuild = true;
preferLocalBuild = true;
outputHashMode = "recursive";
installPhase = ''
runHook preInstall
install -m644 -Dt $out/share/mpv/scripts ${scriptPath}
runHook postInstall
'';
passthru.scriptName = fileName scriptPath;
meta.platforms = lib.platforms.all;
} args)
)