mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
Fix swoole with event extension <util.h> conflict bug
This commit is contained in:
parent
5bd9115a20
commit
b1bcf254e4
@ -5,11 +5,24 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
|
use SPC\builder\macos\MacOSBuilder;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
#[CustomExt('swoole')]
|
#[CustomExt('swoole')]
|
||||||
class swoole extends Extension
|
class swoole extends Extension
|
||||||
{
|
{
|
||||||
|
public function patchBeforeMake(): bool
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function getExtVersion(): ?string
|
public function getExtVersion(): ?string
|
||||||
{
|
{
|
||||||
// Get version from source directory
|
// Get version from source directory
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user