From c4493e61068f48d695b6cf19fe865527a5f74926 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 28 Nov 2024 15:02:44 +0100 Subject: [PATCH] Add support for swoole 6 (#1019) --- install-php-extensions | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/install-php-extensions b/install-php-extensions index 06dfff5..66cb9d8 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -1434,6 +1434,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev" fi fi + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1449,6 +1455,11 @@ buildRequiredPackageLists() { fi fi fi + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi ;; sybase_ct@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" @@ -4064,18 +4075,28 @@ installRemoteModule() { installRemoteModule_zts=no fi installRemoteModule_sqlite=yes + installRemoteModule_iouring=no case "$DISTRO" in alpine) if test $DISTRO_MAJMIN_VERSION -lt 317; then # we need sqlite3 >= 3.7.7 installRemoteModule_sqlite=no fi + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi ;; debian) if test $DISTRO_MAJMIN_VERSION -lt 1200; then # we need sqlite3 >= 3.7.7 installRemoteModule_sqlite=no fi + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi ;; esac if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then @@ -4102,7 +4123,7 @@ installRemoteModule() { # enable swoole thread support (need php zts support)? addConfigureOption enable-swoole-thread $installRemoteModule_zts # enable iouring for file async support? - addConfigureOption enable-iouring yes + addConfigureOption enable-iouring $installRemoteModule_iouring elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets