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

61 lines
1.8 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, autoreconfHook, pkgconfig
, 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";
name = "${pname}-${version}";
version = "1.8.2";
src = fetchurl {
url = "https://marlam.de/msmtp/releases/${name}.tar.xz";
sha256 = "14w7lmw1jxlganfk089b0ib23y5917mxbg3xqpid007dd4cmq66i";
};
patches = [
./paths.patch
];
buildInputs = [ gnutls gsasl libidn2 ]
++ stdenv.lib.optional stdenv.isDarwin Security
++ stdenv.lib.optional withKeyring libsecret;
nativeBuildInputs = [ autoreconfHook pkgconfig ];
configureFlags =
[ "--sysconfdir=/etc" ] ++ stdenv.lib.optional stdenv.isDarwin [ "--with-macosx-keyring" ];
2015-01-09 16:31:10 +00: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 16:31:10 +00:00
'';
meta = with stdenv.lib; {
description = "Simple and easy to use SMTP client with excellent sendmail compatibility";
homepage = https://marlam.de/msmtp/;
license = licenses.gpl3Plus;
maintainers = with maintainers; [ garbas peterhoeg ];
platforms = platforms.unix;
};
}