mpvScripts: Replace manual path construction with lib functions

This commit is contained in:
nicoo
2024-05-01 12:21:52 +00:00
parent 9a238c98dd
commit e6cf49e029
6 changed files with 12 additions and 12 deletions
@@ -23,13 +23,13 @@ buildLua {
postPatch = ''
substituteInPlace convert_script.lua \
--replace-fail 'mkvpropedit_exe = "mkvpropedit"' \
'mkvpropedit_exe = "${mkvtoolnix-cli}/bin/mkvpropedit"' \
'mkvpropedit_exe = "${lib.getExe' mkvtoolnix-cli "mkvpropedit"}"' \
--replace-fail 'mkvmerge_exe = "mkvmerge"' \
'mkvmerge_exe = "${mkvtoolnix-cli}/bin/mkvmerge"' \
'mkvmerge_exe = "${lib.getExe' mkvtoolnix-cli "mkvmerge"}"' \
--replace-fail 'yad_exe = "yad"' \
'yad_exe = "${yad}/bin/yad"' \
'yad_exe = "${lib.getExe yad}"' \
--replace-fail 'notify_send_exe = "notify-send"' \
'notify_send_exe = "${libnotify}/bin/notify-send"' \
'notify_send_exe = "${lib.getExe libnotify}"' \
'';
scriptPath = "convert_script.lua";
@@ -15,7 +15,7 @@ buildLua rec {
postPatch = ''
substituteInPlace playlistmanager.lua \
--replace-fail 'youtube_dl_executable = "youtube-dl",' \
'youtube_dl_executable = "${lib.getBin yt-dlp}/bin/yt-dlp"',
'youtube_dl_executable = "${lib.getExe yt-dlp}"',
'';
meta = with lib; {
@@ -23,11 +23,11 @@ buildLua rec {
postPatch = ''
substituteInPlace utils/forvo.lua \
--replace-fail "'curl" "'${curl}/bin/curl"
--replace-fail "'curl" "'${lib.getExe curl}"
substituteInPlace platform/nix.lua \
--replace-fail "'curl" "'${curl}/bin/curl" \
--replace-fail "'wl-copy" "'${wl-clipboard}/bin/wl-copy" \
--replace-fail "'xclip" "'${xclip}/bin/xclip"
--replace-fail "'curl" "'${lib.getExe curl}" \
--replace-fail "'wl-copy" "'${lib.getExe' wl-clipboard "wl-copy"}" \
--replace-fail "'xclip" "'${lib.getExe xclip}"
'';
installPhase = ''
@@ -28,7 +28,7 @@ buildLua {
postPatch = ''
substituteInPlace sponsorblock.lua \
--replace-fail "python3" "${python3}/bin/python3" \
--replace-fail "python3" "${lib.getExe python3}" \
--replace-fail 'mp.find_config_file("scripts")' "\"$out/share/mpv/scripts\""
'';
@@ -13,7 +13,7 @@ buildLua {
passthru.updateScript = unstableGitUpdater {};
passthru.extraWrapperArgs = [
"--prefix" "PATH" ":" "${lib.getBin mpv-unwrapped}/bin"
"--prefix" "PATH" ":" (lib.makeBinPath [ mpv-unwrapped ])
];
meta = {
@@ -15,7 +15,7 @@ buildNpmPackage rec {
};
postPatch = ''
substituteInPlace src/webtorrent.ts --replace-fail "node_path: 'node'" "node_path: '${nodejs}/bin/node'"
substituteInPlace src/webtorrent.ts --replace-fail "node_path: 'node'" "node_path: '${lib.getExe nodejs}'"
# This executable is just for telling non-Nix users how to install
substituteInPlace package.json --replace-fail '"bin": "build/bin.mjs",' ""
rm -rf src/bin.ts