2023-06-02 11:47:11 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\linux\library;
|
|
|
|
|
|
2024-07-19 23:34:01 +08:00
|
|
|
use SPC\store\FileSystem;
|
|
|
|
|
|
2023-06-02 11:47:11 +02:00
|
|
|
class icu extends LinuxLibraryBase
|
|
|
|
|
{
|
2024-07-09 11:15:34 +08:00
|
|
|
use \SPC\builder\unix\library\icu;
|
|
|
|
|
|
2023-06-02 11:47:11 +02:00
|
|
|
public const NAME = 'icu';
|
|
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
protected function build(): void
|
2023-06-02 11:47:11 +02:00
|
|
|
{
|
2025-05-15 14:47:54 +07:00
|
|
|
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1 -DPIC -fPIC"';
|
2025-06-07 20:09:50 +07:00
|
|
|
$cxxflags = 'CXXFLAGS="-std=c++17 -DPIC -fPIC -fno-ident"';
|
2025-03-14 18:22:50 +08:00
|
|
|
$ldflags = getenv('SPC_LIBC') !== 'glibc' ? 'LDFLAGS="-static"' : '';
|
2025-06-09 14:48:05 +07:00
|
|
|
shell()->cd($this->source_dir . '/source')->initializeEnv($this)
|
|
|
|
|
->exec(
|
2023-10-23 00:37:28 +08:00
|
|
|
"{$cppflags} {$cxxflags} {$ldflags} " .
|
2023-10-16 14:14:19 +02:00
|
|
|
'./runConfigureICU Linux ' .
|
2023-06-02 20:26:19 +08:00
|
|
|
'--enable-static ' .
|
|
|
|
|
'--disable-shared ' .
|
|
|
|
|
'--with-data-packaging=static ' .
|
|
|
|
|
'--enable-release=yes ' .
|
2024-07-08 00:06:59 +08:00
|
|
|
'--enable-extras=no ' .
|
2023-06-02 20:26:19 +08:00
|
|
|
'--enable-icuio=yes ' .
|
|
|
|
|
'--enable-dyload=no ' .
|
2024-07-19 22:49:13 +08:00
|
|
|
'--enable-tools=yes ' .
|
2023-06-02 20:26:19 +08:00
|
|
|
'--enable-tests=no ' .
|
|
|
|
|
'--enable-samples=no ' .
|
2023-10-16 14:14:19 +02:00
|
|
|
'--prefix=' . BUILD_ROOT_PATH
|
2023-06-02 20:26:19 +08:00
|
|
|
)
|
2025-06-09 14:48:05 +07:00
|
|
|
->exec('make clean')
|
|
|
|
|
->exec("make -j{$this->builder->concurrency}")
|
|
|
|
|
->exec('make install');
|
2024-07-09 11:15:34 +08:00
|
|
|
|
|
|
|
|
$this->patchPkgconfPrefix(['icu-i18n.pc', 'icu-io.pc', 'icu-uc.pc'], PKGCONF_PATCH_PREFIX);
|
2024-07-19 23:34:01 +08:00
|
|
|
FileSystem::removeDir(BUILD_LIB_PATH . '/icu');
|
2023-06-02 11:47:11 +02:00
|
|
|
}
|
|
|
|
|
}
|