nur-packages/pkgs/applications/networking/protonmail-bridge/default.nix

71 lines
1.4 KiB
Nix
Raw Normal View History

2020-10-15 19:05:13 +11:00
{ stdenv
, lib
2020-10-15 19:05:13 +11:00
, fetchFromGitHub
, buildGoModule
, go
, goModules
2020-10-15 19:05:13 +11:00
, libsecret
, pkg-config
, qtbase
, qtdoc
}:
let
builder =
2020-10-15 19:05:13 +11:00
{ pname
, tags
, ...
}@args:
buildGoModule (lib.recursiveUpdate args rec {
2020-10-15 19:05:13 +11:00
inherit pname;
2021-01-24 16:45:54 +11:00
version = "1.5.6";
2020-10-15 19:05:13 +11:00
src = fetchFromGitHub {
owner = "ProtonMail";
repo = "proton-bridge";
2020-10-25 12:46:29 +11:00
rev = "br-${version}";
2021-01-24 16:45:54 +11:00
sha256 = "1na8min9cmn82lpad58abw6837k303fr09l6cvzswaxs73f231ig";
2020-10-15 19:05:13 +11:00
};
2021-01-24 16:45:54 +11:00
vendorSha256 = "1219xa1347877bfhnid15y6w9s4hf1czbrmll2iha4gpsmg066bb";
2020-10-15 19:05:13 +11:00
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [
pkg-config
];
buildInputs = (args.buildInputs or [ ]) ++ [
2020-10-15 19:05:13 +11:00
libsecret
];
buildFlagsArray =
let
t = "github.com/ProtonMail/proton-bridge/pkg/constants";
in
[
"-tags=${tags}"
''
-ldflags=
-X ${t}.Version=${version}
-X ${t}.Revision=unknown
-X ${t}.BuildDate=unknown
''
];
meta = with lib; {
2020-10-15 19:05:13 +11:00
description = "Integrate ProtonMail paid account with any program that supports IMAP and SMTP";
homepage = "https://protonmail.com";
license = licenses.gpl3;
plaforms = platforms.x86_64;
};
});
in
{
protonmail-bridge = builder (import ./app.nix { inherit qtbase go goModules; });
protonmail-bridge-headless = builder (import ./headless.nix { });
2020-10-15 19:05:13 +11:00
}