Skip to content

Commit 4ea508a

Browse files
authored
nmh: 1.7.1 -> 1.8 (#392408)
2 parents eddaa22 + d2a3e5e commit 4ea508a

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

pkgs/by-name/nm/nmh/package.nix

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,27 @@
1414
openssl,
1515
readline,
1616
runtimeShell,
17+
versionCheckHook,
1718
}:
1819

1920
stdenv.mkDerivation (finalAttrs: {
2021
pname = "nmh";
21-
version = "1.7.1";
22+
version = "1.8";
2223
src = fetchFromSavannah {
2324
repo = "nmh";
2425
rev = finalAttrs.version;
25-
hash = "sha256-sBftXl4hWs4bKw5weHkif1KIJBpheU/RCePx0WXuv9o=";
26+
hash = "sha256-ShAdinvBA7guVBhjqTelBRiUzyo5KqHcawlQS9kXtqs=";
2627
};
2728

29+
patches = [ ./reproducible-build-date.patch ];
30+
2831
postPatch = ''
29-
substituteInPlace config/config.c --replace /bin/cat ${coreutils}/bin/cat
3032
substituteInPlace \
3133
sbr/arglist.c \
3234
uip/mhbuildsbr.c \
3335
uip/whatnowsbr.c \
3436
uip/slocal.c \
35-
--replace '"/bin/sh"' '"${runtimeShell}"'
37+
--replace-fail '"/bin/sh"' '"${runtimeShell}"'
3638
# the "cleanup" pseudo-test makes diagnosing test failures a pain
3739
ln -s -f ${stdenv}/bin/true test/cleanup
3840
'';
@@ -57,6 +59,13 @@ stdenv.mkDerivation (finalAttrs: {
5759
doCheck = true;
5860
enableParallelBuilding = true;
5961

62+
nativeInstallCheckInputs = [
63+
versionCheckHook
64+
];
65+
doInstallCheck = true;
66+
versionCheckProgram = "${placeholder "out"}/bin/install-mh";
67+
versionCheckProgramArg = "-version";
68+
6069
meta = {
6170
description = "New MH Mail Handling System";
6271
homepage = "https://nmh.nongnu.org/";
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Index: config/version.sh
2+
===================================================================
3+
--- a/config/version.sh
4+
+++ b/config/version.sh
5+
@@ -11,9 +11,9 @@
6+
git=" `git -C $srcdir describe --long --dirty`"
7+
else
8+
git=
9+
fi
10+
-date="`TZ=GMT0 date +'%Y-%m-%d %T'` +0000"
11+
+date="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
12+
13+
cat <<E
14+
char *version_str = "nmh-$version$git built $date on $host";
15+
char *version_num = "nmh-$version";

0 commit comments

Comments
 (0)