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