really stupid patch for swoole

This commit is contained in:
DubbleClick
2025-06-27 21:26:06 +07:00
parent 69e1acd5ae
commit ff95b464ce
2 changed files with 18 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\builder\macos\MacOSBuilder;
use SPC\store\FileSystem;
use SPC\store\SourcePatcher;
use SPC\util\CustomExt;
#[CustomExt('swoole')]
@@ -14,13 +15,18 @@ class swoole extends Extension
{
public function patchBeforeMake(): bool
{
$patched = false;
if (PHP_OS_FAMILY === 'Linux') {
SourcePatcher::patchFile('swoole_fix_date_time.patch', $this->source_dir);
$patched = true;
}
if ($this->builder instanceof MacOSBuilder) {
// Fix swoole with event extension <util.h> conflict bug
$util_path = shell()->execWithResult('xcrun --show-sdk-path', false)[1][0] . '/usr/include/util.h';
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/swoole/thirdparty/php/standard/proc_open.cc', 'include <util.h>', 'include "' . $util_path . '"');
return true;
$patched = true;
}
return false;
return $patched;
}
public function getExtVersion(): ?string