Unverified Commit 65ab58ec authored by axolord's avatar axolord
Browse files

mathpix-snipping-tool: fix startup on wayland, add maintainer

The application does not support Wayland and fails to start, attempting
to load an incompatible platform plugin.

This change forces the application to use the XWayland compatibility
layer by explicitly setting QT_QPA_PLATFORM=xcb via makeWrapper.

fixes #414692
parent 9b1cbd93
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  appimageTools,
  lib,
  fetchurl,
  makeWrapper,
}:
let
  pname = "mathpix-snipping-tool";
@@ -17,17 +18,24 @@ in
appimageTools.wrapType2 {
  inherit pname version src;

  nativeBuildInputs = [ makeWrapper ];

  extraInstallCommands = ''
    install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications

    cp -r ${appimageContents}/usr/share/icons $out/share

    wrapProgram $out/bin/${pname} --set QT_QPA_PLATFORM xcb
  '';

  meta = with lib; {
    description = "OCR tool to convert pictures to LaTeX";
    homepage = "https://mathpix.com/";
    license = licenses.unfree;
    maintainers = [ maintainers.hiro98 ];
    maintainers = [
      maintainers.hiro98
      maintainers.axodentally
    ];
    platforms = [ "x86_64-linux" ];
    mainProgram = "mathpix-snipping-tool";
  };