nixpkgs/pkgs/applications/networking/mailreaders/tutanota-desktop/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, makeDesktopItem, copyDesktopItems, makeWrapper,
electron, libsecret }:
2021-10-04 01:51:29 +00:00
stdenv.mkDerivation rec {
2021-10-04 01:51:29 +00:00
pname = "tutanota-desktop";
2023-03-04 13:03:32 +00:00
version = "3.110.0";
2021-10-04 01:51:29 +00:00
src = fetchurl {
2022-05-05 13:45:27 +00:00
url = "https://github.com/tutao/tutanota/releases/download/tutanota-desktop-release-${version}/${pname}-${version}-unpacked-linux.tar.gz";
name = "tutanota-desktop-${version}.tar.gz";
2023-03-04 13:03:32 +00:00
sha256 = "sha256-ufrhJfYolx/O0/a5AU1nuUpQy0Md6TVgmdhTAi9Appo=";
2021-10-04 01:51:29 +00:00
};
nativeBuildInputs = [
copyDesktopItems
makeWrapper
];
dontConfigure = true;
dontBuild = true;
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
2021-10-04 01:51:29 +00:00
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
2021-10-04 01:51:29 +00:00
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 ]}
2021-10-04 01:51:29 +00:00
runHook postInstall
2021-10-04 01:51:29 +00:00
'';
meta = with lib; {
description = "Tutanota official desktop client";
homepage = "https://tutanota.com/";
license = licenses.gpl3Only;
maintainers = with maintainers; [ wolfangaukang ];
platforms = [ "x86_64-linux" ];
};
}