From 9a238c98ddc3577fc2dae21a3841c46dd5c558f9 Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 1 May 2024 12:02:52 +0000 Subject: mpvScripts: Replace `substituteInPlace`'s deprecated parameter --- pkgs/applications/video/mpv/scripts/convert.nix | 8 ++++---- pkgs/applications/video/mpv/scripts/cutter.nix | 4 ++-- pkgs/applications/video/mpv/scripts/mpris.nix | 2 +- pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix | 2 +- pkgs/applications/video/mpv/scripts/mpvacious.nix | 8 ++++---- pkgs/applications/video/mpv/scripts/sponsorblock.nix | 4 ++-- pkgs/applications/video/mpv/scripts/vr-reversal.nix | 2 +- pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix | 4 ++-- pkgs/applications/video/mpv/scripts/youtube-upnext.nix | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) (limited to 'pkgs/applications') diff --git a/pkgs/applications/video/mpv/scripts/convert.nix b/pkgs/applications/video/mpv/scripts/convert.nix index d1fdc9c801bb7..cd0e0f99a8403 100644 --- a/pkgs/applications/video/mpv/scripts/convert.nix +++ b/pkgs/applications/video/mpv/scripts/convert.nix @@ -22,13 +22,13 @@ buildLua { postPatch = '' substituteInPlace convert_script.lua \ - --replace 'mkvpropedit_exe = "mkvpropedit"' \ + --replace-fail 'mkvpropedit_exe = "mkvpropedit"' \ 'mkvpropedit_exe = "${mkvtoolnix-cli}/bin/mkvpropedit"' \ - --replace 'mkvmerge_exe = "mkvmerge"' \ + --replace-fail 'mkvmerge_exe = "mkvmerge"' \ 'mkvmerge_exe = "${mkvtoolnix-cli}/bin/mkvmerge"' \ - --replace 'yad_exe = "yad"' \ + --replace-fail 'yad_exe = "yad"' \ 'yad_exe = "${yad}/bin/yad"' \ - --replace 'notify_send_exe = "notify-send"' \ + --replace-fail 'notify_send_exe = "notify-send"' \ 'notify_send_exe = "${libnotify}/bin/notify-send"' \ ''; diff --git a/pkgs/applications/video/mpv/scripts/cutter.nix b/pkgs/applications/video/mpv/scripts/cutter.nix index ac2f518a9b5ab..c58d0a81da633 100644 --- a/pkgs/applications/video/mpv/scripts/cutter.nix +++ b/pkgs/applications/video/mpv/scripts/cutter.nix @@ -16,13 +16,13 @@ buildLua { postPatch = '' substituteInPlace cutter.lua \ - --replace '~/.config/mpv/scripts/c_concat.sh' '${placeholder "out"}/share/mpv/scripts/c_concat.sh' + --replace-fail '~/.config/mpv/scripts/c_concat.sh' '${placeholder "out"}/share/mpv/scripts/c_concat.sh' # needs to be ran separately so that we can replace everything, and not every single mention explicitly # original script places them in the scripts folder, just spawning unnecessary errors # i know that hardcoding .config and especially the .mpv directory isn't best practice, but I didn't want to deviate too much from upstream substituteInPlace cutter.lua \ - --replace '~/.config/mpv/scripts' "''${XDG_CONFIG_HOME:-~/.config}/mpv/cutter" + --replace-fail '~/.config/mpv/scripts' "''${XDG_CONFIG_HOME:-~/.config}/mpv/cutter" ''; passthru.scriptName = "cutter.lua"; diff --git a/pkgs/applications/video/mpv/scripts/mpris.nix b/pkgs/applications/video/mpv/scripts/mpris.nix index 338f0a8dd482f..7caaf24a8c9dc 100644 --- a/pkgs/applications/video/mpv/scripts/mpris.nix +++ b/pkgs/applications/video/mpv/scripts/mpris.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { buildInputs = [ glib mpv-unwrapped ffmpeg ]; postPatch = '' - substituteInPlace Makefile --replace 'PKG_CONFIG =' 'PKG_CONFIG ?=' + substituteInPlace Makefile --replace-fail 'PKG_CONFIG =' 'PKG_CONFIG ?=' ''; installFlags = [ "SCRIPTS_DIR=${placeholder "out"}/share/mpv/scripts" ]; diff --git a/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix b/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix index 44f09b8f21fe8..1b9cdd4e6b42c 100644 --- a/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix +++ b/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix @@ -14,7 +14,7 @@ buildLua rec { postPatch = '' substituteInPlace playlistmanager.lua \ - --replace 'youtube_dl_executable = "youtube-dl",' \ + --replace-fail 'youtube_dl_executable = "youtube-dl",' \ 'youtube_dl_executable = "${lib.getBin yt-dlp}/bin/yt-dlp"', ''; diff --git a/pkgs/applications/video/mpv/scripts/mpvacious.nix b/pkgs/applications/video/mpv/scripts/mpvacious.nix index adac4d1d60692..8e85683b58b07 100644 --- a/pkgs/applications/video/mpv/scripts/mpvacious.nix +++ b/pkgs/applications/video/mpv/scripts/mpvacious.nix @@ -23,11 +23,11 @@ buildLua rec { postPatch = '' substituteInPlace utils/forvo.lua \ - --replace "'curl" "'${curl}/bin/curl" + --replace-fail "'curl" "'${curl}/bin/curl" substituteInPlace platform/nix.lua \ - --replace "'curl" "'${curl}/bin/curl" \ - --replace "'wl-copy" "'${wl-clipboard}/bin/wl-copy" \ - --replace "'xclip" "'${xclip}/bin/xclip" + --replace-fail "'curl" "'${curl}/bin/curl" \ + --replace-fail "'wl-copy" "'${wl-clipboard}/bin/wl-copy" \ + --replace-fail "'xclip" "'${xclip}/bin/xclip" ''; installPhase = '' diff --git a/pkgs/applications/video/mpv/scripts/sponsorblock.nix b/pkgs/applications/video/mpv/scripts/sponsorblock.nix index 56ac2575ecdea..d8757143926f4 100644 --- a/pkgs/applications/video/mpv/scripts/sponsorblock.nix +++ b/pkgs/applications/video/mpv/scripts/sponsorblock.nix @@ -28,8 +28,8 @@ buildLua { postPatch = '' substituteInPlace sponsorblock.lua \ - --replace "python3" "${python3}/bin/python3" \ - --replace 'mp.find_config_file("scripts")' "\"$out/share/mpv/scripts\"" + --replace-fail "python3" "${python3}/bin/python3" \ + --replace-fail 'mp.find_config_file("scripts")' "\"$out/share/mpv/scripts\"" ''; extraScripts = [ "sponsorblock_shared" ]; diff --git a/pkgs/applications/video/mpv/scripts/vr-reversal.nix b/pkgs/applications/video/mpv/scripts/vr-reversal.nix index 9a7b335a6591d..f68e4566f9210 100644 --- a/pkgs/applications/video/mpv/scripts/vr-reversal.nix +++ b/pkgs/applications/video/mpv/scripts/vr-reversal.nix @@ -18,7 +18,7 @@ stdenvNoCC.mkDerivation rec { # reset_rot is only available in ffmpeg 5.0, see 5bcc61ce87922ecccaaa0bd303a7e195929859a8 postPatch = lib.optionalString (lib.versionOlder ffmpeg.version "5.0") '' - substituteInPlace 360plugin.lua --replace ":reset_rot=1:" ":" + substituteInPlace 360plugin.lua --replace-fail ":reset_rot=1:" ":" ''; installPhase = '' diff --git a/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix b/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix index 10fe3d0cdce03..6deab112d3cb5 100644 --- a/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix +++ b/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix @@ -15,9 +15,9 @@ buildNpmPackage rec { }; postPatch = '' - substituteInPlace src/webtorrent.ts --replace "node_path: 'node'" "node_path: '${nodejs}/bin/node'" + substituteInPlace src/webtorrent.ts --replace-fail "node_path: 'node'" "node_path: '${nodejs}/bin/node'" # This executable is just for telling non-Nix users how to install - substituteInPlace package.json --replace '"bin": "build/bin.mjs",' "" + substituteInPlace package.json --replace-fail '"bin": "build/bin.mjs",' "" rm -rf src/bin.ts ''; diff --git a/pkgs/applications/video/mpv/scripts/youtube-upnext.nix b/pkgs/applications/video/mpv/scripts/youtube-upnext.nix index cdd7ea66a1763..ec5da9161a036 100644 --- a/pkgs/applications/video/mpv/scripts/youtube-upnext.nix +++ b/pkgs/applications/video/mpv/scripts/youtube-upnext.nix @@ -13,7 +13,7 @@ buildLua rec { postPatch = '' substituteInPlace youtube-upnext.lua \ - --replace '"curl"' '"${lib.getExe curl}"' + --replace-fail '"curl"' '"${lib.getExe curl}"' ''; passthru.updateScript = unstableGitUpdater { }; -- cgit 1.4.1 From e6cf49e0298723f3aef7ca631627229ceb2378b4 Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 1 May 2024 11:47:26 +0000 Subject: mpvScripts: Replace manual path construction with `lib` functions --- pkgs/applications/video/mpv/scripts/convert.nix | 8 ++++---- pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix | 2 +- pkgs/applications/video/mpv/scripts/mpvacious.nix | 8 ++++---- pkgs/applications/video/mpv/scripts/sponsorblock.nix | 2 +- pkgs/applications/video/mpv/scripts/thumbfast.nix | 2 +- pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'pkgs/applications') diff --git a/pkgs/applications/video/mpv/scripts/convert.nix b/pkgs/applications/video/mpv/scripts/convert.nix index cd0e0f99a8403..2505be15da544 100644 --- a/pkgs/applications/video/mpv/scripts/convert.nix +++ b/pkgs/applications/video/mpv/scripts/convert.nix @@ -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"; diff --git a/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix b/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix index 1b9cdd4e6b42c..ae943eabaaec1 100644 --- a/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix +++ b/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix @@ -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; { diff --git a/pkgs/applications/video/mpv/scripts/mpvacious.nix b/pkgs/applications/video/mpv/scripts/mpvacious.nix index 8e85683b58b07..abbe2ba747dbb 100644 --- a/pkgs/applications/video/mpv/scripts/mpvacious.nix +++ b/pkgs/applications/video/mpv/scripts/mpvacious.nix @@ -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 = '' diff --git a/pkgs/applications/video/mpv/scripts/sponsorblock.nix b/pkgs/applications/video/mpv/scripts/sponsorblock.nix index d8757143926f4..6caa10045c484 100644 --- a/pkgs/applications/video/mpv/scripts/sponsorblock.nix +++ b/pkgs/applications/video/mpv/scripts/sponsorblock.nix @@ -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\"" ''; diff --git a/pkgs/applications/video/mpv/scripts/thumbfast.nix b/pkgs/applications/video/mpv/scripts/thumbfast.nix index e30c62774b759..f5595f637b080 100644 --- a/pkgs/applications/video/mpv/scripts/thumbfast.nix +++ b/pkgs/applications/video/mpv/scripts/thumbfast.nix @@ -13,7 +13,7 @@ buildLua { passthru.updateScript = unstableGitUpdater {}; passthru.extraWrapperArgs = [ - "--prefix" "PATH" ":" "${lib.getBin mpv-unwrapped}/bin" + "--prefix" "PATH" ":" (lib.makeBinPath [ mpv-unwrapped ]) ]; meta = { diff --git a/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix b/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix index 6deab112d3cb5..08967c3f28451 100644 --- a/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix +++ b/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix @@ -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 -- cgit 1.4.1 From 48eb357d3573f2281bf23460a02dac966e2aef2c Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 1 May 2024 14:02:06 +0000 Subject: mpvScripts.mpv-playlistmanager: Update `postPatch` Issue found by `--replace-fail` on `substituteInPlace`. --- pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/applications') diff --git a/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix b/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix index ae943eabaaec1..ffc1e81eed5d0 100644 --- a/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix +++ b/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix @@ -14,7 +14,7 @@ buildLua rec { postPatch = '' substituteInPlace playlistmanager.lua \ - --replace-fail 'youtube_dl_executable = "youtube-dl",' \ + --replace-fail 'youtube_dl_executable = "yt-dlp",' \ 'youtube_dl_executable = "${lib.getExe yt-dlp}"', ''; -- cgit 1.4.1