Commit e6cf49e0 authored by nicoo's avatar nicoo
Browse files

mpvScripts: Replace manual path construction with `lib` functions

parent 9a238c98
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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";
+1 −1
Original line number Diff line number Diff line
@@ -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; {
+4 −4
Original line number Diff line number Diff line
@@ -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 = ''
+1 −1
Original line number Diff line number Diff line
@@ -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\""
  '';

+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ buildLua {
  passthru.updateScript = unstableGitUpdater {};

  passthru.extraWrapperArgs = [
    "--prefix" "PATH" ":" "${lib.getBin mpv-unwrapped}/bin"
    "--prefix" "PATH" ":" (lib.makeBinPath [ mpv-unwrapped ])
  ];

  meta = {
Loading