Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. { stdenv, fetchurl, dpkg, makeDesktopItem, autoPatchelfHook, wrapGAppsHook
  2. , alsaLib, atk, at-spi2-atk, cairo, cups, dbus, expat, fontconfig, freetype, gdk_pixbuf
  3. , glib, gtk3, libnotify, libX11, libXcomposite, libXcursor, libXdamage, libuuid
  4. , libXext, libXfixes, libXi, libXrandr, libXrender, libXtst, nspr, nss, libxcb
  5. , pango, systemd, libXScrnSaver, libcxx, libpulseaudio }:
  6.  
  7. stdenv.mkDerivation rec {
  8. pname = "mailspring";
  9. version = "1.6.0";
  10. name = "${pname}-${version}";
  11.  
  12. src = fetchurl {
  13. url = "https://github.com/Foundry376/Mailspring/releases/download/${version}/mailspring-${version}-amd64.deb";
  14. sha256 = "1y93f85i9v711sa6pifixvv0p08jr6rgs6bbfsv0mb0zvn5vf3dm";
  15. };
  16.  
  17. nativeBuildInputs = [ dpkg wrapGAppsHook ];
  18.  
  19. dontWrapGApps = true;
  20.  
  21. libPath = stdenv.lib.makeLibraryPath [
  22. libcxx systemd libpulseaudio
  23. stdenv.cc.cc alsaLib atk at-spi2-atk cairo cups dbus expat fontconfig freetype
  24. gdk_pixbuf glib gtk3 libnotify libX11 libXcomposite libuuid
  25. libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender
  26. libXtst nspr nss libxcb pango systemd libXScrnSaver
  27. ];
  28.  
  29. unpackPhase = ''
  30. dpkg-deb -x $src .
  31. '';
  32.  
  33. installPhase = ''
  34. echo $out
  35. mkdir -p $out/{share,bin}
  36.  
  37. mv usr/share/{icons,mailspring,pixmaps} $out/share
  38. mv usr/bin/* $out/bin
  39.  
  40. patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
  41. $out/bin/mailspring
  42.  
  43. # makeWrapper $out/opt/Mailspring/mailspring $out/bin/mailspring \
  44. # "''${gappsWrapperArgs[@]}" \
  45. # --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
  46. # --prefix LD_LIBRARY_PATH : ${libPath}
  47.  
  48. # mv usr/share/icons $out/share/
  49. ln -s "${desktopItem}/share/applications" $out/share/
  50. '';
  51.  
  52. desktopItem = makeDesktopItem {
  53. name = pname;
  54. desktopName = "Mailspring";
  55. comment = meta.description;
  56. exec = "${pname} %U";
  57. terminal = "false";
  58. type = "Application";
  59. icon = "mailspring";
  60. categories = "Application;Network;";
  61. extraEntries = ''
  62. StartupWMClass=Mailspring
  63. '';
  64. };
  65.  
  66. meta = with stdenv.lib; {
  67. description = "A beautiful, fast and maintained fork of nylas Mail by one of the original authors.";
  68. homepage = https://getmailspring.com/;
  69. downloadPage = https://github.com/Foundry376/Mailspring/releases/latest;
  70. license = licenses.gnu;
  71. maintainers = with maintainers; [ jakestanger ];
  72. platforms = [ "x86_64-linux" ];
  73. };
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement