nixpkgs/pkgs/applications/networking/mailreaders/electron-mail/default.nix
Peder Bergebakken Sundt 985aa8174d treewide: unbreak appimageTools.wrapType2 builds
`appimageTools.wrapType2` no longer creates a binary `$out/bin/${name}` if `pname` and `version` is provided.
Derivations that have worked around this behavior with a `mv $out/bin/{${name},${pname}}` broke as a result.
This should fix most instances.

contex: #271071
2024-04-24 15:26:52 +02:00

37 lines
1.1 KiB
Nix

{ appimageTools, lib, fetchurl, libsecret }:
let
pname = "electron-mail";
version = "5.1.8";
src = fetchurl {
url = "https://github.com/vladimiry/ElectronMail/releases/download/v${version}/electron-mail-${version}-linux-x86_64.AppImage";
sha256 = "sha256-btqlxFrQUyb728i99IE65A9jwEFNvJ5b6zji0kwwATU=";
};
appimageContents = appimageTools.extract { inherit pname version src; };
in appimageTools.wrapType2 {
inherit pname version src;
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
cp -r ${appimageContents}/usr/share/icons $out/share
'';
extraPkgs = pkgs: with pkgs; [
libsecret
libappindicator-gtk3
];
meta = with lib; {
description = "ElectronMail is an Electron-based unofficial desktop client for ProtonMail";
mainProgram = "electron-mail";
homepage = "https://github.com/vladimiry/ElectronMail";
license = licenses.gpl3;
maintainers = [ maintainers.princemachiavelli ];
platforms = [ "x86_64-linux" ];
};
}