From a57b48fda6ab3ccb9b3a9b2ef2b67d4115f629ff Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 26 Feb 2026 15:45:30 +0800 Subject: [PATCH] Add macOS check to patchBeforePHPConfigure for explicit_bzero detection --- src/Package/Library/postgresql.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Package/Library/postgresql.php b/src/Package/Library/postgresql.php index 84b4657e..98392ced 100644 --- a/src/Package/Library/postgresql.php +++ b/src/Package/Library/postgresql.php @@ -27,8 +27,11 @@ class postgresql extends LibraryPackage #[PatchDescription('Patch to avoid explicit_bzero detection issues on some systems')] public function patchBeforePHPConfigure(TargetPackage $package): void { - shell()->cd($package->getSourceDir()) - ->exec('sed -i.backup "s/ac_cv_func_explicit_bzero\" = xyes/ac_cv_func_explicit_bzero\" = x_fake_yes/" ./configure'); + 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()) + ->exec('sed -i.backup "s/ac_cv_func_explicit_bzero\" = xyes/ac_cv_func_explicit_bzero\" = x_fake_yes/" ./configure'); + } } #[PatchBeforeBuild]