From 260db819e7d507dec6325569b34b80ac1a00abb4 Mon Sep 17 00:00:00 2001 From: xeals Date: Thu, 11 Nov 2021 22:40:25 +1100 Subject: [PATCH] protonmail-bridge: update build args --- .../networking/protonmail-bridge/common.nix | 20 ++++++--------- .../networking/protonmail-bridge/headless.nix | 25 +++++-------------- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/pkgs/applications/networking/protonmail-bridge/common.nix b/pkgs/applications/networking/protonmail-bridge/common.nix index e10641a..8bf4825 100644 --- a/pkgs/applications/networking/protonmail-bridge/common.nix +++ b/pkgs/applications/networking/protonmail-bridge/common.nix @@ -31,19 +31,13 @@ buildGoModule (lib.recursiveUpdate args rec { 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 - '' - ]; + inherit tags; + + ldflags = [ + "-X github.com/ProtonMail/proton-bridge/pkg/constants.Version=${version}" + "-X github.com/ProtonMail/proton-bridge/pkg/constants.Revision=${version}" + "-X github.com/ProtonMail/proton-bridge/pkg/constants.BuildDate=unknown" + ]; meta = with lib; { description = "Integrate ProtonMail paid account with any program that supports IMAP and SMTP"; diff --git a/pkgs/applications/networking/protonmail-bridge/headless.nix b/pkgs/applications/networking/protonmail-bridge/headless.nix index 6493b14..0371fdd 100644 --- a/pkgs/applications/networking/protonmail-bridge/headless.nix +++ b/pkgs/applications/networking/protonmail-bridge/headless.nix @@ -1,30 +1,17 @@ {}: -rec { +{ pname = "protonmail-bridge-headless"; - tags = "pmapi_prod nogui"; + tags = [ "pmapi_prod" "nogui" ]; - # FIXME: There's something fucky going on in the buildFlagsArray - # substitution. I shouldn't need to do this. - buildPhase = - 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 - ''; + # REVIEW: Some issue with IMAP tests that probably fail due to network + # sandboxing. + doCheck = false; # Fix up name. postInstall = '' mv $out/bin/Desktop-Bridge $out/bin/protonmail-bridge + mv $out/bin/Import-Export $out/bin/protonmail-import-export ''; }