2023-10-23 00:37:28 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\linux\library;
|
|
|
|
|
|
2025-03-14 18:22:50 +08:00
|
|
|
use SPC\exception\FileSystemException;
|
2023-10-23 00:37:28 +08:00
|
|
|
use SPC\exception\RuntimeException;
|
2025-06-09 19:32:31 +08:00
|
|
|
use SPC\util\executor\UnixAutoconfExecutor;
|
2023-10-23 00:37:28 +08:00
|
|
|
|
|
|
|
|
class libffi extends LinuxLibraryBase
|
|
|
|
|
{
|
|
|
|
|
public const NAME = 'libffi';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @throws RuntimeException
|
2025-03-14 18:22:50 +08:00
|
|
|
* @throws FileSystemException
|
2023-10-23 00:37:28 +08:00
|
|
|
*/
|
|
|
|
|
public function build(): void
|
|
|
|
|
{
|
2025-06-09 19:32:31 +08:00
|
|
|
UnixAutoconfExecutor::create($this)
|
2025-07-16 12:28:22 +07:00
|
|
|
->configure()->make();
|
2023-10-23 00:37:28 +08:00
|
|
|
|
|
|
|
|
if (is_file(BUILD_ROOT_PATH . '/lib64/libffi.a')) {
|
|
|
|
|
copy(BUILD_ROOT_PATH . '/lib64/libffi.a', BUILD_ROOT_PATH . '/lib/libffi.a');
|
|
|
|
|
unlink(BUILD_ROOT_PATH . '/lib64/libffi.a');
|
|
|
|
|
}
|
|
|
|
|
$this->patchPkgconfPrefix(['libffi.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|