2020-04-25 16:08:31 -07:00
|
|
|
{ stdenv, lib, fetchurl, autoreconfHook, pkgconfig, texinfo
|
2018-12-16 10:06:23 -08:00
|
|
|
, netcat-gnu, gnutls, gsasl, libidn2, Security
|
2017-10-24 00:56:06 -07:00
|
|
|
, withKeyring ? true, libsecret ? null
|
2017-10-13 23:40:29 -07:00
|
|
|
, systemd ? null }:
|
2013-07-18 15:53:06 -07:00
|
|
|
|
2017-02-22 23:57:53 -08:00
|
|
|
let
|
|
|
|
tester = "n"; # {x| |p|P|n|s}
|
|
|
|
journal = if stdenv.isLinux then "y" else "n";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2017-11-17 08:35:01 -08:00
|
|
|
pname = "msmtp";
|
2021-01-01 01:51:57 -08:00
|
|
|
version = "1.8.14";
|
2007-09-03 05:10:57 -07:00
|
|
|
|
2008-01-30 09:20:48 -08:00
|
|
|
src = fetchurl {
|
2019-04-24 17:27:08 -07:00
|
|
|
url = "https://marlam.de/${pname}/releases/${pname}-${version}.tar.xz";
|
2021-01-01 01:51:57 -08:00
|
|
|
sha256 = "1W8GXXEUhunCNGGFFaAqSKSNq0BRs08+EI++y2+3c7Q=";
|
2007-09-03 05:10:57 -07:00
|
|
|
};
|
|
|
|
|
2017-02-22 23:57:53 -08:00
|
|
|
patches = [
|
|
|
|
./paths.patch
|
|
|
|
];
|
|
|
|
|
2018-12-16 10:06:23 -08:00
|
|
|
buildInputs = [ gnutls gsasl libidn2 ]
|
2021-01-15 05:21:58 -08:00
|
|
|
++ lib.optional stdenv.isDarwin Security
|
|
|
|
++ lib.optional withKeyring libsecret;
|
2017-10-24 00:56:06 -07:00
|
|
|
|
2020-03-28 04:40:30 -07:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig texinfo ];
|
2015-11-18 23:38:11 -08:00
|
|
|
|
|
|
|
configureFlags =
|
2021-01-15 05:21:58 -08:00
|
|
|
[ "--sysconfdir=/etc" ] ++ lib.optional stdenv.isDarwin [ "--with-macosx-keyring" ];
|
2010-05-27 12:33:33 -07:00
|
|
|
|
2015-01-09 08:31:10 -08:00
|
|
|
postInstall = ''
|
2017-11-17 08:35:01 -08:00
|
|
|
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}
|
|
|
|
|
2017-02-22 23:57:53 -08:00
|
|
|
substitute scripts/msmtpq/msmtpq $out/bin/msmtpq \
|
|
|
|
--replace @msmtp@ $out/bin/msmtp \
|
2017-03-07 23:35:33 -08:00
|
|
|
--replace @nc@ ${netcat-gnu}/bin/nc \
|
2017-02-22 23:57:53 -08:00
|
|
|
--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
|
|
|
|
|
2017-11-17 16:09:43 -08:00
|
|
|
ln -s msmtp $out/bin/sendmail
|
|
|
|
|
2017-02-22 23:57:53 -08:00
|
|
|
chmod +x $out/bin/*
|
2015-01-09 08:31:10 -08:00
|
|
|
'';
|
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2017-02-22 23:57:53 -08:00
|
|
|
description = "Simple and easy to use SMTP client with excellent sendmail compatibility";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://marlam.de/msmtp/";
|
2018-12-16 10:06:23 -08:00
|
|
|
license = licenses.gpl3Plus;
|
2019-07-03 02:27:39 -07:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2017-02-22 23:57:53 -08:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2007-09-03 05:10:57 -07:00
|
|
|
}
|