Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { stdenv, fetchurl, dpkg, makeDesktopItem, autoPatchelfHook, wrapGAppsHook
- , alsaLib, atk, at-spi2-atk, cairo, cups, dbus, expat, fontconfig, freetype, gdk_pixbuf
- , glib, gtk3, libnotify, libX11, libXcomposite, libXcursor, libXdamage, libuuid
- , libXext, libXfixes, libXi, libXrandr, libXrender, libXtst, nspr, nss, libxcb
- , pango, systemd, libXScrnSaver, libcxx, libpulseaudio }:
- stdenv.mkDerivation rec {
- pname = "mailspring";
- version = "1.6.0";
- name = "${pname}-${version}";
- src = fetchurl {
- url = "https://github.com/Foundry376/Mailspring/releases/download/${version}/mailspring-${version}-amd64.deb";
- sha256 = "1y93f85i9v711sa6pifixvv0p08jr6rgs6bbfsv0mb0zvn5vf3dm";
- };
- nativeBuildInputs = [ dpkg wrapGAppsHook ];
- dontWrapGApps = true;
- libPath = stdenv.lib.makeLibraryPath [
- libcxx systemd libpulseaudio
- stdenv.cc.cc alsaLib atk at-spi2-atk cairo cups dbus expat fontconfig freetype
- gdk_pixbuf glib gtk3 libnotify libX11 libXcomposite libuuid
- libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender
- libXtst nspr nss libxcb pango systemd libXScrnSaver
- ];
- unpackPhase = ''
- dpkg-deb -x $src .
- '';
- installPhase = ''
- echo $out
- mkdir -p $out/{share,bin}
- mv usr/share/{icons,mailspring,pixmaps} $out/share
- mv usr/bin/* $out/bin
- patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
- $out/bin/mailspring
- # makeWrapper $out/opt/Mailspring/mailspring $out/bin/mailspring \
- # "''${gappsWrapperArgs[@]}" \
- # --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
- # --prefix LD_LIBRARY_PATH : ${libPath}
- # mv usr/share/icons $out/share/
- ln -s "${desktopItem}/share/applications" $out/share/
- '';
- desktopItem = makeDesktopItem {
- name = pname;
- desktopName = "Mailspring";
- comment = meta.description;
- exec = "${pname} %U";
- terminal = "false";
- type = "Application";
- icon = "mailspring";
- categories = "Application;Network;";
- extraEntries = ''
- StartupWMClass=Mailspring
- '';
- };
- meta = with stdenv.lib; {
- description = "A beautiful, fast and maintained fork of nylas Mail by one of the original authors.";
- homepage = https://getmailspring.com/;
- downloadPage = https://github.com/Foundry376/Mailspring/releases/latest;
- license = licenses.gnu;
- maintainers = with maintainers; [ jakestanger ];
- platforms = [ "x86_64-linux" ];
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement