add liburing for swoole

This commit is contained in:
DubbleClick 2025-08-25 22:57:04 +07:00
parent 37e0f1d3f3
commit 2694dd9e21
5 changed files with 62 additions and 1 deletions

View File

@ -846,6 +846,11 @@
"zstd",
"unixodbc"
],
"lib-suggests-linux": [
"zstd",
"unixodbc",
"liburing"
],
"ext-depends": [
"openssl",
"curl"

View File

@ -925,5 +925,20 @@
"zstd.h",
"zstd_errors.h"
]
},
"liburing": {
"source": "liburing",
"pkg-configs": [
"liburing",
"liburing-ffi"
],
"static-libs-linux": [
"liburing.a",
"liburing-ffi.a"
],
"headers-linux": [
"liburing/",
"liburing.h"
]
}
}

View File

@ -1136,5 +1136,14 @@
"type": "file",
"path": "LICENSE"
}
},
"liburing": {
"type": "ghtar",
"repo": "axboe/liburing",
"prefer-stable": true,
"license": {
"type": "file",
"path": "COPYING"
}
}
}

View File

@ -61,7 +61,7 @@ class swoole extends Extension
}
$arg .= $this->builder->getLib('nghttp2') ? (' --with-nghttp2-dir=' . BUILD_ROOT_PATH) : '';
$arg .= $this->builder->getLib('zstd') ? ' --enable-zstd' : '';
$arg .= $this->builder->getLib('iouring') ? ' --enable-iouring' : '';
$arg .= $this->builder->getLib('liburing') ? ' --enable-iouring' : '';
$arg .= $this->builder->getExt('sockets') ? ' --enable-sockets' : '';
// additional feature: swoole-pgsql, it should depend on lib [postgresql], but it will lack of CFLAGS etc.

View File

@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
use SPC\util\executor\UnixAutoconfExecutor;
class liburing extends LinuxLibraryBase
{
public const NAME = 'liburing';
protected function build(): void
{
// Build liburing with static linking via autoconf
UnixAutoconfExecutor::create($this)
->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']);
}
}