mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
24 lines
641 B
PHP
24 lines
641 B
PHP
|
|
<?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);
|
||
|
|
}
|
||
|
|
}
|