nixpkgs/pkgs/applications/networking/mailreaders/mailspring/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

101 lines
2.0 KiB
Nix
Raw Normal View History

2020-04-18 11:14:45 +00:00
{ stdenv
, lib
2020-04-18 11:14:45 +00:00
, fetchurl
, autoPatchelfHook
, alsa-lib
2020-04-18 11:14:45 +00:00
, coreutils
, db
, dpkg
, glib
, gtk3
2021-06-17 23:02:30 +00:00
, wrapGAppsHook
2020-04-18 11:14:45 +00:00
, libkrb5
, libsecret
, nss
, openssl
, udev
, xorg
2022-04-01 10:03:26 +00:00
, mesa
, libdrm
2020-04-18 11:14:45 +00:00
}:
stdenv.mkDerivation rec {
pname = "mailspring";
2022-04-01 10:03:26 +00:00
version = "1.10.2";
2020-04-18 11:14:45 +00:00
src = fetchurl {
url = "https://github.com/Foundry376/Mailspring/releases/download/${version}/mailspring-${version}-amd64.deb";
2022-04-01 10:03:26 +00:00
sha256 = "sha256-6KHhkmHWhj/AgECYqNuJ0iSPEYyuBDac/3fW6J0fgTg=";
2020-04-18 11:14:45 +00:00
};
nativeBuildInputs = [
autoPatchelfHook
dpkg
2021-06-17 23:02:30 +00:00
wrapGAppsHook
2020-04-18 11:14:45 +00:00
];
buildInputs = [
alsa-lib
2020-04-18 11:14:45 +00:00
db
glib
gtk3
2020-04-18 11:14:45 +00:00
libkrb5
libsecret
nss
xorg.libxkbfile
2021-04-28 20:26:45 +00:00
xorg.libXdamage
2020-04-18 11:14:45 +00:00
xorg.libXScrnSaver
xorg.libXtst
2022-04-01 10:03:26 +00:00
xorg.libxshmfence
mesa
libdrm
2020-04-18 11:14:45 +00:00
];
runtimeDependencies = [
coreutils
openssl
(lib.getLib udev)
2020-04-18 11:14:45 +00:00
];
unpackPhase = ''
runHook preUnpack
2020-04-18 11:14:45 +00:00
dpkg -x $src .
runHook postUnpack
2020-04-18 11:14:45 +00:00
'';
installPhase = ''
runHook preInstall
2020-04-18 11:14:45 +00:00
mkdir -p $out/{bin,lib}
cp -ar ./usr/share $out
substituteInPlace $out/share/mailspring/resources/app.asar.unpacked/mailsync \
--replace dirname ${coreutils}/bin/dirname
ln -s $out/share/mailspring/mailspring $out/bin/mailspring
treewide: use lib.getLib for OpenSSL libraries At some point, I'd like to make another attempt at 71f1f4884b5 ("openssl: stop static binaries referencing libs"), which was reverted in 195c7da07df. One problem with my previous attempt is that I moved OpenSSL's libraries to a lib output, but many dependent packages were hardcoding the out output as the location of the libraries. This patch fixes every such case I could find in the tree. It won't have any effect immediately, but will mean these packages will automatically use an OpenSSL lib output if it is reintroduced in future. This patch should cause very few rebuilds, because it shouldn't make any change at all to most packages I'm touching. The few rebuilds that are introduced come from when I've changed a package builder not to use variable names like openssl.out in scripts / substitution patterns, which would be confusing since they don't hardcode the output any more. I started by making the following global replacements: ${pkgs.openssl.out}/lib -> ${lib.getLib pkgs.openssl}/lib ${openssl.out}/lib -> ${lib.getLib openssl}/lib Then I removed the ".out" suffix when part of the argument to lib.makeLibraryPath, since that function uses lib.getLib internally. Then I fixed up cases where openssl was part of the -L flag to the compiler/linker, since that unambigously is referring to libraries. Then I manually investigated and fixed the following packages: - pycurl - citrix-workspace - ppp - wraith - unbound - gambit - acl2 I'm reasonably confindent in my fixes for all of them. For acl2, since the openssl library paths are manually provided above anyway, I don't think openssl is required separately as a build input at all. Removing it doesn't make a difference to the output size, the file list, or the closure. I've tested evaluation with the OfBorg meta checks, to protect against introducing evaluation failures.
2022-03-25 15:33:21 +00:00
ln -s ${lib.getLib openssl}/lib/libcrypto.so $out/lib/libcrypto.so.1.0.0
runHook postInstall
2020-04-18 11:14:45 +00:00
'';
postFixup = /* sh */ ''
substituteInPlace $out/share/applications/Mailspring.desktop \
--replace Exec=mailspring Exec=$out/bin/mailspring
2020-04-18 11:14:45 +00:00
'';
meta = with lib; {
2020-04-18 11:14:45 +00:00
description = "A beautiful, fast and maintained fork of Nylas Mail by one of the original authors";
longDescription = ''
Mailspring is an open-source mail client forked from Nylas Mail and built with Electron.
Mailspring's sync engine runs locally, but its source is not open.
'';
license = licenses.gpl3Plus;
maintainers = with maintainers; [ toschmidt doronbehar ];
2020-04-18 11:14:45 +00:00
homepage = "https://getmailspring.com";
downloadPage = "https://github.com/Foundry376/Mailspring";
platforms = [ "x86_64-linux" ];
2020-04-18 11:14:45 +00:00
};
}