30 lines
1.0 KiB
PHP
Raw Normal View History

2024-02-16 01:28:10 +08:00
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
trait gettext
{
protected function build(): void
{
$extra = $this->builder->getLib('ncurses') ? ('--with-libncurses-prefix=' . BUILD_ROOT_PATH . ' ') : '';
$extra .= $this->builder->getLib('libxml2') ? ('--with-libxml2-prefix=' . BUILD_ROOT_PATH . ' ') : '';
shell()->cd($this->source_dir)
2024-04-07 15:52:24 +08:00
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
->execWithEnv(
2024-02-16 01:28:10 +08:00
'./configure ' .
'--enable-static ' .
'--disable-shared ' .
'--disable-java ' .
2024-02-16 23:04:58 +08:00
'--disable-c+ ' .
2024-02-16 01:28:10 +08:00
$extra .
'--with-libiconv-prefix=' . BUILD_ROOT_PATH . ' ' .
'--prefix=' . BUILD_ROOT_PATH
)
2024-04-07 15:52:24 +08:00
->execWithEnv('make clean')
->execWithEnv("make -j{$this->builder->concurrency}")
->execWithEnv('make install');
2024-02-16 01:28:10 +08:00
}
}