nmh: 1.7.1 -> 1.8 (#392408)

This commit is contained in:
Peder Bergebakken Sundt
2025-04-08 01:08:17 +02:00
committed by GitHub
2 changed files with 28 additions and 4 deletions
+13 -4
View File
@@ -14,25 +14,27 @@
openssl,
readline,
runtimeShell,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "nmh";
version = "1.7.1";
version = "1.8";
src = fetchFromSavannah {
repo = "nmh";
rev = finalAttrs.version;
hash = "sha256-sBftXl4hWs4bKw5weHkif1KIJBpheU/RCePx0WXuv9o=";
hash = "sha256-ShAdinvBA7guVBhjqTelBRiUzyo5KqHcawlQS9kXtqs=";
};
patches = [ ./reproducible-build-date.patch ];
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}"'
--replace-fail '"/bin/sh"' '"${runtimeShell}"'
# the "cleanup" pseudo-test makes diagnosing test failures a pain
ln -s -f ${stdenv}/bin/true test/cleanup
'';
@@ -57,6 +59,13 @@ stdenv.mkDerivation (finalAttrs: {
doCheck = true;
enableParallelBuilding = true;
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/install-mh";
versionCheckProgramArg = "-version";
meta = {
description = "New MH Mail Handling System";
homepage = "https://nmh.nongnu.org/";
@@ -0,0 +1,15 @@
Index: config/version.sh
===================================================================
--- a/config/version.sh
+++ b/config/version.sh
@@ -11,9 +11,9 @@
git=" `git -C $srcdir describe --long --dirty`"
else
git=
fi
-date="`TZ=GMT0 date +'%Y-%m-%d %T'` +0000"
+date="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
cat <<E
char *version_str = "nmh-$version$git built $date on $host";
char *version_num = "nmh-$version";