44 lines
1.4 KiB
PHP
Raw Normal View History

2023-06-02 11:47:11 +02:00
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
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';
protected function build(): void
2023-06-02 11:47:11 +02: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"';
$ldflags = getenv('SPC_LIBC') !== 'glibc' ? 'LDFLAGS="-static"' : '';
2025-06-09 14:48:05 +07:00
shell()->cd($this->source_dir . '/source')->initializeEnv($this)
->exec(
"{$cppflags} {$cxxflags} {$ldflags} " .
'./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 ' .
'--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);
FileSystem::removeDir(BUILD_LIB_PATH . '/icu');
2023-06-02 11:47:11 +02:00
}
}