32 enableMixmaster ? false,
34 enableSmimeKeys ? true,
40 ) "Support for mixmaster has been removed from neomutt since the 20241002 release" true;
42 stdenv.mkDerivation (finalAttrs: {
46 src = fetchFromGitHub {
49 rev = finalAttrs.version;
50 hash = "sha256-c8G0CGg4jrwq+HVR4O0AtaJNzr7pDYsie1410tisLEY=";
68 ++ lib.optional enableZstd zstd
69 ++ lib.optional enableLua lua;
85 enableParallelBuilding = true;
88 substituteInPlace auto.def --replace /usr/sbin/sendmail sendmail
89 substituteInPlace contrib/smime_keys \
90 --replace /usr/bin/openssl ${openssl}/bin/openssl
92 for f in doc/*.{xml,xsl}* ; do
93 substituteInPlace $f \
94 --replace http://docbook.sourceforge.net/release/xsl/current ${docbook_xsl}/share/xml/docbook-xsl \
95 --replace http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd ${docbook_xml_dtd_42}/xml/dtd/docbook/docbookx.dtd
99 # allow neomutt to map attachments to their proper mime.types if specified wrongly
100 # and use a far more comprehensive list than the one shipped with neomutt
101 substituteInPlace send/sendlib.c \
102 --replace /etc/mime.types ${mailcap}/etc/mime.types
114 "--with-homespool=mailbox"
116 # To make it not reference .dev outputs. See:
117 # https://github.com/neomutt/neomutt/pull/2367
118 "--disable-include-path-in-cflags"
121 ++ lib.optional enableZstd "--zstd"
122 ++ lib.optional enableLua "--lua";
126 wrapProgram "$out/bin/neomutt" --prefix PATH : "$out/libexec/neomutt"
128 + lib.optionalString enableSmimeKeys ''
129 install -m 755 $src/contrib/smime_keys $out/bin;
130 substituteInPlace $out/bin/smime_keys \
131 --replace-fail '/usr/bin/openssl' '${openssl}/bin/openssl';
133 # https://github.com/neomutt/neomutt-contrib
134 # Contains vim-keys, keybindings presets and more.
135 + lib.optionalString withContrib "${lib.getExe lndir} ${finalAttrs.passthru.contrib} $out/share/doc/neomutt";
140 cp -r ${finalAttrs.passthru.test-files} $(pwd)/test-files
142 chmod -R +w test-files
143 (cd test-files && ./setup.sh)
145 export NEOMUTT_TEST_DIR=$(pwd)/test-files
147 # The test fails with: node_padding.c:135: Check rc == 15... failed
148 substituteInPlace test/main.c \
149 --replace-fail "NEOMUTT_TEST_ITEM(test_expando_node_padding)" ""
153 test-files = fetchFromGitHub {
155 repo = "neomutt-test-files";
156 rev = "00efc8388110208e77e6ed9d8294dfc333753d54";
157 hash = "sha256-/ELowuMq67v56MAJBtO73g6OqV0DVwW4+x+0u4P5mB0=";
159 contrib = fetchFromGitHub {
161 repo = "neomutt-contrib";
162 rev = "8e97688693ca47ea1055f3d15055a4f4ecc5c832";
163 hash = "sha256-tx5Y819rNDxOpjg3B/Y2lPcqJDArAxVwjbYarVmJ79k=";
167 checkTarget = "test";
168 postCheck = "unset NEOMUTT_TEST_DIR";
171 description = "Small but very powerful text-based mail client";
172 mainProgram = "neomutt";
173 homepage = "https://www.neomutt.org";
174 license = lib.licenses.gpl2Plus;
175 maintainers = with lib.maintainers; [
179 platforms = lib.platforms.unix;