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

79 lines
2.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, lib, qtbase, qtmultimedia, qtsvg, qtdeclarative, qttools, full
, libsecret, libGL, libpulseaudio, glib, wrapQtAppsHook, makeDesktopItem }:
2018-08-02 10:47:09 +01:00
let
2019-05-28 11:19:11 +01:00
version = "1.1.5-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
'';
desktopItem = makeDesktopItem {
name = "protonmail-bridge";
exec = "protonmail-bridge";
icon = "protonmail-bridge";
2018-08-02 10:47:09 +01:00
comment = stdenv.lib.replaceStrings ["\n"] [" "] description;
desktopName = "ProtonMail Bridge";
genericName = "ProtonMail Bridge for Linux";
categories = "Utility;Security;Network;Email";
};
in stdenv.mkDerivation rec {
name = "protonmail-bridge-${version}";
src = fetchurl {
url = "https://protonmail.com/download/protonmail-bridge_${version}_amd64.deb";
2019-05-28 11:19:11 +01:00
sha256 = "1y5mphrs60zd6km9z64vskk70q9zzw4g6js7qvgl572wv81w2l75";
2018-08-02 10:47:09 +01:00
};
nativeBuildInputs = [ wrapQtAppsHook ];
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/applications}
mkdir -p $out/share/{applications,icons/hicolor/scalable/apps}
2018-08-02 10:47:09 +01:00
cp -r usr/lib/protonmail/bridge/protonmail-bridge $out/lib
cp usr/share/icons/protonmail/ProtonMail_Bridge.svg $out/share/icons/hicolor/scalable/apps/protonmail-bridge.svg
2018-08-02 10:47:09 +01:00
cp ${desktopItem}/share/applications/* $out/share/applications
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
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
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;
};
}