Add macOS check to patchBeforePHPConfigure for explicit_bzero detection

This commit is contained in:
crazywhalecc
2026-02-26 15:45:30 +08:00
parent 0f012f267b
commit a57b48fda6

View File

@@ -27,9 +27,12 @@ class postgresql extends LibraryPackage
#[PatchDescription('Patch to avoid explicit_bzero detection issues on some systems')] #[PatchDescription('Patch to avoid explicit_bzero detection issues on some systems')]
public function patchBeforePHPConfigure(TargetPackage $package): void public function patchBeforePHPConfigure(TargetPackage $package): void
{ {
if (SystemTarget::getTargetOS() === 'Darwin') {
// on macOS, explicit_bzero is available but causes build failure due to detection issues, so we fake it as unavailable
shell()->cd($package->getSourceDir()) shell()->cd($package->getSourceDir())
->exec('sed -i.backup "s/ac_cv_func_explicit_bzero\" = xyes/ac_cv_func_explicit_bzero\" = x_fake_yes/" ./configure'); ->exec('sed -i.backup "s/ac_cv_func_explicit_bzero\" = xyes/ac_cv_func_explicit_bzero\" = x_fake_yes/" ./configure');
} }
}
#[PatchBeforeBuild] #[PatchBeforeBuild]
#[PatchDescription('Various patches before building PostgreSQL')] #[PatchDescription('Various patches before building PostgreSQL')]