@@ -1,133 +0,0 @@
1−{ dpkg, fetchurl, lib, pkgs, stdenv
2−, alsaLib
3−, atk
4−, cairo
5−, coreutils
6−, cups
7−, dbus
8−, desktop-file-utils
9−, expat
10−, fontconfig
11−, freetype
12−, gcc-unwrapped
13−, gdk-pixbuf
14−, glib
15−, gnome2
16−, libgnome-keyring
17−, libnotify
18−, makeWrapper
19−, nodejs
20−, nspr
21−, nss
22−, pango
23−, python2
24−, udev
25−, wget
26−, xorg
27−}:
28−
29−stdenv.mkDerivation rec {
30− name = "${pkgname}-${version}";
31− pkgname = "nylas-mail-bin";
32− version = "2.0.32";
33− subVersion = "fec7941";
34−
35− src =
36− if stdenv.hostPlatform.system == "x86_64-linux" then
37− fetchurl {
38− url = "https://edgehill.s3.amazonaws.com/${version}-${subVersion}/linux-deb/x64/NylasMail.deb";
39− sha256 = "40060aa1dc3b5187b8ed4a07b9de3427e3c5a291df98c2c82395647fa2aa4ada";
40− }
41− else
42− throw "NylasMail is not supported on ${stdenv.hostPlatform.system}";
43−
44− propagatedBuildInputs = [
45− alsaLib
46− atk
47− cairo
48− coreutils
49− cups
50− dbus
51− desktop-file-utils
52− expat
53− fontconfig
54− freetype
55− gcc-unwrapped
56− gdk-pixbuf
57− glib
58− gnome2.GConf
59− gnome2.gtk
60− libgnome-keyring
61− libnotify
62− nodejs
63− nspr
64− nss
65− pango
66− python2
67− udev
68− wget
69− xorg.libX11
70− xorg.libXScrnSaver
71− xorg.libXcomposite
72− xorg.libXcursor
73− xorg.libXdamage
74− xorg.libXext
75− xorg.libXfixes
76− xorg.libXi
77− xorg.libXrandr
78− xorg.libXrender
79− xorg.libXtst
80− xorg.libxkbfile
81− ];
82−
83−
84− nativeBuildInputs = [ makeWrapper ];
85−
86− buildCommand = ''
87− mkdir -p $out
88−
89− ${dpkg}/bin/dpkg-deb -x $src unpacked
90− mv unpacked/usr/* $out/
91−
92− # Fix path in desktop file
93− substituteInPlace $out/share/applications/nylas-mail.desktop \
94− --replace /usr/bin/nylas-mail $out/bin/nylas-mail
95−
96− # Patch librariess
97− noderp=$(patchelf --print-rpath $out/share/nylas-mail/libnode.so)
98− patchelf --set-rpath $noderp:$out/lib:${stdenv.cc.cc.lib}/lib:${xorg.libxkbfile.out}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
99− $out/share/nylas-mail/libnode.so
100−
101− ffrp=$(patchelf --print-rpath $out/share/nylas-mail/libffmpeg.so)
102− patchelf --set-rpath $ffrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
103− $out/share/nylas-mail/libffmpeg.so
104−
105− # Patch binaries
106− binrp=$(patchelf --print-rpath $out/share/nylas-mail/nylas)
107− patchelf --interpreter $(cat "$NIX_CC"/nix-support/dynamic-linker) \
108− --set-rpath $binrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
109− $out/share/nylas-mail/nylas
110−
111− wrapProgram $out/share/nylas-mail/nylas --set LD_LIBRARY_PATH "${xorg.libxkbfile}/lib:${pkgs.gnome3.libgnome-keyring}/lib";
112−
113− # Fix path to bash so apm can install plugins.
114− substituteInPlace $out/share/nylas-mail/resources/apm/bin/apm \
115− --replace /bin/bash ${stdenv.shell}
116−
117− wrapProgram $out/share/nylas-mail/resources/apm/bin/apm \
118− --set PATH "${coreutils}/bin"
119− patchelf --interpreter $(cat "$NIX_CC"/nix-support/dynamic-linker) \
120− --set-rpath ${gcc-unwrapped.lib}/lib $out/share/nylas-mail/resources/apm/bin/node
121− '';
122−
123− meta = with stdenv.lib; {
124− description = "Open-source mail client built on the modern web with Electron, React, and Flux";
125− longDescription = ''
126− 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".
127− '';
128− license = licenses.gpl3;
129− maintainers = with maintainers; [ johnramsden ];
130− homepage = https://nylas.com;
131− platforms = [ "x86_64-linux" ];
132− };
133−}