nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

at netboot-syslinux-multiplatform 107 lines 3.5 kB view raw
1{ lib, stdenv, fetchurl, fetchpatch, ncurses, which, perl 2, gdbm ? null 3, openssl ? null 4, cyrus_sasl ? null 5, gnupg ? null 6, gpgme ? null 7, libkrb5 ? null 8, headerCache ? true 9, sslSupport ? true 10, saslSupport ? true 11, smimeSupport ? false 12, gpgSupport ? false 13, gpgmeSupport ? true 14, imapSupport ? true 15, pop3Support ? true 16, smtpSupport ? true 17, withSidebar ? true 18, gssSupport ? true 19, writeScript 20}: 21assert smimeSupport -> sslSupport; 22assert gpgmeSupport -> sslSupport; 23 24stdenv.mkDerivation rec { 25 pname = "mutt"; 26 version = "2.2.10"; 27 outputs = [ "out" "doc" "info" ]; 28 29 src = fetchurl { 30 url = "http://ftp.mutt.org/pub/mutt/${pname}-${version}.tar.gz"; 31 sha256 = "sha256-TXc/IkIveQlve5S1e+5FZUrZolFl27NkY8WClbTNPYg="; 32 }; 33 34 patches = lib.optional smimeSupport (fetchpatch { 35 url = "https://salsa.debian.org/mutt-team/mutt/raw/debian/1.10.1-2/debian/patches/misc/smime.rc.patch"; 36 sha256 = "0b4i00chvx6zj9pcb06x2jysmrcb2znn831lcy32cgfds6gr3nsi"; 37 }); 38 39 buildInputs = 40 [ ncurses which perl ] 41 ++ lib.optional headerCache gdbm 42 ++ lib.optional sslSupport openssl 43 ++ lib.optional gssSupport libkrb5 44 ++ lib.optional saslSupport cyrus_sasl 45 ++ lib.optional gpgmeSupport gpgme; 46 47 configureFlags = [ 48 (lib.enableFeature headerCache "hcache") 49 (lib.enableFeature gpgmeSupport "gpgme") 50 (lib.enableFeature imapSupport "imap") 51 (lib.enableFeature smtpSupport "smtp") 52 (lib.enableFeature pop3Support "pop") 53 (lib.enableFeature withSidebar "sidebar") 54 "--with-mailpath=" 55 56 # Look in $PATH at runtime, instead of hardcoding /usr/bin/sendmail 57 "ac_cv_path_SENDMAIL=sendmail" 58 59 # This allows calls with "-d N", that output debug info into ~/.muttdebug* 60 "--enable-debug" 61 62 # The next allows building mutt without having anything setgid 63 # set by the installer, and removing the need for the group 'mail' 64 # I set the value 'mailbox' because it is a default in the configure script 65 "--with-homespool=mailbox" 66 ] ++ lib.optional sslSupport "--with-ssl" 67 ++ lib.optional gssSupport "--with-gss" 68 ++ lib.optional saslSupport "--with-sasl"; 69 70 postPatch = lib.optionalString (smimeSupport || gpgmeSupport) '' 71 sed -i 's#/usr/bin/openssl#${openssl}/bin/openssl#' smime_keys.pl 72 ''; 73 74 postInstall = lib.optionalString smimeSupport '' 75 # S/MIME setup 76 cp contrib/smime.rc $out/etc/smime.rc 77 sed -i 's#openssl#${openssl}/bin/openssl#' $out/etc/smime.rc 78 echo "source $out/etc/smime.rc" >> $out/etc/Muttrc 79 '' + lib.optionalString gpgSupport '' 80 # GnuPG setup 81 cp contrib/gpg.rc $out/etc/gpg.rc 82 sed -i 's#\(command="\)gpg #\1${gnupg}/bin/gpg #' $out/etc/gpg.rc 83 echo "source $out/etc/gpg.rc" >> $out/etc/Muttrc 84 ''; 85 86 passthru = { 87 updateScript = writeScript "update-mutt" '' 88 #!/usr/bin/env nix-shell 89 #!nix-shell -i bash -p curl pcre common-updater-scripts 90 91 set -euo pipefail 92 93 # Expect the text in format of "The current stable public release version is 2.2.6." 94 new_version="$(curl -s http://www.mutt.org/download.html | 95 pcregrep -o1 'The current stable public release version is ([0-9.]+).')" 96 update-source-version ${pname} "$new_version" 97 ''; 98 }; 99 100 meta = with lib; { 101 description = "A small but very powerful text-based mail client"; 102 homepage = "http://www.mutt.org"; 103 license = licenses.gpl2Plus; 104 platforms = platforms.unix; 105 maintainers = with maintainers; [ rnhmjoj ]; 106 }; 107}