glog: patch /usr/bin/true in tests

Tests appear to use `/usr/bin/true` as a fake mailer, which causes an
error in the check phase. This does not cause the tests to fail, and
this is why the replace is a warn and not fail. Patching it nonetheless.
This commit is contained in:
Mitchell Pleune
2025-02-03 16:47:35 +00:00
parent d3376dec33
commit 4f680c2bf7
+8 -2
View File
@@ -6,9 +6,10 @@
gflags,
gtest,
perl,
pkgsBuildHost,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: rec {
pname = "glog";
version = "0.7.1";
@@ -19,6 +20,11 @@ stdenv.mkDerivation rec {
sha256 = "sha256-+nwWP6VBmhgU7GCPSEGUzvUSCc48wXME181WpJ5ABP4=";
};
postPatch = lib.optionalString finalAttrs.doCheck ''
substituteInPlace src/logging_unittest.cc \
--replace-warn "/usr/bin/true" "${pkgsBuildHost.coreutils}/bin/true"
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ gtest ];
@@ -90,4 +96,4 @@ stdenv.mkDerivation rec {
r-burns
];
};
}
})