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;
|
2025-06-09 19:32:31 +08:00
|
|
|
use SPC\util\executor\UnixAutoconfExecutor;
|
2023-08-20 19:51:45 +08:00
|
|
|
|
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
|
|
|
{
|
2025-06-09 19:32:31 +08:00
|
|
|
UnixAutoconfExecutor::create($this)
|
|
|
|
|
->configure(
|
|
|
|
|
'--disable-scripts',
|
|
|
|
|
'--disable-doc',
|
|
|
|
|
'--with-libiconv',
|
2025-07-22 21:13:35 +08:00
|
|
|
'--bindir=/tmp/xz', // xz binary will corrupt `tar` command, that's really strange.
|
2023-04-29 18:59:47 +08:00
|
|
|
)
|
2025-06-09 19:32:31 +08:00
|
|
|
->make();
|
2023-04-29 18:59:47 +08:00
|
|
|
$this->patchPkgconfPrefix(['liblzma.pc']);
|
2025-06-10 19:46:55 +07:00
|
|
|
$this->patchLaDependencyPrefix();
|
2023-04-29 18:59:47 +08:00
|
|
|
}
|
|
|
|
|
}
|