2023-04-29 18:59:47 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
use SPC\exception\FileSystemException;
|
|
|
|
|
use SPC\exception\RuntimeException;
|
|
|
|
|
|
2023-04-29 18:59:47 +08:00
|
|
|
trait xz
|
|
|
|
|
{
|
2023-08-20 19:51:45 +08:00
|
|
|
/**
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
*/
|
|
|
|
|
public function build(): void
|
2023-04-29 18:59:47 +08:00
|
|
|
{
|
|
|
|
|
shell()->cd($this->source_dir)
|
|
|
|
|
->exec(
|
|
|
|
|
"{$this->builder->configure_env} ./configure " .
|
|
|
|
|
'--enable-static ' .
|
|
|
|
|
'--disable-shared ' .
|
2023-08-20 19:51:45 +08:00
|
|
|
"--host={$this->builder->getOption('gnu-arch')}-unknown-linux " .
|
2023-04-29 18:59:47 +08:00
|
|
|
'--disable-scripts ' .
|
|
|
|
|
'--disable-doc ' .
|
|
|
|
|
'--with-libiconv ' .
|
|
|
|
|
'--prefix='
|
|
|
|
|
)
|
|
|
|
|
->exec('make clean')
|
|
|
|
|
->exec("make -j{$this->builder->concurrency}")
|
|
|
|
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
|
|
|
|
$this->patchPkgconfPrefix(['liblzma.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|