mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Add intl/ICU support
This commit is contained in:
parent
09ba11affb
commit
1158931d91
@ -460,5 +460,18 @@
|
||||
"static-libs-unix": [
|
||||
"libsodium.a"
|
||||
]
|
||||
},
|
||||
"icu": {
|
||||
"source": "icu",
|
||||
"static-libs-unix": [
|
||||
"libicudata.a",
|
||||
"libicui18n.a",
|
||||
"libicuio.a",
|
||||
"libicutu.a",
|
||||
"libicuuc.a"
|
||||
],
|
||||
"headers": [
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -419,5 +419,13 @@
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"icu": {
|
||||
"type": "url",
|
||||
"url": "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -139,7 +139,7 @@ class LinuxBuilder extends BuilderBase
|
||||
)
|
||||
);
|
||||
}
|
||||
if ($this->getExt('swoole')) {
|
||||
if ($this->getExt('swoole') || $this->getExt('intl')) {
|
||||
$extra_libs .= ' -lstdc++';
|
||||
}
|
||||
if ($this->getExt('imagick')) {
|
||||
|
||||
20
src/SPC/builder/linux/library/icu.php
Normal file
20
src/SPC/builder/linux/library/icu.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
class icu extends LinuxLibraryBase
|
||||
{
|
||||
public const NAME = 'icu';
|
||||
|
||||
protected function build()
|
||||
{
|
||||
$root = BUILD_ROOT_PATH;
|
||||
shell()->cd($this->source_dir . '/source')
|
||||
->exec("{$this->builder->configure_env} ./runConfigureICU Linux --enable-static --disable-shared --prefix={$root}")
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install');
|
||||
}
|
||||
}
|
||||
@ -123,7 +123,7 @@ class MacOSBuilder extends BuilderBase
|
||||
*/
|
||||
public function buildPHP(int $build_target = BUILD_TARGET_NONE, bool $bloat = false): void
|
||||
{
|
||||
$extra_libs = $this->getFrameworks(true) . ' ' . ($this->getExt('swoole') ? '-lc++ ' : '');
|
||||
$extra_libs = $this->getFrameworks(true) . ' ' . ($this->getExt('swoole') || $this->getExt('intl') ? '-lc++ ' : '');
|
||||
if (!$bloat) {
|
||||
$extra_libs .= implode(' ', $this->getAllStaticLibFiles());
|
||||
} else {
|
||||
|
||||
20
src/SPC/builder/macos/library/icu.php
Normal file
20
src/SPC/builder/macos/library/icu.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
class icu extends MacOSLibraryBase
|
||||
{
|
||||
public const NAME = 'icu';
|
||||
|
||||
protected function build()
|
||||
{
|
||||
$root = BUILD_ROOT_PATH;
|
||||
shell()->cd($this->source_dir . '/source')
|
||||
->exec("{$this->builder->configure_env} ./runConfigureICU MacOSX --enable-static --disable-shared --prefix={$root}")
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install');
|
||||
}
|
||||
}
|
||||
5
src/globals/tests/intl.php
Normal file
5
src/globals/tests/intl.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
assert(class_exists(NumberFormatter::class));
|
||||
Loading…
x
Reference in New Issue
Block a user