git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #25600 from johnramsden/nylas-mail

nylas-mail: 2.0.32

commit05aa2a58db2de248cc2ef516b21fa319ca72613e authorMichael Raskin <7c6f434c@mail.ru> dateThu 6 Jul 2017, 02:04 (9 years ago) parent8dee8d5c382079
4 files changed+176
lib/maintainers.nix+1 nixos/modules/programs/nylas-mail.nix+37 pkgs/applications/networking/mailreaders/nylas-mail-bin/default.nix+136 pkgs/top-level/all-packages.nix+2
lib/maintainers.nix+1
@@ -262,6 +262,7 @@
262262 joelmo = "Joel Moberg <joel.moberg@gmail.com>";
263263 joelteon = "Joel Taylor <me@joelt.io>";
264264 johbo = "Johannes Bornhold <johannes@bornhold.name>";
265+ johnramsden = "John Ramsden <johnramsden@riseup.net>";
265266 joko = "Ioannis Koutras <ioannis.koutras@gmail.com>";
266267 jonafato = "Jon Banafato <jon@jonafato.com>";
267268 jpbernardy = "Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>";
nixos/modules/programs/nylas-mail.nixnew file+37
@@ -0,0 +1,37 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+ cfg = config.services.nylas-mail;
7+ defaultUser = "nylas-mail";
8+in {
9+ ###### interface
10+ options = {
11+ services.nylas-mail = {
12+
13+ enable = mkEnableOption ''
14+ nylas-mail - Open-source mail client built on the modern web with Electron, React, and Flux
15+ '';
16+
17+ gnome3-keyring = mkOption {
18+ type = types.bool;
19+ default = true;
20+ description = "Enable gnome3 keyring for nylas-mail.";
21+ };
22+ };
23+ };
24+
25+
26+ ###### implementation
27+
28+ config = mkIf cfg.enable {
29+
30+ environment.systemPackages = [ pkgs.nylas-mail-bin ];
31+
32+ services.gnome3.gnome-keyring = mkIf cfg.gnome3-keyring {
33+ enable = true;
34+ };
35+
36+ };
37+}
pkgs/applications/networking/mailreaders/nylas-mail-bin/default.nixnew file+136
@@ -0,0 +1,136 @@
1+{ dpkg, fetchurl, lib, pkgs, stdenv, config
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+, libgcrypt
17+, libgnome_keyring
18+, libnotify
19+, makeWrapper
20+, nodejs
21+, nspr
22+, nss
23+, pango
24+, python2
25+, udev
26+, wget
27+, xorg
28+}:
29+
30+stdenv.mkDerivation rec {
31+ name = "${pkgname}-${version}";
32+ pkgname = "nylas-mail-bin";
33+ version = "2.0.32";
34+ subVersion = "fec7941";
35+
36+ src =
37+ if stdenv.system == "x86_64-linux" then
38+ fetchurl {
39+ url = "https://edgehill.s3-us-west-2.amazonaws.com/${version}-${subVersion}/linux-deb/x64/NylasMail.deb";
40+ sha256 = "40060aa1dc3b5187b8ed4a07b9de3427e3c5a291df98c2c82395647fa2aa4ada";
41+ }
42+ else
43+ throw "NylasMail is not supported on ${stdenv.system}";
44+
45+ propagatedBuildInputs = [
46+ alsaLib
47+ atk
48+ cairo
49+ coreutils
50+ cups
51+ dbus
52+ desktop_file_utils
53+ expat
54+ fontconfig
55+ freetype
56+ gcc-unwrapped
57+ gdk_pixbuf
58+ glib
59+ gnome2.GConf
60+ gnome2.gtk
61+ libgnome_keyring
62+ libnotify
63+ nodejs
64+ nspr
65+ nss
66+ pango
67+ python2
68+ udev
69+ wget
70+ xorg.libX11
71+ xorg.libXScrnSaver
72+ xorg.libXcomposite
73+ xorg.libXcursor
74+ xorg.libXdamage
75+ xorg.libXext
76+ xorg.libXfixes
77+ xorg.libXi
78+ xorg.libXrandr
79+ xorg.libXrender
80+ xorg.libXtst
81+ xorg.libxkbfile
82+ ];
83+
84+
85+ buildInputs = [ gnome2.gnome_keyring ];
86+
87+ nativeBuildInputs = [ makeWrapper ];
88+
89+ buildCommand = ''
90+ mkdir -p $out
91+
92+ ${dpkg}/bin/dpkg-deb -x $src unpacked
93+ mv unpacked/usr/* $out/
94+
95+ # Fix path in desktop file
96+ substituteInPlace $out/share/applications/nylas-mail.desktop \
97+ --replace /usr/bin/nylas-mail $out/bin/nylas-mail
98+
99+ # Patch librariess
100+ noderp=$(patchelf --print-rpath $out/share/nylas-mail/libnode.so)
101+ patchelf --set-rpath $noderp:$out/lib:${stdenv.cc.cc.lib}/lib:${xorg.libxkbfile.out}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
102+ $out/share/nylas-mail/libnode.so
103+
104+ ffrp=$(patchelf --print-rpath $out/share/nylas-mail/libffmpeg.so)
105+ patchelf --set-rpath $ffrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
106+ $out/share/nylas-mail/libffmpeg.so
107+
108+ # Patch binaries
109+ binrp=$(patchelf --print-rpath $out/share/nylas-mail/nylas)
110+ patchelf --interpreter $(cat "$NIX_CC"/nix-support/dynamic-linker) \
111+ --set-rpath $binrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
112+ $out/share/nylas-mail/nylas
113+
114+ wrapProgram $out/share/nylas-mail/nylas --set LD_LIBRARY_PATH "${xorg.libxkbfile}/lib:${pkgs.gnome3.libgnome_keyring}/lib";
115+
116+ # Fix path to bash so apm can install plugins.
117+ substituteInPlace $out/share/nylas-mail/resources/apm/bin/apm \
118+ --replace /bin/bash ${stdenv.shell}
119+
120+ wrapProgram $out/share/nylas-mail/resources/apm/bin/apm \
121+ --set PATH "${coreutils}/bin"
122+ patchelf --interpreter $(cat "$NIX_CC"/nix-support/dynamic-linker) \
123+ --set-rpath ${gcc-unwrapped.lib}/lib $out/share/nylas-mail/resources/apm/bin/node
124+ '';
125+
126+ meta = with stdenv.lib; {
127+ description = "Open-source mail client built on the modern web with Electron, React, and Flux";
128+ longDescription = ''
129+ 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".
130+ '';
131+ license = licenses.gpl3;
132+ maintainers = with maintainers; [ johnramsden ];
133+ homepage = https://nylas.com;
134+ platforms = [ "x86_64-linux" ];
135+ };
136+}
pkgs/top-level/all-packages.nix+2
@@ -16196,6 +16196,8 @@ with pkgs;
1619616196
1619716197 thinkingRock = callPackage ../applications/misc/thinking-rock { };
1619816198
16199+ nylas-mail-bin = callPackage ../applications/networking/mailreaders/nylas-mail-bin { };
16200+
1619916201 thunderbird = callPackage ../applications/networking/mailreaders/thunderbird {
1620016202 inherit (gnome2) libIDL;
1620116203 libpng = libpng_apng;