Unverified Commit f950274d authored by nicoo's avatar nicoo Committed by GitHub
Browse files

Merge #308292: mpvScripts scopewide fixups

parents c88c954f 48eb357d
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -22,14 +22,14 @@ buildLua {

  postPatch = ''
    substituteInPlace convert_script.lua \
      --replace 'mkvpropedit_exe = "mkvpropedit"' \
                'mkvpropedit_exe = "${mkvtoolnix-cli}/bin/mkvpropedit"' \
      --replace 'mkvmerge_exe = "mkvmerge"' \
                'mkvmerge_exe = "${mkvtoolnix-cli}/bin/mkvmerge"' \
      --replace 'yad_exe = "yad"' \
                'yad_exe = "${yad}/bin/yad"' \
      --replace 'notify_send_exe = "notify-send"' \
                'notify_send_exe = "${libnotify}/bin/notify-send"' \
      --replace-fail 'mkvpropedit_exe = "mkvpropedit"' \
                'mkvpropedit_exe = "${lib.getExe' mkvtoolnix-cli "mkvpropedit"}"' \
      --replace-fail 'mkvmerge_exe = "mkvmerge"' \
                'mkvmerge_exe = "${lib.getExe' mkvtoolnix-cli "mkvmerge"}"' \
      --replace-fail 'yad_exe = "yad"' \
                'yad_exe = "${lib.getExe yad}"' \
      --replace-fail 'notify_send_exe = "notify-send"' \
                'notify_send_exe = "${lib.getExe libnotify}"' \
  '';

  scriptPath = "convert_script.lua";
+2 −2
Original line number Diff line number Diff line
@@ -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";
+1 −1
Original line number Diff line number Diff line
@@ -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" ];
+2 −2
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@ buildLua rec {

  postPatch = ''
    substituteInPlace playlistmanager.lua \
      --replace 'youtube_dl_executable = "youtube-dl",' \
      'youtube_dl_executable = "${lib.getBin yt-dlp}/bin/yt-dlp"',
      --replace-fail 'youtube_dl_executable = "yt-dlp",' \
      'youtube_dl_executable = "${lib.getExe yt-dlp}"',
  '';

  meta = with lib; {
+4 −4
Original line number Diff line number Diff line
@@ -23,11 +23,11 @@ buildLua rec {

  postPatch = ''
    substituteInPlace utils/forvo.lua \
      --replace "'curl" "'${curl}/bin/curl"
      --replace-fail "'curl" "'${lib.getExe 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" "'${lib.getExe curl}" \
      --replace-fail "'wl-copy" "'${lib.getExe' wl-clipboard "wl-copy"}" \
      --replace-fail "'xclip" "'${lib.getExe xclip}"
  '';

  installPhase = ''
Loading