about summary refs log tree commit diff
path: root/pkgs/applications/networking/mailreaders
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2017-10-14 13:17:50 +0800
committerPeter Hoeg <peter@hoeg.com>2017-10-17 11:32:37 +0800
commit2ef36f2ee58d3566374b09724d93ac8114796921 (patch)
tree45504bfe099c602b7620dfa9861111f1fb4198e9 /pkgs/applications/networking/mailreaders
parentbe73e42f149a9cec8dce3d5e4fb07d5b10c30f69 (diff)
downloadnixlib-2ef36f2ee58d3566374b09724d93ac8114796921.tar
nixlib-2ef36f2ee58d3566374b09724d93ac8114796921.tar.gz
nixlib-2ef36f2ee58d3566374b09724d93ac8114796921.tar.bz2
nixlib-2ef36f2ee58d3566374b09724d93ac8114796921.tar.lz
nixlib-2ef36f2ee58d3566374b09724d93ac8114796921.tar.xz
nixlib-2ef36f2ee58d3566374b09724d93ac8114796921.tar.zst
nixlib-2ef36f2ee58d3566374b09724d93ac8114796921.zip
neomutt: minor cleanups
 - neomutt has changed the binary name so we enable "mutt" via a wrapper script
   with a warning
 - we don't have to manually run the prepare.sh script as autoreconfHook handles
   everything for us
 - doc generation was previously trying to fetch DTDs from the net
Diffstat (limited to 'pkgs/applications/networking/mailreaders')
-rw-r--r--pkgs/applications/networking/mailreaders/neomutt/default.nix45
1 files changed, 34 insertions, 11 deletions
diff --git a/pkgs/applications/networking/mailreaders/neomutt/default.nix b/pkgs/applications/networking/mailreaders/neomutt/default.nix
index a6cd17878b0c..d9d2f201fdc1 100644
--- a/pkgs/applications/networking/mailreaders/neomutt/default.nix
+++ b/pkgs/applications/networking/mailreaders/neomutt/default.nix
@@ -1,7 +1,19 @@
-{ stdenv, fetchFromGitHub, which, autoreconfHook, ncurses, perl
+{ stdenv, fetchFromGitHub, which, autoreconfHook, writeScript, ncurses, perl
 , cyrus_sasl, gss, gpgme, kerberos, libidn, notmuch, openssl, lmdb, libxslt, docbook_xsl, docbook_xml_dtd_42 }:
 
-stdenv.mkDerivation rec {
+let
+  muttWrapper = writeScript "mutt" ''
+    #!${stdenv.shell} -eu
+
+    echo 'The neomutt project has renamed the main binary from `mutt` to `neomutt`.'
+    echo ""
+    echo 'This wrapper is provided for compatibility purposes only. You should start calling `neomutt` instead.'
+    echo ""
+    read -p 'Press any key to launch NeoMutt...' -n1 -s
+    exec neomutt "$@"
+  '';
+
+in stdenv.mkDerivation rec {
   version = "20171013";
   name = "neomutt-${version}";
 
@@ -12,24 +24,35 @@ stdenv.mkDerivation rec {
     sha256 = "0zn8imqfa76bxpkpy111c4vn6vjarbxc8gqv6m18qkksk0ly26l1";
   };
 
-  nativeBuildInputs = [ autoreconfHook docbook_xsl docbook_xml_dtd_42 libxslt.bin which ];
   buildInputs = [
     cyrus_sasl gss gpgme kerberos libidn ncurses
     notmuch openssl perl lmdb
   ];
 
+  nativeBuildInputs = [ autoreconfHook docbook_xsl docbook_xml_dtd_42 libxslt.bin which ];
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    for f in doc/*.{xml,xsl}*  ; do
+      substituteInPlace $f \
+        --replace http://docbook.sourceforge.net/release/xsl/current     ${docbook_xsl}/share/xml/docbook-xsl \
+        --replace http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd ${docbook_xml_dtd_42}/xml/dtd/docbook/docbookx.dtd
+    done
+  '';
+
   configureFlags = [
     "--enable-debug"
     "--enable-gpgme"
     "--enable-notmuch"
-    "--with-homespool=mailbox"
-    "--with-gss"
-    "--with-mailpath="
-    "--with-ssl"
-    "--with-sasl"
     "--with-curses"
+    "--with-gss"
+    "--with-homespool=mailbox"
     "--with-idn"
     "--with-lmdb"
+    "--with-mailpath="
+    "--with-sasl"
+    "--with-ssl"
 
     # Look in $PATH at runtime, instead of hardcoding /usr/bin/sendmail
     "ac_cv_path_SENDMAIL=sendmail"
@@ -40,9 +63,9 @@ stdenv.mkDerivation rec {
   # like pgpring, pgpewrap, ...
   NIX_LDFLAGS = "-lidn";
 
-  configureScript = "./prepare";
-
-  enableParallelBuilding = true;
+  postInstall = ''
+    cp ${muttWrapper} $out/bin/mutt
+  '';
 
   meta = with stdenv.lib; {
     description = "A small but very powerful text-based mail client";