Unverified Commit ae98104d authored by Philip Taron's avatar Philip Taron Committed by GitHub
Browse files

lmath: init at 1.10.15 (#417018)

parents 31df1912 b5586570
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -14138,6 +14138,11 @@
    githubId = 61395246;
    name = "Lampros Pitsillos";
  };
  langsjo = {
    name = "langsjo";
    github = "langsjo";
    githubId = 104687438;
  };
  larsr = {
    email = "Lars.Rasmusson@gmail.com";
    github = "larsr";
+54 −0
Original line number Diff line number Diff line
{
  lib,
  nix-update-script,
  fetchurl,
  appimageTools,
  makeBinaryWrapper,
}:
let
  pname = "lmath";
  version = "1.10.15";
  src = fetchurl {
    url = "https://github.com/lehtoroni/lmath-issues/releases/download/v${version}/LMath_Linux_r${version}-release.AppImage";
    hash = "sha256-JOV+g7izjctCkHl5q/9T2PSUZzPzVPisHppbPofVYy0=";
  };

  appimageContents = appimageTools.extractType2 {
    inherit pname version src;
  };
in
appimageTools.wrapType2 {
  inherit pname version src;

  nativeBuildInputs = [
    makeBinaryWrapper
  ];

  # '--skip-updated-bundle-check' stops automatic updates from breaking the package
  extraInstallCommands = ''
    install -Dm 444 ${appimageContents}/lmath.desktop $out/share/applications/lmath.desktop
    install -Dm 444 ${appimageContents}/lmath.png $out/share/icons/hicolor/512x512/apps/lmath.png

    wrapProgram $out/bin/lmath \
      --add-flags "--no-update-check"

    substituteInPlace $out/share/applications/lmath.desktop \
      --replace-fail 'Exec=AppRun' 'Exec=lmath'
  '';

  passthru.updateScript = nix-update-script {
    extraArgs = [
      "--version-regex"
      "^r([0-9\.]*)"
    ];
  };

  meta = {
    description = "Simple notebook app with LaTeX capabilities";
    homepage = "https://lehtodigital.fi/lmath/";
    mainProgram = "lmath";
    license = lib.licenses.unfree;
    maintainers = with lib.maintainers; [ langsjo ];
    platforms = [ "x86_64-linux" ];
  };
}