about summary refs log tree commit diff
path: root/pkgs/applications/networking/protonmail-bridge
diff options
context:
space:
mode:
authorArthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>2023-02-24 13:52:21 +0100
committerArthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>2023-02-25 01:41:39 +0100
commit47782b16c5024cf775230ae0a659fab20b2a6efe (patch)
treee61f673f1c431444de1856730d2b039ad1b3ac6b /pkgs/applications/networking/protonmail-bridge
parent8b2f23ff26880188b5a53414eb39205b9e378ddc (diff)
protonmail-bridge: 2.3.0 -> 3.0.18
Update protonmail-bridge to v3. This also rename the CLI executable from
protonmail-bridge to bridge to be more in line with upstream naming.

Co-authored-by: James Landrein <github@j4m3s.eu>
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
Diffstat (limited to 'pkgs/applications/networking/protonmail-bridge')
-rw-r--r--pkgs/applications/networking/protonmail-bridge/default.nix41
1 files changed, 24 insertions, 17 deletions
diff --git a/pkgs/applications/networking/protonmail-bridge/default.nix b/pkgs/applications/networking/protonmail-bridge/default.nix
index bdf75f6440e2e..5dc7779e12e90 100644
--- a/pkgs/applications/networking/protonmail-bridge/default.nix
+++ b/pkgs/applications/networking/protonmail-bridge/default.nix
@@ -2,44 +2,51 @@
 
 buildGoModule rec {
   pname = "protonmail-bridge";
-  version = "2.3.0";
+  version = "3.0.18";
 
   src = fetchFromGitHub {
     owner = "ProtonMail";
     repo = "proton-bridge";
-    rev = "br-${version}";
-    sha256 = "sha256-7p+Q6/BphE/dxNQe+gfcIty6TAWHUcPpvSJWfmf4OQg=";
+    rev = "v${version}";
+    hash = "sha256-0gQnMhjwW2NEJwafqndStQ33dIu82lW6ntXFRCpbmm4=";
   };
 
-  vendorSha256 = "sha256-dhrn6xQ0IJzBYeO6ko2PUCO+idopC2An0ylqCnx5jKg=";
+  vendorHash = "sha256-lHMcVcaoBwjE2ikEZPeZexC5XvhkAtvHnDci7UAa4vg=";
 
   nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ libsecret ];
 
-  buildPhase = ''
-    runHook preBuild
+  proxyVendor = true; # Bridge uses some C headers so we have to enable proxyVendor
 
+  preBuild = ''
     patchShebangs ./utils/
-    make BUILD_TIME= -j$NIX_BUILD_CORES build-nogui
-
-    runHook postBuild
+    (cd ./utils/ && ./credits.sh bridge)
   '';
 
-  installPhase = ''
-    runHook preInstall
-
-    install -Dm555 proton-bridge $out/bin/protonmail-bridge
-
-    runHook postInstall
+  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 = ''
+    mv $out/bin/Desktop-Bridge $out/bin/bridge # The cli is named like that in the upstream repo
   '';
 
   meta = with lib; {
     homepage = "https://github.com/ProtonMail/proton-bridge";
-    changelog = "https://github.com/ProtonMail/proton-bridge/blob/master/Changelog.md";
+    changelog = "https://github.com/ProtonMail/proton-bridge/blob/${src.rev}/Changelog.md";
     downloadPage = "https://github.com/ProtonMail/proton-bridge/releases";
     license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ lightdiscord ];
+    maintainers = with maintainers; [ mrfreezeex ];
     description = "Use your ProtonMail account with your local e-mail client";
     longDescription = ''
       An application that runs on your computer in the background and seamlessly encrypts