2017-06-01 09:06:20 +02:00
|
|
|
{ dpkg, fetchurl, lib, pkgs, stdenv, config
|
2017-05-08 01:05:53 +02:00
|
|
|
, alsaLib
|
|
|
|
, atk
|
|
|
|
, cairo
|
2017-06-01 09:06:20 +02:00
|
|
|
, coreutils
|
2017-05-08 01:05:53 +02:00
|
|
|
, cups
|
2017-06-01 09:06:20 +02:00
|
|
|
, dbus
|
|
|
|
, desktop_file_utils
|
2017-05-08 01:05:53 +02:00
|
|
|
, expat
|
2017-06-01 09:06:20 +02:00
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, gcc-unwrapped
|
|
|
|
, gdk_pixbuf
|
|
|
|
, glib
|
|
|
|
, gnome2
|
2017-05-08 01:05:53 +02:00
|
|
|
, libgcrypt
|
2017-06-01 09:06:20 +02:00
|
|
|
, libgnome_keyring
|
|
|
|
, libnotify
|
2017-05-08 01:05:53 +02:00
|
|
|
, makeWrapper
|
2017-06-01 09:06:20 +02:00
|
|
|
, nodejs
|
|
|
|
, nspr
|
|
|
|
, nss
|
|
|
|
, pango
|
|
|
|
, python2
|
|
|
|
, udev
|
|
|
|
, wget
|
|
|
|
, xorg
|
2017-05-08 01:05:53 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-06-01 09:06:20 +02:00
|
|
|
name = "${pkgname}-${version}";
|
2017-07-06 01:28:01 +02:00
|
|
|
pkgname = "nylas-mail-bin";
|
2017-06-01 09:06:20 +02:00
|
|
|
version = "2.0.32";
|
|
|
|
subVersion = "fec7941";
|
2017-05-08 01:05:53 +02:00
|
|
|
|
2017-06-01 09:06:20 +02:00
|
|
|
src =
|
|
|
|
if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
|
|
|
url = "https://edgehill.s3-us-west-2.amazonaws.com/${version}-${subVersion}/linux-deb/x64/NylasMail.deb";
|
|
|
|
sha256 = "40060aa1dc3b5187b8ed4a07b9de3427e3c5a291df98c2c82395647fa2aa4ada";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
throw "NylasMail is not supported on ${stdenv.system}";
|
2017-05-08 01:05:53 +02:00
|
|
|
|
2017-06-01 09:06:20 +02:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
coreutils
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
desktop_file_utils
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gcc-unwrapped
|
|
|
|
gdk_pixbuf
|
|
|
|
glib
|
|
|
|
gnome2.GConf
|
|
|
|
gnome2.gtk
|
|
|
|
libgnome_keyring
|
|
|
|
libnotify
|
|
|
|
nodejs
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
pango
|
|
|
|
python2
|
|
|
|
udev
|
|
|
|
wget
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXScrnSaver
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXtst
|
|
|
|
xorg.libxkbfile
|
|
|
|
];
|
2017-05-08 01:05:53 +02:00
|
|
|
|
|
|
|
|
2017-06-28 01:19:49 +02:00
|
|
|
buildInputs = [ gnome2.gnome_keyring ];
|
2017-05-08 01:05:53 +02:00
|
|
|
|
2017-06-28 01:19:49 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
2017-05-08 01:05:53 +02:00
|
|
|
mkdir -p $out
|
|
|
|
|
|
|
|
${dpkg}/bin/dpkg-deb -x $src unpacked
|
|
|
|
mv unpacked/usr/* $out/
|
|
|
|
|
|
|
|
# Fix path in desktop file
|
|
|
|
substituteInPlace $out/share/applications/nylas-mail.desktop \
|
2017-06-01 09:06:20 +02:00
|
|
|
--replace /usr/bin/nylas-mail $out/bin/nylas-mail
|
2017-05-08 01:05:53 +02:00
|
|
|
|
2017-06-01 09:06:20 +02:00
|
|
|
# Patch librariess
|
|
|
|
noderp=$(patchelf --print-rpath $out/share/nylas-mail/libnode.so)
|
|
|
|
patchelf --set-rpath $noderp:$out/lib:${stdenv.cc.cc.lib}/lib:${xorg.libxkbfile.out}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
|
|
|
|
$out/share/nylas-mail/libnode.so
|
2017-05-08 01:05:53 +02:00
|
|
|
|
2017-06-01 09:06:20 +02:00
|
|
|
ffrp=$(patchelf --print-rpath $out/share/nylas-mail/libffmpeg.so)
|
|
|
|
patchelf --set-rpath $ffrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
|
|
|
|
$out/share/nylas-mail/libffmpeg.so
|
2017-05-08 01:05:53 +02:00
|
|
|
|
2017-06-01 09:06:20 +02:00
|
|
|
# Patch binaries
|
|
|
|
binrp=$(patchelf --print-rpath $out/share/nylas-mail/nylas)
|
2017-06-29 07:29:49 +02:00
|
|
|
patchelf --interpreter $(cat "$NIX_CC"/nix-support/dynamic-linker) \
|
2017-06-01 09:06:20 +02:00
|
|
|
--set-rpath $binrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
|
|
|
|
$out/share/nylas-mail/nylas
|
2017-05-08 01:05:53 +02:00
|
|
|
|
|
|
|
wrapProgram $out/share/nylas-mail/nylas --set LD_LIBRARY_PATH "${xorg.libxkbfile}/lib:${pkgs.gnome3.libgnome_keyring}/lib";
|
|
|
|
|
|
|
|
# Fix path to bash so apm can install plugins.
|
|
|
|
substituteInPlace $out/share/nylas-mail/resources/apm/bin/apm \
|
2017-06-01 09:06:20 +02:00
|
|
|
--replace /bin/bash ${stdenv.shell}
|
2017-05-08 01:05:53 +02:00
|
|
|
|
|
|
|
wrapProgram $out/share/nylas-mail/resources/apm/bin/apm \
|
2017-06-01 09:06:20 +02:00
|
|
|
--set PATH "${coreutils}/bin"
|
2017-06-29 07:29:49 +02:00
|
|
|
patchelf --interpreter $(cat "$NIX_CC"/nix-support/dynamic-linker) \
|
2017-06-01 09:06:20 +02:00
|
|
|
--set-rpath ${gcc-unwrapped.lib}/lib $out/share/nylas-mail/resources/apm/bin/node
|
|
|
|
'';
|
2017-05-08 01:05:53 +02:00
|
|
|
|
2017-06-01 09:06:20 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Open-source mail client built on the modern web with Electron, React, and Flux";
|
|
|
|
longDescription = ''
|
2017-07-06 01:28:01 +02:00
|
|
|
Nylas Mail is an open-source mail client built on the modern web with Electron, React, and Flux. It is designed to be extensible, so it's easy to create new experiences and workflows around email. Nylas Mail can be enabled with it's requirements by enabling 'services.nylas-mail.enable=true'. Alternatively, make sure to have services.gnome3.gnome-keyring.enable = true; in your configuration.nix before running nylas-mail. If you happen to miss this step, you should remove ~/.nylas-mail and "~/.config/Nylas Mail" for a blank setup".
|
2017-06-01 09:06:20 +02:00
|
|
|
'';
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ johnramsden ];
|
|
|
|
homepage = https://nylas.com;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
2017-05-08 01:05:53 +02:00
|
|
|
}
|