2025-08-25 22:57:04 +07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\linux\library;
|
|
|
|
|
|
2025-08-26 14:07:49 +07:00
|
|
|
use SPC\exception\WrongUsageException;
|
2025-08-25 22:57:04 +07:00
|
|
|
use SPC\util\executor\UnixAutoconfExecutor;
|
2025-08-26 14:07:49 +07:00
|
|
|
use SPC\util\SPCTarget;
|
2025-08-25 22:57:04 +07:00
|
|
|
|
|
|
|
|
class liburing extends LinuxLibraryBase
|
|
|
|
|
{
|
|
|
|
|
public const NAME = 'liburing';
|
|
|
|
|
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
2025-08-26 14:07:49 +07:00
|
|
|
if (SPCTarget::getLibc() === 'glibc' && SPCTarget::getLibcVersion() < 2.30) {
|
|
|
|
|
throw new WrongUsageException('liburing requires glibc >= 2.30');
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-25 22:57:04 +07:00
|
|
|
UnixAutoconfExecutor::create($this)
|
2025-08-26 14:07:49 +07:00
|
|
|
->appendEnv([
|
2025-08-26 14:08:09 +07:00
|
|
|
'CFLAGS' => '-D_GNU_SOURCE',
|
2025-08-26 14:07:49 +07:00
|
|
|
])
|
2025-08-25 22:57:04 +07:00
|
|
|
->removeConfigureArgs(
|
|
|
|
|
'--disable-shared',
|
|
|
|
|
'--enable-static',
|
|
|
|
|
'--with-pic',
|
|
|
|
|
'--enable-pic',
|
|
|
|
|
)
|
|
|
|
|
->addConfigureArgs(
|
|
|
|
|
'--use-libc'
|
|
|
|
|
)
|
|
|
|
|
->configure()
|
|
|
|
|
->make(with_clean: false)
|
|
|
|
|
->exec("rm -rf {$this->getLibDir()}/*.so*");
|
|
|
|
|
|
|
|
|
|
$this->patchPkgconfPrefix(['liburing.pc', 'liburing-ffi.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|