1{
2 lib,
3 stdenv,
4 autoreconfHook,
5 bison,
6 cyrus_sasl,
7 db,
8 fetchurl,
9 flex,
10 gdbm,
11 liblockfile,
12 ncurses,
13 openssl,
14 readline,
15 runtimeShell,
16 versionCheckHook,
17}:
18
19stdenv.mkDerivation (finalAttrs: {
20 pname = "nmh";
21 version = "1.8";
22
23 src = fetchurl {
24 url = "mirror://savannah/${finalAttrs.pname}/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
25 hash = "sha256-Nmzgzj+URzAvVWcAkmnIuziC2AjzPu+shbo2fodchhU=";
26 };
27
28 patches = [ ./reproducible-build-date.patch ];
29
30 postPatch =
31 # patch hardcoded shell
32 ''
33 substituteInPlace \
34 sbr/arglist.c \
35 uip/mhbuildsbr.c \
36 uip/whatnowsbr.c \
37 uip/slocal.c \
38 --replace-fail '"/bin/sh"' '"${runtimeShell}"'
39 ''
40 # the "cleanup" pseudo-test makes diagnosing test failures a pain
41 + ''
42 ln -sf ${stdenv}/bin/true test/cleanup
43 '';
44
45 nativeBuildInputs = [
46 autoreconfHook
47 flex
48 bison
49 ];
50
51 buildInputs = [
52 cyrus_sasl
53 db
54 gdbm
55 liblockfile
56 ncurses
57 openssl
58 readline
59 ];
60
61 doCheck = true;
62 enableParallelBuilding = true;
63
64 nativeInstallCheckInputs = [
65 versionCheckHook
66 ];
67 doInstallCheck = true;
68 versionCheckProgram = "${placeholder "out"}/bin/install-mh";
69 versionCheckProgramArg = "-version";
70
71 meta = {
72 description = "New MH Mail Handling System";
73 homepage = "https://nmh.nongnu.org/";
74 downloadPage = "https://download.savannah.nongnu.org/releases/nmh/";
75 changelog = "https://savannah.nongnu.org/news/?group=nmh";
76 license = [ lib.licenses.bsd3 ];
77 longDescription = ''
78 This is the nmh mail user agent (reader/sender), a command-line based
79 mail reader that is powerful and extensible. nmh is an excellent choice
80 for people who receive and process a lot of mail.
81
82 Unlike most mail user agents, nmh is not a single program, rather it is
83 a set of programs that are run from the shell. This allows the user to
84 utilize the full power of the Unix shell in coordination with nmh.
85 Various front-ends are available, such as mh-e (an emacs mode), xmh, and
86 exmh (X11 clients).
87
88 nmh was originally based on MH version 6.8.3, and is intended to be a
89 (mostly) compatible drop-in replacement for MH.
90
91 These tools are mainly useful for writing scripts that manipulating
92 claws-mail's mail folders. Most other mail clients have migrated to
93 maildir.
94 '';
95 maintainers = with lib.maintainers; [ normalcea ];
96 };
97
98})