diff options
Diffstat (limited to 'pkgs/applications/networking/mailreaders')
-rw-r--r-- | pkgs/applications/networking/mailreaders/tutanota-desktop/default.nix | 66 |
1 files changed, 21 insertions, 45 deletions
diff --git a/pkgs/applications/networking/mailreaders/tutanota-desktop/default.nix b/pkgs/applications/networking/mailreaders/tutanota-desktop/default.nix index 7f83f9dc7d9d..b60ab03c7d9c 100644 --- a/pkgs/applications/networking/mailreaders/tutanota-desktop/default.nix +++ b/pkgs/applications/networking/mailreaders/tutanota-desktop/default.nix @@ -1,61 +1,37 @@ -{ stdenv, lib, fetchurl, makeDesktopItem, copyDesktopItems, makeWrapper, -electron, libsecret }: +{ lib +, appimageTools +, fetchurl +}: -stdenv.mkDerivation rec { +appimageTools.wrapType2 rec { pname = "tutanota-desktop"; - version = "3.119.3"; + version = "3.122.5"; src = fetchurl { - url = "https://github.com/tutao/tutanota/releases/download/tutanota-desktop-release-${version}/${pname}-${version}-unpacked-linux.tar.gz"; - name = "tutanota-desktop-${version}.tar.gz"; - hash = "sha256-TdjvU12nh1sTfGTdBn+7dbEunaF38YjDvceEns4iRbA="; + url = "https://github.com/tutao/tutanota/releases/download/tutanota-desktop-release-${version}/tutanota-desktop-linux.AppImage"; + hash = "sha256-3M53Re6FbxEXHBl5KBLDjZg0uTIv8JIT0DlawNRPXBc="; }; - nativeBuildInputs = [ - copyDesktopItems - makeWrapper - ]; + extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs) ++ [ pkgs.libsecret ]; - dontConfigure = true; - dontBuild = true; + extraInstallCommands = + let appimageContents = appimageTools.extract { inherit pname version src; }; + in '' + mv $out/bin/${pname}-${version} $out/bin/${pname} - desktopItems = makeDesktopItem { - name = pname; - exec = "tutanota-desktop"; - icon = "tutanota-desktop"; - comment = meta.description; - desktopName = "Tutanota Desktop"; - genericName = "Email Reader"; - }; - - installPhase = '' - runHook preInstall - - mkdir -p $out/bin $out/opt/tutanota-desktop $out/share/tutanota-desktop - - cp -r ./ $out/opt/tutanota-desktop - mv $out/opt/tutanota-desktop/{locales,resources} $out/share/tutanota-desktop - - for icon_size in 64 512; do - icon=resources/icons/icon/$icon_size.png - path=$out/share/icons/hicolor/$icon_size'x'$icon_size/apps/tutanota-desktop.png - install -Dm644 $icon $path - done - - makeWrapper ${electron}/bin/electron \ - $out/bin/tutanota-desktop \ - --add-flags $out/share/tutanota-desktop/resources/app.asar \ - --run "mkdir -p /tmp/tutanota" \ - --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libsecret stdenv.cc.cc.lib ]} + install -Dm 444 ${appimageContents}/tutanota-desktop.desktop -t $out/share/applications + install -Dm 444 ${appimageContents}/tutanota-desktop.png -t $out/share/pixmaps - runHook postInstall - ''; + substituteInPlace $out/share/applications/tutanota-desktop.desktop \ + --replace 'Exec=AppRun' 'Exec=${pname}' + ''; meta = with lib; { - description = "Tutanota official desktop client"; - homepage = "https://tutanota.com/"; + description = "Tuta official desktop client"; + homepage = "https://tuta.com/"; changelog = "https://github.com/tutao/tutanota/releases/tag/tutanota-desktop-release-${version}"; license = licenses.gpl3Only; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; maintainers = with maintainers; [ wolfangaukang ]; mainProgram = "tutanota-desktop"; platforms = [ "x86_64-linux" ]; |