From 0227195b627529e40a5f14fcc25f19f39c60ab5b Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Fri, 23 Dec 2022 19:05:53 -0800 Subject: [PATCH 1/3] nmh: init at 1.7.1 These tools are mainly useful for writing scripts that manipulating claws-mail's mail folders. I doubt anybody uses nmh to read their email anymore, and most other mail clients have migrated to maildir. Co-authored-by: Anderson Torres --- pkgs/tools/networking/nmh/default.nix | 85 +++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 87 insertions(+) create mode 100644 pkgs/tools/networking/nmh/default.nix diff --git a/pkgs/tools/networking/nmh/default.nix b/pkgs/tools/networking/nmh/default.nix new file mode 100644 index 000000000000..68dd412dff46 --- /dev/null +++ b/pkgs/tools/networking/nmh/default.nix @@ -0,0 +1,85 @@ +{ lib +, stdenv +, autoreconfHook +, bison +, coreutils +, cyrus_sasl +, db +, fetchFromSavannah +, flex +, gdbm +, liblockfile +, ncurses +, openssl +, readline +, runtimeShell +}: + +stdenv.mkDerivation (finalAttrs: { + + pname = "nmh"; + version = "1.7.1"; + src = fetchFromSavannah { + repo = "nmh"; + rev = finalAttrs.version; + hash = "sha256-sBftXl4hWs4bKw5weHkif1KIJBpheU/RCePx0WXuv9o="; + }; + + postPatch = '' + substituteInPlace config/config.c --replace /bin/cat ${coreutils}/bin/cat + substituteInPlace \ + sbr/arglist.c \ + uip/mhbuildsbr.c \ + uip/whatnowsbr.c \ + uip/slocal.c \ + --replace '"/bin/sh"' '"${runtimeShell}"' + # the "cleanup" pseudo-test makes diagnosing test failures a pain + ln -s -f ${stdenv}/bin/true test/cleanup + ''; + + nativeBuildInputs = [ + autoreconfHook + flex + bison + ]; + + buildInputs = [ + cyrus_sasl + db + gdbm + liblockfile + ncurses + openssl + readline + ]; + + doCheck = true; + enableParallelBuilding = true; + + meta = { + description = "New MH Mail Handling System"; + homepage = "https://nmh.nongnu.org/"; + downloadPage = "http://download.savannah.nongnu.org/releases/nmh/"; + changelog = "http://savannah.nongnu.org/news/?group=nmh"; + license = [ lib.licenses.bsd3 ]; + longDescription = '' + This is the nmh mail user agent (reader/sender), a command-line based + mail reader that is powerful and extensible. nmh is an excellent choice + for people who receive and process a lot of mail. + + Unlike most mail user agents, nmh is not a single program, rather it is + a set of programs that are run from the shell. This allows the user to + utilize the full power of the Unix shell in coordination with nmh. + Various front-ends are available, such as mh-e (an emacs mode), xmh, and + exmh (X11 clients). + + nmh was originally based on MH version 6.8.3, and is intended to be a + (mostly) compatible drop-in replacement for MH. + + These tools are mainly useful for writing scripts that manipulating + claws-mail's mail folders. Most other mail clients have migrated to + maildir. + ''; + }; + +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4557c4b72199..2abe8f685fe3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5452,6 +5452,8 @@ with pkgs; notifymuch = callPackage ../applications/misc/notifymuch { }; + nmh = callPackage ../tools/networking/nmh { }; + npins = callPackage ../tools/nix/npins { }; nrsc5 = callPackage ../applications/misc/nrsc5 { }; From bece4931b53c901bbe6aa34b5c84a4782de5fabd Mon Sep 17 00:00:00 2001 From: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com> Date: Mon, 24 Apr 2023 03:31:27 +0000 Subject: [PATCH 2/3] Update pkgs/tools/networking/nmh/default.nix Co-authored-by: Anderson Torres --- pkgs/tools/networking/nmh/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/tools/networking/nmh/default.nix b/pkgs/tools/networking/nmh/default.nix index 68dd412dff46..23c3efbbf313 100644 --- a/pkgs/tools/networking/nmh/default.nix +++ b/pkgs/tools/networking/nmh/default.nix @@ -16,7 +16,6 @@ }: stdenv.mkDerivation (finalAttrs: { - pname = "nmh"; version = "1.7.1"; src = fetchFromSavannah { From 26ecc0c359f627cdf7b3a0e8b13f4b2b5902c53a Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 23 Apr 2023 21:08:44 -0700 Subject: [PATCH 3/3] nmh: add -Wno-stringop-truncation --- pkgs/tools/networking/nmh/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/networking/nmh/default.nix b/pkgs/tools/networking/nmh/default.nix index 23c3efbbf313..e32da2708a5b 100644 --- a/pkgs/tools/networking/nmh/default.nix +++ b/pkgs/tools/networking/nmh/default.nix @@ -52,6 +52,7 @@ stdenv.mkDerivation (finalAttrs: { readline ]; + NIX_CFLAGS_COMPILE = "-Wno-stringop-truncation"; doCheck = true; enableParallelBuilding = true;