mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 10:25:36 +08:00
separate intl with newer icu c++ patch
This commit is contained in:
26
src/SPC/builder/extension/intl.php
Normal file
26
src/SPC/builder/extension/intl.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('intl')]
|
||||||
|
class intl extends Extension
|
||||||
|
{
|
||||||
|
public function patchBeforeBuildconf(): bool
|
||||||
|
{
|
||||||
|
// TODO: remove the following line when https://github.com/php/php-src/pull/14002 will be released
|
||||||
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/intl/config.m4', 'PHP_CXX_COMPILE_STDCXX(11', 'PHP_CXX_COMPILE_STDCXX(17');
|
||||||
|
// Also need to use clang++ -std=c++17 to force override the default C++ standard
|
||||||
|
if (is_string($env = getenv('CXX')) && !str_contains($env, 'std=c++17')) {
|
||||||
|
f_putenv('CXX=' . $env . ' -std=c++17');
|
||||||
|
} else {
|
||||||
|
f_putenv('CXX=clang++ -std=c++17');
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -168,9 +168,6 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove the following line when https://github.com/php/php-src/pull/14002 will be released
|
|
||||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/intl/config.m4', 'PHP_CXX_COMPILE_STDCXX(11', 'PHP_CXX_COMPILE_STDCXX(17');
|
|
||||||
|
|
||||||
shell()->cd(SOURCE_PATH . '/php-src')
|
shell()->cd(SOURCE_PATH . '/php-src')
|
||||||
->exec(
|
->exec(
|
||||||
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
||||||
|
|||||||
@@ -173,9 +173,6 @@ class MacOSBuilder extends UnixBuilderBase
|
|||||||
$this->emitPatchPoint('before-php-make');
|
$this->emitPatchPoint('before-php-make');
|
||||||
SourcePatcher::patchBeforeMake($this);
|
SourcePatcher::patchBeforeMake($this);
|
||||||
|
|
||||||
// TODO: remove the following line when https://github.com/php/php-src/pull/14002 will be released
|
|
||||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/intl/config.m4', 'PHP_CXX_COMPILE_STDCXX(11', 'PHP_CXX_COMPILE_STDCXX(17');
|
|
||||||
|
|
||||||
$this->cleanMake();
|
$this->cleanMake();
|
||||||
|
|
||||||
if ($enableCli) {
|
if ($enableCli) {
|
||||||
|
|||||||
Reference in New Issue
Block a user