mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
really stupid patch for swoole
This commit is contained in:
parent
69e1acd5ae
commit
ff95b464ce
@ -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
|
||||
|
||||
10
src/globals/patch/swoole_fix_date_time.patch
Normal file
10
src/globals/patch/swoole_fix_date_time.patch
Normal file
@ -0,0 +1,10 @@
|
||||
--- a/config.m4
|
||||
+++ b/config.m4
|
||||
@@ -425,6 +425,7 @@
|
||||
AX_CHECK_COMPILE_FLAG(-Wloop-analysis, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wloop-analysis")
|
||||
AX_CHECK_COMPILE_FLAG(-Wuninitialized, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wuninitialized")
|
||||
AX_CHECK_COMPILE_FLAG(-Wno-missing-field-initializers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-missing-field-initializers")
|
||||
+ AX_CHECK_COMPILE_FLAG(-Wno-date-time, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-date-time")
|
||||
AX_CHECK_COMPILE_FLAG(-Wno-sign-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-sign-compare")
|
||||
AX_CHECK_COMPILE_FLAG(-Wno-unused-const-variable, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-const-variable")
|
||||
AX_CHECK_COMPILE_FLAG(-Wno-unused-parameter, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-parameter")
|
||||
Loading…
x
Reference in New Issue
Block a user