17 stdenv.mkDerivation (finalAttrs: {
18 pname = "protonmail-bridge-gui";
20 inherit (protonmail-bridge) version src;
23 # Use `gtest` from Nixpkgs to allow an offline build
24 ./use-nix-googletest.patch
47 sourceRoot = "${finalAttrs.src.name}/internal/frontend/bridge-gui";
50 # Bypass `vcpkg` by deleting lines that `include` BridgeSetup.cmake
51 find . -type f -name "CMakeLists.txt" -exec sed -i "/BridgeSetup\\.cmake/d" {} \;
53 # Use the available ICU version
54 sed -i "s/libicu\(i18n\|uc\|data\)\.so\.56/libicu\1.so/g" bridge-gui/DeployLinux.cmake
56 # Create a Desktop Entry that uses a `protonmail-bridge-gui` binary without upstream's launcher
57 sed "s/^\(Icon\|Exec\)=.*$/\1=protonmail-bridge-gui/" ../../../dist/proton-bridge.desktop > proton-bridge-gui.desktop
59 # Also update `StartupWMClass` to match the GUI binary's `wmclass` (Wayland app id)
60 sed -i "s/^\(StartupWMClass=\)Proton Mail Bridge$/\1ch.proton.bridge-gui/" proton-bridge-gui.desktop
62 # Don't build `bridge-gui-tester`
63 sed -i "/add_subdirectory(bridge-gui-tester)/d" CMakeLists.txt
67 "-DBRIDGE_APP_FULL_NAME=Proton Mail Bridge"
68 "-DBRIDGE_VENDOR=Proton AG"
69 "-DBRIDGE_REVISION=${finalAttrs.src.rev}"
70 "-DBRIDGE_TAG=${finalAttrs.version}"
71 "-DBRIDGE_BUILD_ENV=Nix"
72 "-DBRIDGE_APP_VERSION=${finalAttrs.version}"
78 # Install the GUI binary
79 install -Dm755 bridge-gui/bridge-gui $out/lib/bridge-gui
81 # Symlink the backend binary from the protonmail-bridge (CLI) package
82 ln -s ${protonmail-bridge}/bin/protonmail-bridge $out/lib/bridge
84 # Symlink the GUI binary
86 ln -s $out/lib/bridge-gui $out/bin/protonmail-bridge-gui
88 # Install desktop assets
89 install -Dm644 ../proton-bridge-gui.desktop -t $out/share/applications
90 install -Dm644 ../../../../dist/bridge.svg $out/share/icons/hicolor/scalable/apps/protonmail-bridge-gui.svg
96 changelog = "https://github.com/ProtonMail/proton-bridge/blob/${finalAttrs.src.rev}/Changelog.md";
97 description = "Qt-based GUI to use your ProtonMail account with your local e-mail client";
98 downloadPage = "https://github.com/ProtonMail/proton-bridge/releases";
99 homepage = "https://github.com/ProtonMail/proton-bridge";
100 license = lib.licenses.gpl3Plus;
102 Provides a GUI application that runs in the background and seamlessly encrypts
103 and decrypts your mail as it enters and leaves your computer.
105 To work, use secret-service freedesktop.org API (e.g. Gnome keyring) or pass.
107 mainProgram = "protonmail-bridge-gui";
108 maintainers = with lib.maintainers; [ daniel-fahey ];
109 platforms = lib.platforms.linux;