mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
mpvScripts.buildLua: extraScripts
support directories, preserve mode
This commit is contained in:
parent
aa606b10cc
commit
c6c0062b2c
@ -2,7 +2,10 @@
|
||||
, stdenvNoCC }:
|
||||
|
||||
let
|
||||
escapedList = with lib; concatMapStringsSep " " (s: "'${escape [ "'" ] s}'");
|
||||
# Escape strings for embedding in shell scripts
|
||||
escaped = s: "'${lib.escape [ "'" ] s}'";
|
||||
escapedList = lib.concatMapStringsSep " " escaped;
|
||||
|
||||
fileName = pathStr: lib.last (lib.splitString "/" pathStr);
|
||||
scriptsDir = "$out/share/mpv/scripts";
|
||||
|
||||
@ -56,8 +59,8 @@ lib.makeOverridable (args: stdenvNoCC.mkDerivation (extendedBy
|
||||
mkdir -p "${scriptsDir}"
|
||||
cp -a "${scriptPath}" "${scriptsDir}/${scriptName}"
|
||||
else
|
||||
install -m644 -Dt "${scriptsDir}" \
|
||||
${escapedList ([ scriptPath ] ++ extraScripts)}
|
||||
install -m644 -Dt "${scriptsDir}" ${escaped scriptPath}
|
||||
${lib.optionalString (extraScripts != []) ''cp -at "${scriptsDir}/" ${escapedList extraScripts}''}
|
||||
fi
|
||||
|
||||
runHook postInstall
|
||||
|
@ -29,7 +29,6 @@ buildLua {
|
||||
extraScripts = [ "c_concat.sh" ];
|
||||
|
||||
postInstall = ''
|
||||
chmod 0755 $out/share/mpv/scripts/c_concat.sh
|
||||
wrapProgram $out/share/mpv/scripts/c_concat.sh \
|
||||
--run "mkdir -p ~/.config/mpv/cutter/"
|
||||
'';
|
||||
|
@ -32,7 +32,7 @@ buildLua {
|
||||
--replace 'mp.find_config_file("scripts")' "\"$out/share/mpv/scripts\""
|
||||
'';
|
||||
|
||||
postInstall = "cp -a sponsorblock_shared $out/share/mpv/scripts/";
|
||||
extraScripts = [ "sponsorblock_shared" ];
|
||||
|
||||
passthru.updateScript = nix-update-script {
|
||||
extraArgs = [ "--version=branch" ];
|
||||
|
Loading…
Reference in New Issue
Block a user