From 061df3b54b6852ed3a70ad820f48047e323820e4 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 16 Dec 2024 12:03:23 +0100 Subject: [PATCH] Add support for swoole on PHP 8.4 (#1030) --- data/supported-extensions | 2 +- install-php-extensions | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/data/supported-extensions b/data/supported-extensions index 8f8eda6..f760337 100644 --- a/data/supported-extensions +++ b/data/supported-extensions @@ -116,7 +116,7 @@ spx 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 sqlsrv 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 ssh2 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 stomp 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.2 8.3 8.4 -swoole 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 +swoole 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 sybase_ct 5.5 5.6 sync 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 sysvmsg 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 diff --git a/install-php-extensions b/install-php-extensions index 518032e..a8087b0 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -1431,7 +1431,8 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" if test $PHP_MAJMIN_VERSION -ge 801; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev" + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev zstd-dev" fi fi # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 @@ -1452,6 +1453,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libbrotli-dev" if test $PHP_MAJMIN_VERSION -ge 801; then buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsqlite3-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + fi fi fi fi @@ -4108,8 +4114,17 @@ installRemoteModule() { fi ;; esac + installRemoteModule_zstd=yes + case "$DISTRO" in + debian) + if test $DISTRO_VERSION_NUMBER -lt 11; then + # swoole 6 requires libzstd >= 1.4.0, but on debian 10 (buster) we have 1.3.8 + installRemoteModule_zstd=no + fi + ;; + esac if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then - # enable sockets supports? + # enable sockets support? addConfigureOption enable-sockets $installRemoteModule_sockets # enable openssl support? addConfigureOption enable-openssl $installRemoteModule_openssl @@ -4121,6 +4136,8 @@ installRemoteModule() { addConfigureOption enable-cares yes # enable brotli support? addConfigureOption enable-brotli yes + # enable zstd support? + addConfigureOption enable-zstd $installRemoteModule_zstd # enable PostgreSQL database support? addConfigureOption enable-swoole-pgsql yes # enable ODBC database support?