bogofilter: fix and run tests

They were failing previously because the bogofilter test suite passes
$VERBOSE as a flag to bash, which won't work if VERBOSE is set to `y`.

Additionally, the bogofilter test suite hard-codes the path for grep, so
we have to patch that.
This commit is contained in:
Steven Allen
2026-03-01 11:32:51 -08:00
parent 93dc05470f
commit 2393d6ff32
+19 -2
View File
@@ -2,11 +2,13 @@
lib,
stdenv,
fetchurl,
flex,
db,
flex,
gnugrep,
makeWrapper,
pax,
perl,
valgrind,
database ? db,
}:
@@ -22,6 +24,12 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-MkihNzv/VSxQCDStvqS2yu4EIkUWrlgfslpMam3uieo=";
};
# bogofilter's test-cases hard-code the search path for grep.
postPatch = ''
substituteInPlace ./src/tests/t.frame \
--replace-fail 'GREP=/bin/grep' 'GREP=${lib.getExe gnugrep}'
'';
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
@@ -34,7 +42,16 @@ stdenv.mkDerivation (finalAttrs: {
"--with-database=${dbName}"
];
doCheck = false; # needs "y" tool
nativeCheckInputs = [
valgrind
];
doCheck = true;
checkFlags = [
"BF_RUN_VALGRIND=1"
"BF_CHECKTOOL=glibc"
"VERBOSE=-x"
];
postInstall = ''
wrapProgram "$out/bin/bf_tar" --prefix PATH : "${lib.makeBinPath [ pax ]}"