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-07-27 06:49:29 +00:00
|
|
|
version = "3.12.0";
|
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-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-3nEf9maHDd2LmRpgRqvFOub2DQNvjP3iEBRUlpvo8yg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
vendorHash = "sha256-c8KNdENF0wRQ0Ssv6mgnZkY4BOcEoY7r80/hd7XJ5yo=";
|
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
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
meta = {
|
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
|
|
|
description = "Use your ProtonMail account with your local e-mail client";
|
2024-04-21 15:54:59 +00:00
|
|
|
downloadPage = "https://github.com/ProtonMail/proton-bridge/releases";
|
|
|
|
homepage = "https://github.com/ProtonMail/proton-bridge";
|
|
|
|
license = lib.licenses.gpl3Plus;
|
2020-11-30 08:33:03 +00:00
|
|
|
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";
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with lib.maintainers; [ mrfreezeex daniel-fahey ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|