2020-10-15 19:05:13 +11:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildGoModule
|
|
|
|
|
|
|
|
, go
|
2020-10-15 21:49:24 +11:00
|
|
|
, goModules
|
2020-10-15 19:05:13 +11:00
|
|
|
, libsecret
|
|
|
|
, pkg-config
|
|
|
|
, qtbase
|
|
|
|
, qtdoc
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2020-10-15 21:49:24 +11:00
|
|
|
builder =
|
2020-10-15 19:05:13 +11:00
|
|
|
{ pname
|
|
|
|
, tags
|
|
|
|
, ...
|
|
|
|
}@args:
|
2020-10-15 21:49:24 +11:00
|
|
|
|
|
|
|
buildGoModule (stdenv.lib.recursiveUpdate args rec {
|
2020-10-15 19:05:13 +11:00
|
|
|
inherit pname;
|
2020-12-09 09:29:02 +11:00
|
|
|
version = "1.5.2";
|
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}";
|
2020-12-09 09:29:02 +11:00
|
|
|
sha256 = "1mv7fwapcarii43nnsgk7ifqlah07k54zk6vxxxmrp04gy0mzki6";
|
2020-10-15 19:05:13 +11:00
|
|
|
};
|
|
|
|
|
2020-12-09 09:29:02 +11:00
|
|
|
vendorSha256 = "01d6by8xj9py72lpfns08zqnsym98v8imb7d6hgmnzp4hfqzbz3c";
|
2020-10-15 19:05:13 +11:00
|
|
|
|
|
|
|
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [
|
|
|
|
pkg-config
|
2020-10-17 15:34:29 +11:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
''
|
|
|
|
];
|
|
|
|
|
2020-10-15 21:49:24 +11:00
|
|
|
meta = with stdenv.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
|
|
|
|
|
|
|
|
{
|
2020-10-15 21:49:24 +11:00
|
|
|
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
|
|
|
}
|