about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/msmtp/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/applications/networking/msmtp/default.nix
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/msmtp/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/msmtp/default.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/msmtp/default.nix b/nixpkgs/pkgs/applications/networking/msmtp/default.nix
new file mode 100644
index 000000000000..a9c828a3fb13
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/msmtp/default.nix
@@ -0,0 +1,60 @@
+{ 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.1";
+
+  src = fetchurl {
+    url = "https://marlam.de/msmtp/releases/${name}.tar.xz";
+    sha256 = "1nm4vizrnrrnknc4mc8nr7grz9q76m1vraa0hsl5rfm34gnsg8ph";
+  };
+
+  patches = [
+    ./paths.patch
+  ];
+
+  buildInputs = [ gnutls gsasl libidn2 ]
+    ++ stdenv.lib.optional stdenv.isDarwin Security
+    ++ stdenv.lib.optional withKeyring libsecret;
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  configureFlags =
+    stdenv.lib.optional stdenv.isDarwin [ "--with-macosx-keyring" ];
+
+  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/*
+  '';
+
+  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;
+  };
+}