2020-11-30 08:33:03 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, pkg-config, libsecret }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "protonmail-bridge";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "3.8.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ProtonMail";
|
|
|
|
repo = "proton-bridge";
|
2023-03-04 12:14:45 +00:00
|
|
|
rev = "v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-deddWAguDyUVhW31MIBNC850qeVOQYeBux8W66Diee4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
vendorHash = "sha256-6xofWf5WFE1wuCwx8iOMcC3gxDzZB3uw3WErLWluBM8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
buildInputs = [ libsecret ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
preBuild = ''
|
2021-04-05 15:23:46 +00:00
|
|
|
patchShebangs ./utils/
|
2023-03-04 12:14:45 +00:00
|
|
|
(cd ./utils/ && ./credits.sh bridge)
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
ldflags =
|
|
|
|
let constants = "github.com/ProtonMail/proton-bridge/v3/internal/constants"; in
|
|
|
|
[
|
|
|
|
"-X ${constants}.Version=${version}"
|
|
|
|
"-X ${constants}.Revision=${src.rev}"
|
|
|
|
"-X ${constants}.buildTime=unknown"
|
|
|
|
"-X ${constants}.FullAppName=ProtonMailBridge" # Should be "Proton Mail Bridge", but quoting doesn't seems to work in nix's ldflags
|
|
|
|
];
|
|
|
|
|
|
|
|
subPackages = [
|
|
|
|
"cmd/Desktop-Bridge"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-03-30 22:05:00 +00:00
|
|
|
mv $out/bin/Desktop-Bridge $out/bin/protonmail-bridge # The cli is named like that in other distro packages
|
2024-01-02 11:29:13 +00:00
|
|
|
install -Dm444 dist/proton-bridge.desktop -t $out/share/applications
|
|
|
|
install -Dm444 dist/bridge.svg $out/share/icons/hicolor/scalable/apps/protonmail-bridge.svg
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/ProtonMail/proton-bridge";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/ProtonMail/proton-bridge/blob/${src.rev}/Changelog.md";
|
2020-11-30 08:33:03 +00:00
|
|
|
downloadPage = "https://github.com/ProtonMail/proton-bridge/releases";
|
2021-04-05 15:23:46 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2023-03-04 12:14:45 +00:00
|
|
|
maintainers = with maintainers; [ mrfreezeex ];
|
2020-11-30 08:33:03 +00:00
|
|
|
description = "Use your ProtonMail account with your local e-mail client";
|
|
|
|
longDescription = ''
|
|
|
|
An application that runs on your computer in the background and seamlessly encrypts
|
|
|
|
and decrypts your mail as it enters and leaves your computer.
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
To work, use secret-service freedesktop.org API (e.g. Gnome keyring) or pass.
|
2020-11-30 08:33:03 +00:00
|
|
|
'';
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "protonmail-bridge";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|