mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Provide icu pre-built binary
This commit is contained in:
parent
dc514eb176
commit
2f6987c07b
@ -199,6 +199,7 @@
|
|||||||
"repo": "unicode-org/icu",
|
"repo": "unicode-org/icu",
|
||||||
"match": "icu4c.+-src\\.tgz",
|
"match": "icu4c.+-src\\.tgz",
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
|
"provide-pre-built": true,
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
|
|||||||
@ -6,6 +6,8 @@ namespace SPC\builder\linux\library;
|
|||||||
|
|
||||||
class icu extends LinuxLibraryBase
|
class icu extends LinuxLibraryBase
|
||||||
{
|
{
|
||||||
|
use \SPC\builder\unix\library\icu;
|
||||||
|
|
||||||
public const NAME = 'icu';
|
public const NAME = 'icu';
|
||||||
|
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
@ -32,5 +34,7 @@ class icu extends LinuxLibraryBase
|
|||||||
->exec('make clean')
|
->exec('make clean')
|
||||||
->exec("make -j{$this->builder->concurrency}")
|
->exec("make -j{$this->builder->concurrency}")
|
||||||
->exec('make install');
|
->exec('make install');
|
||||||
|
|
||||||
|
$this->patchPkgconfPrefix(['icu-i18n.pc', 'icu-io.pc', 'icu-uc.pc'], PKGCONF_PATCH_PREFIX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,8 @@ namespace SPC\builder\macos\library;
|
|||||||
|
|
||||||
class icu extends MacOSLibraryBase
|
class icu extends MacOSLibraryBase
|
||||||
{
|
{
|
||||||
|
use \SPC\builder\unix\library\icu;
|
||||||
|
|
||||||
public const NAME = 'icu';
|
public const NAME = 'icu';
|
||||||
|
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
@ -16,5 +18,7 @@ class icu extends MacOSLibraryBase
|
|||||||
->exec('make clean')
|
->exec('make clean')
|
||||||
->exec("make -j{$this->builder->concurrency}")
|
->exec("make -j{$this->builder->concurrency}")
|
||||||
->exec('make install');
|
->exec('make install');
|
||||||
|
|
||||||
|
$this->patchPkgconfPrefix(['icu-i18n.pc', 'icu-io.pc', 'icu-uc.pc'], PKGCONF_PATCH_PREFIX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23
src/SPC/builder/unix/library/icu.php
Normal file
23
src/SPC/builder/unix/library/icu.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
|
||||||
|
trait icu
|
||||||
|
{
|
||||||
|
public function beforePack(): void
|
||||||
|
{
|
||||||
|
// Replace buildroot/bin/icu-config default_prefix=* to placeholder default_prefix={BUILD_ROOT_PATH}
|
||||||
|
$icu_config = BUILD_ROOT_PATH . '/bin/icu-config';
|
||||||
|
FileSystem::replaceFileRegex($icu_config, '/default_prefix=.*/m', 'default_prefix="{BUILD_ROOT_PATH}"');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function install(): void
|
||||||
|
{
|
||||||
|
$icu_config = BUILD_ROOT_PATH . '/bin/icu-config';
|
||||||
|
FileSystem::replaceFileStr($icu_config, '{BUILD_ROOT_PATH}', BUILD_ROOT_PATH);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user