protonmail-bridge: update build args

This commit is contained in:
xeals 2021-11-11 22:40:25 +11:00
parent ba5c904cb7
commit 260db819e7
2 changed files with 13 additions and 32 deletions

View File

@ -31,19 +31,13 @@ buildGoModule (lib.recursiveUpdate args rec {
libsecret libsecret
]; ];
buildFlagsArray = inherit tags;
let
t = "github.com/ProtonMail/proton-bridge/pkg/constants"; ldflags = [
in "-X github.com/ProtonMail/proton-bridge/pkg/constants.Version=${version}"
[ "-X github.com/ProtonMail/proton-bridge/pkg/constants.Revision=${version}"
"-tags=${tags}" "-X github.com/ProtonMail/proton-bridge/pkg/constants.BuildDate=unknown"
'' ];
-ldflags=
-X ${t}.Version=${version}
-X ${t}.Revision=unknown
-X ${t}.BuildDate=unknown
''
];
meta = with lib; { meta = with lib; {
description = "Integrate ProtonMail paid account with any program that supports IMAP and SMTP"; description = "Integrate ProtonMail paid account with any program that supports IMAP and SMTP";

View File

@ -1,30 +1,17 @@
{}: {}:
rec { {
pname = "protonmail-bridge-headless"; pname = "protonmail-bridge-headless";
tags = "pmapi_prod nogui"; tags = [ "pmapi_prod" "nogui" ];
# FIXME: There's something fucky going on in the buildFlagsArray # REVIEW: Some issue with IMAP tests that probably fail due to network
# substitution. I shouldn't need to do this. # sandboxing.
buildPhase = doCheck = false;
let
t = "github.com/ProtonMail/proton-bridge/pkg/constants";
in
''
runHook preBuild
go install \
-tags="${tags}" \
-ldflags="-X ${t}.Version=1.3.2 -X ${t}.Revision=unknown -X ${t}.BuildDate=unknown" \
cmd/Desktop-Bridge/main.go
mv $GOPATH/bin/main $GOPATH/bin/Desktop-Bridge
runHook postBuild
'';
# Fix up name. # Fix up name.
postInstall = '' postInstall = ''
mv $out/bin/Desktop-Bridge $out/bin/protonmail-bridge mv $out/bin/Desktop-Bridge $out/bin/protonmail-bridge
mv $out/bin/Import-Export $out/bin/protonmail-import-export
''; '';
} }