mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Provide icu pre-built binary
This commit is contained in:
parent
dc514eb176
commit
2f6987c07b
@ -199,6 +199,7 @@
|
||||
"repo": "unicode-org/icu",
|
||||
"match": "icu4c.+-src\\.tgz",
|
||||
"prefer-stable": true,
|
||||
"provide-pre-built": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
|
||||
@ -6,6 +6,8 @@ namespace SPC\builder\linux\library;
|
||||
|
||||
class icu extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\icu;
|
||||
|
||||
public const NAME = 'icu';
|
||||
|
||||
protected function build(): void
|
||||
@ -32,5 +34,7 @@ class icu extends LinuxLibraryBase
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->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
|
||||
{
|
||||
use \SPC\builder\unix\library\icu;
|
||||
|
||||
public const NAME = 'icu';
|
||||
|
||||
protected function build(): void
|
||||
@ -16,5 +18,7 @@ class icu extends MacOSLibraryBase
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->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