3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/protonmail-bridge/default.nix

74 lines
1.9 KiB
Nix
Raw Normal View History

2019-07-23 21:11:28 +01:00
{ stdenv, fetchurl, lib, qtbase, qtmultimedia, qtsvg, qtdeclarative, qttools, qtgraphicaleffects, qtquickcontrols2, full
, libsecret, libGL, libpulseaudio, glib, wrapQtAppsHook, mkDerivation }:
2018-08-02 10:47:09 +01:00
let
2019-09-07 18:19:07 +01:00
version = "1.2.2-1";
2018-08-02 10:47:09 +01:00
description = ''
An application that runs on your computer in the background and seamlessly encrypts
and decrypts your mail as it enters and leaves your computer.
To work, gnome-keyring service must be enabled.
2018-08-02 10:47:09 +01:00
'';
2019-08-13 22:52:01 +01:00
in mkDerivation {
2019-08-13 22:52:01 +01:00
pname = "protonmail-bridge";
inherit version;
2018-08-02 10:47:09 +01:00
src = fetchurl {
url = "https://protonmail.com/download/protonmail-bridge_${version}_amd64.deb";
2019-09-07 18:19:07 +01:00
sha256 = "16hfa07wdqcns79395wjdglg2cjyblqgz1hx8rl15qm7n5f24ckl";
2018-08-02 10:47:09 +01:00
};
sourceRoot = ".";
unpackCmd = ''
ar p "$src" data.tar.xz | tar xJ
'';
installPhase = ''
mkdir -p $out/{bin,lib,share}
2018-08-02 10:47:09 +01:00
cp -r usr/lib/protonmail/bridge/protonmail-bridge $out/lib
cp -r usr/share $out
2018-08-02 10:47:09 +01:00
ln -s $out/lib/protonmail-bridge $out/bin/protonmail-bridge
2018-08-02 10:47:09 +01:00
'';
postFixup = let
rpath = lib.makeLibraryPath [
stdenv.cc.cc.lib
qtbase
2019-07-23 21:11:28 +01:00
qtquickcontrols2
qtgraphicaleffects
2018-08-02 10:47:09 +01:00
qtmultimedia
qtsvg
qtdeclarative
qttools
libGL
libsecret
libpulseaudio
glib
];
in ''
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${rpath}" \
$out/lib/protonmail-bridge
substituteInPlace $out/share/applications/ProtonMail_Bridge.desktop \
--replace "/usr/" "$out/" \
--replace "Exec=protonmail-bridge" "Exec=$out/bin/protonmail-bridge"
2018-08-02 10:47:09 +01:00
'';
2019-07-23 21:11:28 +01:00
buildInputs = [ qtbase qtquickcontrols2 qtmultimedia qtgraphicaleffects qtdeclarative ];
2018-08-02 10:47:09 +01:00
meta = with stdenv.lib; {
2019-05-28 11:19:11 +01:00
homepage = "https://www.protonmail.com/bridge";
2018-08-02 10:47:09 +01:00
license = licenses.mit;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ lightdiscord ];
inherit description;
};
}