2021-10-15 18:55:25 +00:00
|
|
|
{ stdenv, lib, fetchurl, makeDesktopItem, copyDesktopItems, makeWrapper,
|
|
|
|
electron, libsecret }:
|
2021-10-04 01:51:29 +00:00
|
|
|
|
2021-10-15 18:55:25 +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-15 18:55:25 +00:00
|
|
|
|
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";
|
2021-10-15 18:55:25 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2021-10-15 18:55:25 +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
|
|
|
|
2021-10-15 18:55:25 +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
|
|
|
|
2021-10-15 18:55:25 +00:00
|
|
|
makeWrapper ${electron}/bin/electron \
|
|
|
|
$out/bin/tutanota-desktop \
|
|
|
|
--add-flags $out/share/tutanota-desktop/resources/app.asar \
|
2022-12-22 23:31:13 +00:00
|
|
|
--run "mkdir -p /tmp/tutanota" \
|
2021-10-15 18:55:25 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libsecret ]}
|
2021-10-04 01:51:29 +00:00
|
|
|
|
2021-10-15 18:55:25 +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" ];
|
|
|
|
};
|
|
|
|
}
|