nixpkgs-suyu/pkgs/applications/networking/msmtp/default.nix

60 lines
1.8 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, autoreconfHook, pkg-config, texinfo
, netcat-gnu, gnutls, gsasl, libidn2, Security
, withKeyring ? true, libsecret ? null
, systemd ? null }:
let
tester = "n"; # {x| |p|P|n|s}
journal = if stdenv.isLinux then "y" else "n";
in stdenv.mkDerivation rec {
pname = "msmtp";
2021-09-22 20:49:47 +02:00
version = "1.8.16";
src = fetchurl {
url = "https://marlam.de/${pname}/releases/${pname}-${version}.tar.xz";
2021-09-22 20:49:47 +02:00
sha256 = "1n271yr83grpki9szdirnk6wb5rcc319f0gmfabyw3fzyf4msjy0";
};
patches = [
./paths.patch
];
buildInputs = [ gnutls gsasl libidn2 ]
2021-01-15 14:21:58 +01:00
++ lib.optional stdenv.isDarwin Security
++ lib.optional withKeyring libsecret;
nativeBuildInputs = [ autoreconfHook pkg-config texinfo ];
configureFlags =
2021-01-15 14:21:58 +01:00
[ "--sysconfdir=/etc" ] ++ lib.optional stdenv.isDarwin [ "--with-macosx-keyring" ];
2015-01-09 17:31:10 +01:00
postInstall = ''
install -d $out/share/doc/${pname}/scripts
cp -r scripts/{find_alias,msmtpqueue,msmtpq,set_sendmail} $out/share/doc/${pname}/scripts
install -Dm644 doc/*.example $out/share/doc/${pname}
substitute scripts/msmtpq/msmtpq $out/bin/msmtpq \
--replace @msmtp@ $out/bin/msmtp \
--replace @nc@ ${netcat-gnu}/bin/nc \
--replace @journal@ ${journal} \
${lib.optionalString (journal == "y") "--replace @systemdcat@ ${systemd}/bin/systemd-cat" } \
--replace @test@ ${tester}
substitute scripts/msmtpq/msmtp-queue $out/bin/msmtp-queue \
--replace @msmtpq@ $out/bin/msmtpq
ln -s msmtp $out/bin/sendmail
chmod +x $out/bin/*
2015-01-09 17:31:10 +01:00
'';
meta = with lib; {
description = "Simple and easy to use SMTP client with excellent sendmail compatibility";
homepage = "https://marlam.de/msmtp/";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.unix;
};
}